El Dinyo Posted May 16, 2023 Share Posted May 16, 2023 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? Quote Link to comment
Pat Stanford Posted May 17, 2023 Share Posted May 17, 2023 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 Quote Link to comment
El Dinyo Posted May 17, 2023 Author Share Posted May 17, 2023 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! Quote Link to comment
MullinRJ Posted May 17, 2023 Share Posted May 17, 2023 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 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.