-1

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 ?

udda
  • 93
  • 1
  • 14

1 Answers1

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