Assembly Posted October 5, 2010 Share Posted October 5, 2010 I thought this would create a VP on a sheet layer and turn on all the Layers and Classes. But I can't get the layers or classes to turn on?. The result is a new viewport on the layer I name, but the view port is a red box with cross hatch, I click on the VP and none of the layers or classes are turned on. I have run with testing procedure that output the layer and classnames to a file. The loops are passing correctly. PROCEDURE NewVPWithAllOn(SheetLayerName:String); Const TurnOn=1; TurnOff=-1; MakeGray=2; DesignLayer=1; SheetLayer=2; VAR LayerHandle:Handle; ClassName:String; Result:Boolean; iTemp:Integer; hVP:HANDLE; BEGIN; LayerHandle:=CreateLayer(Concat(SheetLayerName,'-Sheet'),SheetLayer); hVP:=CreateVP(LayerHandle); LayerHandle:=fLayer; While LayerHandle<>Nil Do BEGIN; Result:=SetVPLayerVisibility(hVP,layerHandle,TurnOn); layerHandle:=NextLayer(layerHandle); END; For iTemp:= 1 to ClassNum DO BEGIN; Result:=SetVPClassVisibility(hVP,ClassList(iTemp),1); END; END; Quote Link to comment
Pat Stanford Posted October 5, 2010 Share Posted October 5, 2010 Could this be a case of when the object is created? Usually objects created in VS don't actually exist and get a handle until the END of the script execution. This means that at least with PIOs you can't create the object and then set the parameters (or duplicate, or rotate, etc). It is likely that the same is true for VPs. What about getting the existing class/layer visibilities, turning everything on, create the VP and then reset the visibilities? Quote Link to comment
maarten. Posted October 5, 2010 Share Posted October 5, 2010 Result:=SetVPClassVisibility(hVP,ClassList(iTemp),1); should be Result:=SetVPClassVisibility(hVP,ClassList(iTemp),0); Quote Link to comment
Assembly Posted October 5, 2010 Author Share Posted October 5, 2010 Thanks Maarten.That was it. The basics of the procedure work now... This Procedure is very unstable in the script I have though.... Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.