Warm tip: This article is reproduced from stackoverflow.com, please click
autodesk-forge autodesk-model-derivative autodesk-viewer

Tell us about "clientToWorld"

发布于 2020-05-04 22:39:14

"clientToWorld" is used to identify and mark members and coordinates. We are also considering implementing a function to display attribute information of the selected members. However, the dbid of the member specified by "clientToWorld" is the Leaf Object's one, and the correct attribute information cannot be obtained.

When selecting a member by simply clicking the mouse, Leaf or First is selected by "SelectionMode". Isn't the same control possible with "clientToWorld"?

Questioner
Myeongki Kim
Viewed
30
Bryan Huang 2020-02-19 16:44

Try find the node id per the desired selection mode after getting the dbid from clientToWorld:

const result = NOP_VIEWER.clientToWorld(x,y);
NOP_VIEWER.model.getInstanceTree().findNodeForSelection(result.dbId,Autodesk.Viewing.SelectionMode["LEAF_OBJECT"])