Jump to content
Developer Wiki and Function Reference Links ×

ViewPorts


Assembly

Recommended Posts

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;

Link to comment

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?

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...