hk1ll3r
hk1ll3r

Reputation: 911

Highlighting only the geometry of a parent object in autodesk's online viewer

We have revit model in which a parent element has both children and its own geometry. In the online viewer it is possible to select the parent through clicking the respective geometry, in which case only the geometry for the parent is highlighted. (selected through a click)

If I select the element through the tree the whole model gets highlighted. (selected through the model browser)

In our web application, we are unable to get the former behavior. When passing the dbId of the parent to viewer.select, the parent plus all the children get highlighted. Same happens when we click the parent element's geometry. How can we select only the parent object programmatically?

We have tried passing different selection modes (overlayed, regular, mixed) to viewer.select but that didn't help and all objects got selected regardless of that parameter.

Upvotes: 0

Views: 682

Answers (1)

Augusto Goncalves
Augusto Goncalves

Reputation: 8574

Thanks for the sample file. I did the following: open the model, select manually and, via console, typed .getSelection(), which returns me the dbId of the selected element. Now unselect everything. Then run .select(2890) and the result is as expected: only the top element is selected (as shown in the image below). I'm using Viewer 3.3.

You can try my sample live here, it uses the Basic Application tutorial.

enter image description here

Upvotes: 0

Related Questions