Total count of item in a category, then push the Mark value with a certain order

Hello everybody,
I am trying to figure out what would be the best solution to reorder the Mark parameter of certain categories in Revit MEP.
As you can see on the picture below, I am picking the category, then the parameter by name, then a simple list.count to know how many items are there.

The next step to complete the script is:

Is it possible to take the count number and assign a new value to each starting from 001? In this way I will not have elements “missing” like 008, 011, 054, I would like to have 001, 002, 003, counting till the “total count” number.

Thanks for your time in advance.

wow, thanks a lot @erfajo !!! :v:

I have completed the script and it is working really great!

If anyone needs a solution like this, feel free to use it. Check the image below :slight_smile:

2 Likes

Here is a OOTB solution, if you do not want a prefix then do not include the last code block that contains “P”.

1 Like

Done @erfajo, this is awesome

Again, if anyone needs a solution like this, feel free to use it. Check the image below.