Unique Id vs ElementId, which identifier to stored in the external database.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi Everyone,
I am trying to develop a Revit extension which help to export/import Revit building model to structural analysis software. In the external database, i am not sure which identifier to be stored in order to retrieve the same element after successive import/export call between Revit and analysis software.
I wish to implement something described as below:
1)After structural analysis software made changes to the building model, it export these changes to a external database. My extension will load the external database, retrieve the 'changed' element based on the identifier(i.e document.get_element(ElementId/UniqueId)) in Revit and apply the changes to the retrieved element. However these ids are used internally in Revit and i don't know how Revit generate the ids which make me hard to identify which element is changed outside Revit.
2)Revit user can aslo made change to the building model and send this changes back to structural analysis software. However, in the structural analysis software, there is no unique identifier for each element like Revit do. Hence, i think i need to create one.(i.e use GUID). But this identifier is not the same as the one used in Revit. How do i generate a same identifier which is used to identify the element in both Revit and structural analysis software?
I get some suggestion as below:
1)On export from Revit, create a set of GUIDs for the exported elements. Besides that, each exported element's ElementId must be saved as well.
How do i generate a Guid which is used to identify exported element?
2)On import to Revit, check for an existing object with the standard GUID or else create a new one.
So, Structural analysis software need to generate the Guid in the same way described in(1) so that the guid is identical to both Revit and Analysis software? Please correct me if i am wrong or something i have missed out.
Does anyone have other suggestion? Any help is appreciated.