1

When processing a translated model's data using the get properties request in the forge model derivative API, a model I'm testing doesn't return the revit ID as part of any instance element. The format I'm used to seeing is something like "Railing [5707296]" for a railing instance element, but the properties JSON response don't show the [5707296] in the result. Is this a recent change with the API? Is there a setting I need to enable this? The revit ID is a useful value for us and we'd like to retrieve it. It's strange that the viewer shows the ID, as expected, but that same entity in the get properties request does not show the ID. This is from a Revit 2022 model.

JSON response:

...
{
    "objectid": 410,
    "name": "Railing", // <-- I would expect this to be "Railing [5707296]"
    "externalId": "1c277e31-8d23-4dc2-96e6-b1ac60f1c07a-0053ce49",
    "properties": {
      ...
    }
},
...

Same element selected in the viewer shows the name I would expect:

enter image description here

Alex
  • 978
  • 7
  • 23
  • I tested with a sample model in the `Revit 2022/Samples` directory and did not have the issue, so I'm fairly certain this is a model-specific issue. – Alex Jul 02 '21 at 17:28

3 Answers3

2

Thanks to Eason & Jeremy, I learned that the last substring of the externalId is a hex-encoded representation of the Revit element ID. This means that I can derive the Revit element ID from the externalId, and I don't need to parse it from the element name.

const externalId = '110717dd-74ae-4656-b586-fb1c03e9905a-00030954';
const splitArr = externalId.split('-');

console.log(parseInt(splitArr[splitArr.length - 1], 16)); // 198996 ✅

Source: https://thebuildingcoder.typepad.com/blog/2009/02/uniqueid-dwf-and-ifc-guid.html

Alex
  • 978
  • 7
  • 23
0

I think this is happening because of SVF2/OTG. The Revit ID is also missing in the viewer when forcing the new format with https://forge.autodesk.com/en/docs/model-derivative/v2/developers_guide/notes/

Seems like there is no simple way to get the Revit ID at the moment. Maybe a workaround is possible using something like https://forge.autodesk.com/blog/temporary-workaround-mapping-between-svf1-and-svf2-ids (see Alex's accepted answer for a good workaround)

Edit: I just realized that the missing Revit Id in my viewer was the result of a poorly implemented custom property panel. Everything works as expected using the default property panel.

Peter
  • 51
  • 5
  • Thanks Peter. We are using SVF2 so it could be related to that, but several other models that we’ve translated using SVF2 are not missing this information. – Alex Jul 05 '21 at 12:50
  • Hey Peter - I confirmed with Eason that this is due to SV2 as you suggested. See my answer for how to derive it from the externalId. – Alex Jul 07 '21 at 13:26
0

Please note that the Forge externalId probably corresponds to the Revit UniqueId. I would recommend always using the unique id to identify elements, if possible, since it is more reliable than the element id.

Jeremy Tammik
  • 7,333
  • 2
  • 12
  • 17
  • Thanks Jeremy. We are using the externalId to identify the elements, but revit UniqueId information is still useful for us. The fact that it’s missing from certain models makes me think it’s a bug. – Alex Jul 05 '21 at 12:48
  • @Alex The viewer external id for RVT is Revit's `UniqueId` accaully. – Eason Kang Jul 07 '21 at 02:13
  • @EasonKang ah thank you for clarifying. Yes, we are looking for the revit element ID, not the `UniqueId`. – Alex Jul 07 '21 at 12:37