Search code examples
autodesk-forgeautodesk-viewerautodesk-model-derivative

Autodesk.PropertiesManager Extension - load properties of a single element or an array of ids


I am trying to create a powerBi visual. Let's say everything is working correctly. But the problem I have is at the moment of activating the Autodesk.PropertiesManager extension. Let's say I do it in the following way.

 this.forge_viewer.activateExtension("Autodesk.PropertiesManager","0");

Until the moment you click. If the call to the extension works for me. And it opens the extension but it always shows me the properties of the model. That are reflected in the following image.

Properties

But the idea is that according to an array or the input of a single identifier of an element, the property will be shown.

Example:

  1. A selection is made in powerBI (This entry can be translated as an object identifier).

  2. The viewer makes a selection with isolate (this.forge_viewer.isolate(dbIds))

  3. the viewer activates the properties tab but instead of giving the information of the model (The image iserted). It identifies the ID and exits the tab but of the element. Not the one of the model in general.

Element properties

I was testing with the following lines of code

this.forge_viewer.activateExtension("Autodesk.PropertiesManager","0");
this.forge_viewer.setPropertiesOnSelect(true);

Solution

  • The viewer makes a selection with isolate (this.forge_viewer.isolate(dbIds))

    Please note that selection is not the same thing as isolation in the viewer. You can either isolate objects using viewer.isolate(ids) (which will hide all other objects), or select objects using viewer.select(ids) (which will apply a semitransparent color tint to them).

    In order to get a specific object's properties to show up in the Properties panel, you have a couple of options:

    1. Select the object using viewer.select(id) (the Properties panel will then update automatically)
    2. Manually set the desired object ID to the Properties panel using viewer.getExtension('Autodesk.PropertiesManager').getPanel().requestNodeProperties(id)