如何激活 Autodesk Forge Snapper? [英] How to activate Autodesk Forge Snapper?

查看:28
本文介绍了如何激活 Autodesk Forge Snapper?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试激活自查看器 7.3 版起实施的新 Snapper 扩展.

I'm trying to activate the new Snapper extension implemented since version 7.3 of the viewer.

所以我像这样加载扩展:

So I load the extension like that :

viewer.loadExtension('Autodesk.Snapping')

似乎有效.之后,我尝试访问这样的描述方法,但我总是收到此错误getSnapResult 不是函数":

Seems to work. And after, I tried to access described methods like that but I always got this error " getSnapResult is not a function" :

viewer.loadExtension('Autodesk.Snapping').then(extension =>{
    snapper = extension;
});

snapper.getSnapResult();

我仍在使用几年前由 Philippe Leefsma 制作的旧扩展:https://forge.autodesk.com/cloud_and_mobile/2015/09/geometry-snapping-and-selection-commands-with-view-data-api.html

I'm still using the old extension made by Philippe Leefsma a few years ago : https://forge.autodesk.com/cloud_and_mobile/2015/09/geometry-snapping-and-selection-commands-with-view-data-api.html

但由于它在 7.3 之前的版本中不再起作用,我想用新的替换它.

But as it's not working anymore in version up to 7.3, I would like to replace with the new one.

推荐答案

getSnapResult() 是 Snapper 类中的一个函数.这是文档的链接:

getSnapResult() is a function within the Snapper class. Here is a link to the documentation:

https://forge.autodesk.com/en/docs/viewer/v7/reference/Snapping/Snapper/

您可以尝试以下操作:

var snapper = new Autodesk.Viewing.Extensions.Snapping.Snapper();
//...
snapper.getSnapResult();

这篇关于如何激活 Autodesk Forge Snapper?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆