Is there a way to change ElementId?

Is there a way to change ElementId?

victor.bastidas
Enthusiast Enthusiast
923 Views
7 Replies
Message 1 of 8

Is there a way to change ElementId?

victor.bastidas
Enthusiast
Enthusiast

I'll give some background on why I need to change ElementId in Revit. 

 

I'm running a process where we export IFC files, since IFC Files are not supported for BIM360 clashing (at least the software we use is not supported), I am opening those files in Revit and then after that, I'm exporting that new Revit file as an NWC. 

We now have BIM360 clashes. But also, we now have problems. Since everyday we have new IFC files from that software, all clashes are restored. So if we approve one clash, the next day that clash is still going to show there since the Revit ElementId changed. 

I figured I could set up a database for IfcGUID, and then generate ElementIds for each of those files, then when I open those IFC files in Revit, I can change the ElementId in the model for the one in the database. This would maintain Revit Element Id consistent and clashing should be consistent too. 

 

Which leads back to the question, is there any way to change ElementId in Revit for a specific one? 

I noticed I could use ElementTransformUtils and copy the elements on the model, but it automatically generates the ElementId for the copied object, which defeats the purpose of what I want to achieve. 

 

Any help will be greatly appreciated! 

 

Thanks for reading! 

0 Likes
924 Views
7 Replies
Replies (7)
Message 2 of 8

jeremy_tammik
Alumni
Alumni

is there any way to change ElementId in Revit?

   

No, sorry. It is assigned automatically by Revit when creating the element. It may change when a workset is consolidated. Apart from that, it cannot be affected, afaik.

    

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 8

jeremy_tammik
Alumni
Alumni

I'm afraid the only help I can offer on this is to rethink the workflow and implement a different solution that does not require you to modify the element id assigned by Revit.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 4 of 8

victor.bastidas
Enthusiast
Enthusiast

Good day Jeremy!

I feel like I'm running out of ideas with this workflow at the moment.

Since BIM360 Clashes only use Revit ElementId (seems to me, I couldn't find any other identifier) Link to BIM360 help article. 

I tried going the APS API route, but there's no modifier for the ID that the clash system uses to keep consistency of objects. 

 

Since some IFC files can be uploaded and used for clashing, I think there's a change for me to modify the IFC files that I export and then add the specific property required for clashing. 

 

It feels like a dead end road at the moment. Any other ideas would be greatly appreciated! 

0 Likes
Message 5 of 8

jeremy_tammik
Alumni
Alumni

I see no problem here. You want to identify clashing elements? And you wish to define the individual element identifier yourself? Well, then, simply go ahead and do so. Instead of using a predefined identifier like the Revit Element id, just add your own identifier to all the elements. There are numerous (infinite, actually) ways to define your own key:

  

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 6 of 8

victor.bastidas
Enthusiast
Enthusiast

Oh, yes, we can create our own app to see those clashes, but our company pays for that feature on BIM360 and we'd like to use it instead of developing a similar app. 

 

BIM360 only uses Revit ElementId to identify those elements. 

 

BIM360 does not support all IFC files, just the ones that have been created using some specific software. 

 

Our IFC files have the IfcGUID, which should be enough of an identifier to keep consistency over files. This IfcGUID parameter is not changing through different IFC file versions, but since we open those new IFC files with Revit, it assigns "random" Revit ElementIds to the same IfcGUID elements. So new versions always have different identifiers. 

 

This is not a problem for geometry clashing, since it still gets done. It's a problem since once we clear clashes, we get them again the next day when we have new IFC files. 

 

I'm not sure our problem is getting understood.  

0 Likes
Message 7 of 8

jeremy_tammik
Alumni
Alumni

Gradually, I believe my understanding is increasing.

  

One idea comes to mind based on your updated description: the problem occurs because the IfcGuid changes when the same Revit ElementId is imported several times over, correct? Well, afaik, there is a significant difference beween importing and linking an IFC file into a Revit project. I believe that the linking process uses differentfunctionality and preserves the IfcGuid. So, that might provide a very simple and direct solution to your problem. I suggest:

  

  

The IFC experts may know of other and better solutions, and may have encountered and solved this problem already.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 8 of 8

victor.bastidas
Enthusiast
Enthusiast

Hi Jeremy! 

Sorry, I indeed did not make myself clear. 

 

All our IFC files have consistent IfcGUID. We get those IFC files on an overnight export from the other software. 

 

The process goes like this: 

 

IFC File from software X -> Revit OpenIFCDocument() -> Navisworks Exporter -> BIM360 Document Management -> BIM360 Clash Coordination Models. 

 

We were using Navisworks exporter since this article mentioned the capability: BIM 360 Help | Supported Files for Clash | Autodesk

 

Since our source IFC files get generated overnight, when we open the IFC file on Revit, Revit just assigns new Revit ElementIds to all the IFC Objects. 

 

Since we can't control how Revit Assigns the ID, I was thinking on using an external database and then assigning specific ElementId to the elements on the IFC model using the IfcGUID as a primary key, but then, we really can't change the ElementIds. 

 

At the moment, I'm not sure on how to link an IFC model stored on BIM360 into a Revit model. We're using Revit 2022, and I haven't seen an API endpoint for that specific function. I can open IFC files on my computer or network shares. 

 

I can assure you, IFC Guid is being preserved on all IFC Files, since we have more than 50 versions of the files that we inspected and IfcGUID has been consistent through all of them. 

 

Thanks for your time, Jeremy, always appreciate it! 

0 Likes