Jump to content
Developer Wiki and Function Reference Links ×

Saved View Script


Recommended Posts

Rick - there is already a Saved View option in VW.

A view can either be saved under the Page View or from the RH pop-up list on the drawing pane bottom bar.

You can then return to these Saved Views by either selecting the required view from the bottom bar pop-up list or opening the saved view script pallette and just double clicking on the view you want.

[ 03-31-2005, 08:26 PM: Message edited by: mike m oz ]

Link to comment

Try using the VectorScript routine VSave(name:String) to create a saved view and then later your script can call VRestore(name:String) to change the view back to the saved one.

You could put the VRestore call into a VectorScript Plug-in Menu, add it to your workspace and assign it a shortcut key (like cmd+option+P) with Workspace Editor.

Jeff

Link to comment
  • 17 years later...

Hi Sean,

   It's a simple one-line script. It could be more complicated if you want, but if you have already saved a view by name, this one-line script will recall it. Since there are no variable names, the script does not need a PROCEDURE name; / BEGIN /  END; / Run(name); structure.

 

VRestore('Your Saved View Name Here');

 

HTH,

Raymond

  • Like 1
Link to comment

what If I need to create the saved view in the file still? I have saved views I use on my current template but on older drawings these don't exist. If I want to use them I have to build them from scratch. can you show me how to use vsave(name:string) to create a script of a current view in one file that I can recall in a different file (after updating the classes and layers manually to match the former file)

 

Thanks

Link to comment

Hi Sean,

   Sadly, Saved Views cannot be Copy/Paste from one file to another; nor can they be Imported. With a bit of work, it is possible that most information from a Saved View could be "gathered" in one file, saved to a neutral domain, then recreated in a second file, utilizing two scripts. I don't know if anyone has published a solution over the years, so hopefully if it has been done, someone will chime in.

 

   This has been requested many times over the years, but never implemented. I've thought of doing it several times over the past decades, but my need has never been great enough to justify the time spent. How many files do you need to update? If it's in the dozens or more and you can't find an existing solution, you might consider contracting the job out. But if you have a LOT of time on your hands, you could learn some seriously good scripting skills in the effort.

 

   Before you go any further, have you searched this Forum for this topic. I know it has come up several times, but I don't remember if any solutions were put forward.

 

 @Pat Stanford, have you any recollection of a prior solution?

 

Raymond

Link to comment

Back in 2009 Wes Garner pointed out that you can copy and paste cameras between files.

 

So one possible solution is to activate the saved view, place a camera object, copy the camera, paste into the other file, create a new saved view.

 

I don't have anything in my files about saving and recreating Saved Views.

 

My thought would be to create a big record format and attach it to an object. Two scripts, one to populate the record from the existing saved view, one to set the view in the second file to those settings. Then you could use DoMenuTextByName to call the Save View... command. You would still have to check and OK the dialog box.

 

 

Link to comment

Ray / Pat

 

Did as quick test of the above (Long have we needed same Saved View in a different design) \

The Saved View

     add Camera

          Match Camera to view

              Copy Camera 

                    Past Camera in different drawing

                        Activate Camera View 

Works great - Except ...

 

Question: ¿ Camera does NOT like to do Top / Plan View ? (and the Class Layer settings of the Saved View...)

   

Suggestions are appreciated.

 

Peter

Link to comment

FYI

 

One trick we have used successfully a few times

 

Important Part: Old drawing (file without Saved Views) is very similar to new drawing (file with the desired Save Views).

 

Duplicate new drawing. (This one has the desired Saved Views)

Turn on all classes New & Old files

Unlock all items New & Old files.

Delete all items in this duplicate of the New file.

Copy all items from Old file (one layer at a time if needed)

Paste in Place into the duplicate New file.

Layer and Class names should be the same Old / New files

Select if Symbols, Textures etcetera, are the Old or New as needed (when prompted).

     ( May need to retain (locked) a reference locater as Paste in Place is not what it once was...)

 

Group then Ungroup is also another way to keep from having a mess in the process.

 

Old Drawing is now in a file with the Desired Saved Views from the New drawing

 

Peter

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