Autodesk Forge - DGN file element externalId

Viewed 29

After converting a DGN file to SVF and querying an object external Id my result is formatted as an array of base64 string :

["MW1jMDktYmJ2X21zZC1kci1kbTMtbnMwNV9ubDEzLTE2NDcwNC1wMDItczMuaS5kZ25fMg==","NDkzOEY1NTdDMUJDRDdBREVEM0Q4RDAwMzk0NTY3NzNFMUQ1MzkxNw=="]

After decoding, the first item in array match the model file path

1mc09-bbv_msd-dr-dm3-ns05_nl13-164704-p02-s3.i.dgn_2

But the second element seems to be an hex number but I cannot figure out what it means:

4938F557C1BCD7ADED3D8D0039456773E1D53917

Is there a way to get the DGN ElementId from the externalId ?

Thanks.

enter image description here

1 Answers

The Forge Model Derivative service tries to use some "reasonable unique ID schema" for each input file format. For example, for Revit files it uses Revit GUIDs, for Inventor designs it uses a path, for AutoCAD drawings it uses handles, for IFC files it uses IFC GUIDs, etc.

If the externalId generated for your DGN files does not contain the ID you need, you could try and look for it in the element's properties, like so:

  1. Map the externalId to dbId (this is the simple numerical ID schema used by SVF), using the Model#getExternalIdMapping method
  2. Retrieve properties of the dbId using the Model#getProperties method
  3. Check if the "DGN ElementId" is included in the properties
Related