Jump to content
Sign in to follow this  
Daryl Wood

Script to loop through selected objects

Recommended Posts

Has anyone written a script that can loop through a batch of selected objects and insert an incremented field value?

With a bunch of walls selected, I need a script that would add a unique and incremented value to the mark field in the "Wall data" record.

Anyone done something like this?

Share this post

Link to post


This would be a relatively straight forward script to create, though you could add some layers of complexity with user interaction and error checking.

The general structure would be to use ForEachObject to step through selected objects of type wall. Increment a global variable on each pass, and set the field with SetRField.

Are you looking for some guidance on getting started with VS in general, or are you getting stuck on the particulars of the script?

You may want to have a look at http://scs-inc.us/Other/VSFR/default.php and the record and document list examples at http://www.nemetschek.net/support/custom/vscript/example.php.


Share this post

Link to post

Hello Josh,

Thanks for the Reply. I realize this is a relatively straight forward script and thought maybe someone had written one I could use without spending the time necessary to write it myself. I just don't want to re-invent the wheel for something like this. It's all about the balance of time, you know.

I do, however, feel that it may be worth the time necessary to make something like that as generic as possible in order to easily modify it and use it to quickly populate incremental data. I use a lot of worksheets as schedules in my designs so this would be very useful to me.

Thanks for the two links, I'll check them out.


Share this post

Link to post

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.

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.

  • Create New...