How can I get the difference between the coordinates of the revit project and an IFC file I'm reading in the background?

How can I get the difference between the coordinates of the revit project and an IFC file I'm reading in the background?

simonebehlings
Explorer Explorer
347 Views
1 Reply
Message 1 of 2

How can I get the difference between the coordinates of the revit project and an IFC file I'm reading in the background?

simonebehlings
Explorer
Explorer

I have an Rvt file where an IFC is linked, however when loading the IFC it is not in the correct position (aligned with the Rvt). But I am developing a Script that is based on the location of the elements and they must be overlapping. I thought about taking the coordinate of the rvt-based point and the coordinate of the internal origin from ifc (since they coincide when I align the projects), calculate the difference and apply it to the coordinates of each element. I just don't know how to do it in practice.  😅

Ps: The script is being developed in python. 

0 Likes
348 Views
1 Reply
Reply (1)
Message 2 of 2

jeremy_tammik
Alumni
Alumni

You can try to make a call to the MoveElements method and pass in the set of all the desired element ids to move:

 

https://www.revitapidocs.com/2022/3cf8c9dc-f4d1-12f0-d7a9-e126331cd858.htm

   

It sounds rather like a sledge-hammer method, but maybe that is what you are asking for...

  

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