I'm trying to use Snapper functionnalities from Forge Viewer in order to ask user to pick a point and then retrieve point world coordinates of selected point.
I look at this topic but doesn't work for me : How to activate Autodesk Forge Snapper?
I load the extension like that :
this.viewer.loadExtension('Autodesk.Snapping');
And then try to use the Snapper like that:
console.log(this._viewer.toolController.getActiveToolName());
var snapper = new Autodesk.Viewing.Extensions.Snapping.Snapper(this._viewer, {});
this._viewer.toolController.registerTool(snapper);
this._viewer.toolController.activateTool('snapper');
console.log(this._viewer.toolController.getToolNames());
console.log(this._viewer.toolController.getActiveToolName());
var a = snapper.getSnapResult();
console.log(a);
In the log the snapper is activated but i am enable to pick a point in viewer ann to get results with getSnapResult function.
Thank you in advance