Jump to content
Sign in to follow this  
Pat Stanford

Update all Viewports on a Layer

Recommended Posts

I have found the Update All Viewports command dangerous as it updated everything in the file and can take a very loooooooong time (in one case 17+ hours.) You can certainly select all the viewports and click the Update button, but if you accidentally select anything other than viewports, you don't get the button in the OIP.

This script will select and update each viewport on a sheet layer.

{*************************}

Procedure UpdateSheetLayerVPs;

{Selects, Updates and Deselects each viewport on a sheet layer}

{Revised to handle both sheet layer and section viewports}

{? 2008, Coviana, Inc - Pat Stanford pat@coviana.com}

{Licensed under the GNU Lesser General Public License}

Begin

DSelectAll;

SelectObj((ST=REGVIEWPORT) or (ST=SECTVIEWPORT));

While FSActLayer<>Nil do

Begin

UpdateVP(FSActLayer);

SetDSelect(FSActLayer);

End;

End;

Run(UpdateSheetLayerVPs);

{************************}

Pat

Share this post


Link to post

Hi Pat,

This script is very handy.

I was wanting to just update viewports of a certain class.

When put

UpdateVP(C='Elev.VP');

I get an error. How would this be done?

Thanks in Advance

Tui

Share this post


Link to post

UpdateVP requires a handle to a viewport. You are trying to pass it a class.

You need to change the Selct Obj line.

SelectObj(((ST=REGVIEWPORT) or (ST=SECTVIEWPORT) and (c='Elev.VP)));

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×