Autodesk / revit-ifc

IFC for Revit and Navisworks (2019+)
476 stars 194 forks source link

INQ: Automating IFC Export in Revit 2024 to Use Shared Parameter for Element IDs #739

Open tsau opened 7 months ago

tsau commented 7 months ago

Inquiry description

Hello everyone,

I'm seeking advice on customising the IFC export process in Revit 2024. My goal is to have the IFC export utilise a shared parameter named as the element ID for each element. This adjustment is crucial because the name of the element when opened in our CNC control program is derived from the element ID, and currently, the only way to change it to match our needs is manually. I discovered that automating this process could significantly streamline our workflow.

I have no experience with .NET programming or the Revit API and have been using the built-in IFC export tool. Is there a method, tool, or script available that can help in writing the shared parameter value to the IFC file instead of the default element ID? Any guidance or examples of similar customizations would be beneficial.

Thank you for any insights or directions!

Revit Version

2024.0.x

IFC for Revit Addon Version

24.x.x

Windows Version

10 22H2

AngelVelezSosa commented 7 months ago

Right now, the Tag attribute of each entity that is derived from IfcRoot is the Revit element id. Can you just read that information and use it without having to further modify the IFC file?

tsau commented 7 months ago

Using the default element IDs throughout the process would be challenging due to their format and lack of meaningful data for my specific use case. Since my CNC operating program relies on the name of the part from the IfcRoot_Name attribute, it's essential to find a way to customize the IFC export to replace or align this attribute with the shared parameter values from Revit. A solution to automate this adjustment would be very beneficial for streamlining my workflow. image image

eibre commented 7 months ago

You can override the name with a parameter IfcName. I'm not sure if it works for parts though.