Jump to content

New Class Viewport/ Saved View Visibility


Recommended Posts

HI All


Apologies if this has been answered somewhere already I'm struggling to find any answers.


I am using vs.NameClass() to create a new class within a PIO. Is there a way to make that Class automatically visible in Viewports AND saved views similar to functionality within the new class dialog (SS below for reference)




I'm basically looking for a way to force that class to be visible within all Viewports & Saved views to stop the user having to go through and edit them afterwards.


I'm guessing I could iterate through every single viewport once the class is created and edit the visibility there. But that seems massively time consuming and inefficient. Especially for a large document.


If this is the only option available to me, does anyone know if this approach would also work with Saved Views? I can see a function for creating a new Saved View (vs.SaveSheet()) but nothing to get a list of saved views or edit one.


Thanks in Advance!

Link to comment

It looks like ObjectVariableInt  with a handle to a class and a selector of 1018 will do what you want.


Procedure Test;

VAR	H1:Handle;

SetObjectVariableInt(H1,1018, 2	);



Actually it will do far more than you want.


SetObjectVariableInt(GetObject('Class Name 3'),1018,2);


The one line above will set Class Name 3 to Grey in all Viewports.  Use with Caution.


-1 = Invisible

0 = Normal

2 = Grey


There is a similar ObjectVariable 455 that sounds like it will do the same for Saved Views.  


And 1017 is for Layers in Viewports

And 454 is for Layers in Saved Views.


Please note that even though 1017 and 1018 are in the Viewports section of the Appendix, they need a handle to the Class Definition, not to the Viewport.



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.

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