Jump to content
Matster

What's the highest Number?!

Recommended Posts

I need a way of finding out what the highest number is of a specific record and then putting it on the drawing (ideally auto updating!)

 

This is for a few things, chair/table number (don' really like the auto creation tool!) and cable numbers on schematics, these are just a couple of current requirement, but i just think it would be really useful!

Share this post


Link to post

You probably want to move this over to the scripting forum. There’s no magic bullet here, especially to work universally, but the algorithm is fairly straight forwards:

 

Define a global variable = 1

 

iterate through objects with a ForEachObject command

 

Get the value of your ID field and convert to number 

 

if the value is greater than the global, set the global to the value

 

once through all the objects, return the global

  • Like 1

Share this post


Link to post

Thanks I have no (or limited) clue with scripting, so i think i'll re-post this in the Python forum and see if any can lead me through it!

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.

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.


 

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