VectorGeek Posted September 4, 2014 Share Posted September 4, 2014 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. Quote Link to comment
Vectorworks, Inc Employee klinzey Posted September 5, 2014 Vectorworks, Inc Employee Share Posted September 5, 2014 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. Quote Link to comment
VectorGeek Posted September 5, 2014 Author Share Posted September 5, 2014 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. Quote Link to comment
Vectorworks, Inc Employee klinzey Posted September 5, 2014 Vectorworks, Inc Employee Share Posted September 5, 2014 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); Quote Link to comment
VectorGeek Posted September 5, 2014 Author Share Posted September 5, 2014 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. Quote Link to comment
Vectorworks, Inc Employee klinzey Posted September 8, 2014 Vectorworks, Inc Employee Share Posted September 8, 2014 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. Quote Link to comment
VectorGeek Posted September 9, 2014 Author Share Posted September 9, 2014 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. Quote Link to comment
VectorGeek Posted February 10, 2016 Author Share Posted February 10, 2016 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 Quote Link to comment
VectorGeek Posted October 29, 2019 Author Share Posted October 29, 2019 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. 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.