Jump to content

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!

Link to comment

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

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