We are creating a table of all objects in a given view using the model derivative API (https://aps.autodesk.com/en/docs/model-derivative/v2/reference/http/metadata/urn-metadata-guid-GET/), then getting the 'externalId' for each object. For 99% of objects, we can convert the last set of characters in the externalId from hexadecimal to decimal and match it with the Revit Id. We're having issues with a subset of objects that the externalId no longer converts to the correct Revit Id.
I see in this question that the model derivative API won't return hidden properties (like ElementId), is there a way to get it with Design Automation? It's in the name in the viewer, and I can see it in the online console, but are there any API calls that can retrieve it?
And finally, why would the externalId now differ from the Revit Id, can this change due to copying / worksharing?
Edit:
After more research and this post I see that the externalid / RevitId difference is a feature of workshared models, and I don't see a way to get the Revit Id from the model derivative API. The two solutions I can see are:
- Adjust workflow to use external/uniqueId from the start
- Use the Viewer API to search by Revit Id and map to dbId that way
Are there any other APIs that can provide the Revit Id?