Hoz.Coder
Hoz.Coder

Reputation: 13

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

Upvotes: 0

Views: 1528

Answers (1)

Jaime Rosales
Jaime Rosales

Reputation: 1288

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.

Upvotes: 1

Related Questions