is it possible to get the X,Y,Z coordinates of an object when you select it from the object tree itself. I know you can do it when you mouse click on a particular object but i want to get the coordinates when using the navigation tree. Is there a way to get them using the viewer ?
Asked
Active
Viewed 138 times
1 Answers
0
If the model browser's selection behavior is set to default (isolation) then simply subscribe to Autodesk.Viewing.ISOLATE_EVENT
as you would for selection:
NOP_VIEWER.addEventListener(Autodesk.Viewing.ISOLATE_EVENT, e=>{
//NOP_VIEWER.utilities.getBoundingBox().center()
})
BTW you can customize interaction behavior for the model browser by specifying the click config here:
NOP_VIEWER.modelstructure.clickConfig = {
click:{
onObject: ["toggleMultipleOverlayedSelection"]
}
//...
}

Bryan Huang
- 5,247
- 2
- 15
- 20
-
Thanks was able to get it – udda Jun 03 '20 at 09:21