'Get properties value from dbId or externalid - Autodesk Forge

I have dbId and externalId in forge viewer. I want to get some value of properties object from this dbId and externalId. For example: Perimeter, Area, Volume, ...

What is the syntax to do that?

View Image



Solution 1:[1]

Once you have the DBID for the element which you can obtain with a viewer call to the selection of the object. viewer.getSelection() will give you that DBID that we will use later.

You can use the method getProperties(dbid, callback) For example something like this.

var myDbid = viewer.getSelection();
viewer.getProperties(myDbid, function(e){
      console.log('Entire object response ',e);
      console.log('Properties ',e.properties)
});

This should give you the information of the category you are looking for.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jaime Rosales