Jump to content
VectorGeek

VS and Design Layer Viewports

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.

Share this post


Link to post

A viewport should return an object type of 122 not 86.

You may be traversing into the viewport or grabbing something on a different layer.

Once you have the correct handle the other calls should work.

Share this post


Link to post

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.

Share this post


Link to post

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);

Share this post


Link to post

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.

Share this post


Link to post

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.

Share this post


Link to post

Thanks Kevin. That would be great if you could get the peoper layer name syntax back to me. The curious thing is, the line:

SetVPLayerVisibility(h,GetLayerByName('green layer'),-1);

is returning TRUE.

If the layer name was wrong , would you not expect that function to return FALSE?

V-G.

Share this post


Link to post

Bumping this in case anyone knows how to do this.

In essence, I have files with numerous referenced design layer viewports. I'm trying to find a way to control layer visibility within multiple viewports using VS.

Help!!!!!

Thx.

V-G

Share this post


Link to post

Kevin (or anyone else):

 

Were you ever able to find out if it's possible to access layers within a reference DLVP? I have tried a lot of prefixes with NNA_, but nothing has worked yet.

 

V-G.

 

 

Share this post


Link to post

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.


 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...