Jump to content
Developer Wiki and Function Reference Links ×

VS and Design Layer Viewports


VectorGeek

Recommended Posts

Does anybody have a clue as to why Design Layer Viewports return a type of "86" (Plug-in Object)?

I am looking for a way to control the layer and class visibility inside design layer viewports using VS. But since they don't return a correct type, the following functions won't work:

GetVPLayerVisibility

SetVPLayerVisibility

GetVPClassVisibility

SetVPClassVisibility

etc. etc.

Any tricks?

Thanks!

V-G.

Link to comment

Hey Kevin,

Thanks for the quick reponse.

It should work as you say, but it doesn't. Sheet Layer Viewports work fine and return 122. Design Layer Viewports return 86 (PIO).

Attached is a sample file that you can see the behaviour in. I know 86 is wrong because there are no PIOs in the file, just colored rectangles.

Please advise if this is a bug or if there is a workaround. Thanks.

V-G.

Link to comment
  • Vectorworks, Inc Employee

Sorry, Design Layer Viewports are type 86 because of how they are constructed. You just have to check the object name to see if it's a DLVP then the call works the same as a normal Viewport.

Procedure VP_control;

VAR

h : HANDLE;

BEGIN

h := FSActLayer;

If (GetTypeN(h) = 86) & (GetName(GetParametricRecord(h)) = 'NNA_DesignLayerViewport') then

Begin

If SetVPLayerVisibility(h,GetLayerByName('green layer'),-1) then

RedrawAll;

End;

END;

Run(VP_control);

Link to comment

Hey Kevin,

Thanks for pointing this out. I did some further testing and determined that where it fails is if the design layer viewport is referenced from an external file. Handle attachment works fine, but the layer/class controls (SetVPLayerVisibility, for example) cease to function properly.

To test, just "Save As..." the file I posted and create a new DLVP that is referenced.

V-G.

Link to comment
  • Vectorworks, Inc Employee

I'll do some more checking but a referenced layer would not have the name "green layer" when it is referenced. the layer name in the referencing document would be something like "NNA_Ref_green layer". I don't know how accessible the referenced layers are via VectorScript.

Link to comment
  • 1 year later...
  • 3 years later...

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...