0

In forge viewer I want to call the focus method from my script to focus on selected elements.

like this image

I cannot find method like

viewer.focuse(viewer.getSelection());
Jason Aller
  • 3,541
  • 28
  • 38
  • 38
  • 1
    Hi, I am reviewing your post. You should add code or images directly, since link-addresses can change. It also makes it easier for the SO community to reproduce your query. Please check here on how to ask good questions: https://stackoverflow.com/help/how-to-ask – rainer Jun 03 '18 at 11:08

1 Answers1

1

This is quite simple, just call Viewer3D#fitToView()~

var selection = viewer.getSelection();
viewer.fitToView( selection );

See here for the documentation: https://developer.autodesk.com/en/docs/viewer/v2/reference/javascript/viewer3d/

Eason Kang
  • 6,155
  • 1
  • 7
  • 24