SVF2 has different objectid
s/dbid
s than SVF1. In this SO-Answer, it was advised to use externalId
instead of objectid
. However, viewer.loadModel(svfUrl,{ids:[dbIds...]})
takes dbId
s to load only specified objects. How can I load only specified objects using SVF2 and the https://developer.api.autodesk.com/modelderivative/v2/regions/eu/designdata/:urn /metadata/:guid/properties
endpoint? Can I access the svf2 objectIds
anywhere or can I use the externalIds
when calling Viewer3d::loadModel
?
Asked
Active
Viewed 260 times
0

Dominik
- 241
- 2
- 12
1 Answers
1
You're right, there's a difference between the "SVF1 dbIDs" and the "SVF2 dbIDs" - the IDs in SVF2 format are "persistent", meaning that in different versions of the same design file, a single ID will reference the same design element (which was not the case in SVF1).
Unfortunately, there are parts of the platform (like the loadModel
viewer method and the /modelderivative/v2/regions/eu/designdata/:urn /metadata/:guid/properties
endpoint) that have not "caught up" with SVF2 yet. And before those updates are available, you would have to map "between the old and new dbIDs" manually which is itself another, non-trivial task.

Petr Broz
- 8,891
- 2
- 15
- 24
-
Does SVF2 use IfcGuid instead of externaIds? I tried using `viewer.model.getExternalIdMapping(onSuccessCallback, onErrorCallback)` as suggested by your SO answer [here](https://stackoverflow.com/a/64495956/4295853). However, the mapping has mostly keys which are IfcGuids and not the externalIds returned by the `/modelderivative/v2/regions/eu/designdata/:urn /metadata/:guid/properties` endpoint. Is this function broken as well with SVF2? – Dominik Dec 17 '20 at 15:50
-
Yes, in SVF2 the `IfcGUID` property is no longer included among properties because it is used in the `external_id`. – Petr Broz Dec 17 '20 at 16:00
-
So effectively there is no way to map SVF1 properties to SVF2 properties or is there? Do you when either the `viewer.model.getExternalIdMapping` or the `/modelderivative/v2/regions/eu/designdata/:urn /metadata/:guid/properties` will work with SVF2? – Dominik Dec 17 '20 at 16:09
-
Supporting a clear mapping between SVF1 IDs and SVF2 IDs is a work-in-progress, but you could perhaps start experimenting with some of the logic that's already being added in the latest versions of Forge Viewer, for example, the `Model` class should now offer a method called `remapDbId` that should be able to map the "old" dbIDs to the "new" ones. – Petr Broz Dec 17 '20 at 16:14
-
This would be the functionality I need. However, according to the source code it is only set in 2D mode and not in 3D mode: `//F2D/PDF only -- mapping of F2D/PDF dbids to OTG property database v2 dbids` ------------ `this.setDbIdRemap = function (dbidOldToNew) { if (this.is2d()) { this.idRemap = dbidOldToNew; } }; ` – Dominik Dec 17 '20 at 16:40
-
As I only needed to access nodes with a direct mapping in IFC I could get it to work with the `Viewer3D::getExternalMapping` and passing the IfcGuid which I already had. I hope the new property dbIds are getting support by a properties endpoint soon as I want to avoid writing a mapping `oldDbId -> IfcGuid + numerator -> newDbId via externalMapping`. – Dominik Dec 17 '20 at 19:37