Forge viewer call focus method

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());

Answers:

Answer

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/

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.