Jump to content
Developer Wiki and Function Reference Links ×

Changing Saved View Properties Programmatically


Recommended Posts

I am trying to programmatically change saved view settings but it seems like editing some of these items are limited.   I have been able to find that the active class setting of the saved view using:

 

    ovSheetSaveActiveClass = 460; // Sint32, read-only, the active class internal Index of the saved view 

 

   savedViewActiveClass := GetObjectVariableInt(savedViewHandle, 460);

 

but the setting is read-only. The active class internalIndex of the saved view is returned but I cannot change it.  Is there any other way I can change it?  Why are there such limitations?

 

 

image.png.8fc41913e8c80ea161c83ab3bf452db9.png

Link to comment

VW decided something like 10 years ago that Saved Views were something special and locked them down. Prior to that they were just Vectorscripts and you could edit them as you saw fit.

 

The only reliable ways to work with Saved Views in Vectorscript (or Python) are to use the View Save/View Restore/View Delete commands.  Restore a view, Delete that View, Change what needs to be changed. Save the view.

 

My $0.02

Link to comment

Ahh, got it. Can you duplicate an existing saved view "template" and modify it so it has the desired settings? We are trying to set up jobs with the correct saved views based on input from the user on number of sheets, detail sheets. etc.

 

Do you know if the SDK can do it?

 

Thanks!

Link to comment

To duplicate a view that was previously saved, use VRestore() with the name of a previously saved view, make any changes you want to the now-current view, then use VSave() with a new name to save the modified view. There is no way to edit the attributes of a saved view entity, just save a newly modified view under a new name. 

 

If you want to return to the view you had just before the edits, try this:

 

VSave('This view');      { temporary view }

VRestore('An Existing View');

...

 { make all desired changes to the view HERE. }

...

VSave('A New View');   { based on An Existing View }

VRestore('This view');

VDelete('This view');    { clean up named view clutter }

 

HTH,

Raymond

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