Change ID of project parameters (from shared parm)

Change ID of project parameters (from shared parm)

dante.van.wettum
Advocate Advocate
917 Views
3 Replies
Message 1 of 4

Change ID of project parameters (from shared parm)

dante.van.wettum
Advocate
Advocate

The situation:

In a project, we have been adding a bunch of parameters as project parameters, that are all made from our shared parameter file.

In first instance we added a few parameters with names like "Code_01" to "Code_05".

When adding, they automatically get an ID in the project where in this case the ID's are all around the 204420 range.

 

We continued adding more parameters during the project...

 

One day, we noticed we needed a few more parameters for the "Code_xx" range so we added "Code_06" and "Code_07".

These parameters have an ID that is more into the range of 446300.

 

It seems that the list of shown parameters in the properties panel, is being sorted based upon the ID number, and Revit does not offer an way to sort these parameters out of the box.

 

This made me think:

As the ID of a parameter is a Readonly field, i cant just change this to an different number.

Is there any other way to trick the list in sorting in a different way (preferred alphabetically), or maybe even change the ID's of parameters without losing already filled in parameters or corrupting my project ?  (Using Revit 2017)

 

 

 

 

0 Likes
Accepted solutions (1)
918 Views
3 Replies
Replies (3)
Message 2 of 4

jeremytammik
Autodesk
Autodesk
Accepted solution

Dear Dante,

 

Thank you for your very sensible query.

 

Unfortunately, as you already suspected, the element ids are read-only for a good reason, and there is no way to affect them.

 

Except one, actually... they are simply assigned sequentially by Revit one by one as new elements are added to the database.

 

This automatically generates several Undocumented ElementId Relationships:

 

http://thebuildingcoder.typepad.com/blog/2011/11/undocumented-elementid-relationships.html

 

So, you can affect the order of element ids by simply generating the elements in the desired order.

 

What this means for you:

 

Based on this, you can solve your task like this:

 

  • Extract all the elements and their properties and relationships from your project and store them somewhere else.
  • Recreate the entire project from scratch using the stored data, and ensure that the elements are generated in the desired order.

 

This might work for a template file, where the elements are not related in a very complex manner.

 

For a real project, sorry to say, it obviously very quickly becomes much too hard to extract and store all the relationships independently of the existing project.

 

I hope this helps.

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 4

dante.van.wettum
Advocate
Advocate

Thank you for the reply.

As it is for a real project now that consists out of approximate sub 25 models this wont be an option now.

 

Alternative for now would be a relative small and easy addin that will read the instance parameters of the selection and put this in a simple gridview on a winform. Here the user will be able to sort the list, and it will just simply push the new values to the elements.

 

Hopefully this feature will be buildin revit in a later release (as they did for revit families as well)

0 Likes
Message 4 of 4

jeremytammik
Autodesk
Autodesk

Dear Dante,

 

Thank you for your update, appreciation and background info.

 

If you have a wish for new functionality, I would suggest that you submit it to the Revit Idea Station and ensure it gets lots of votes, or vote for an existing entry, if there is one.

 

Thank you!

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes