【发布时间】:2019-02-27 21:40:32
【问题描述】:
我正在寻找一种方法,以在我的 svf 模型中以编程方式访问“属性数据”,该模型在自动桌面查看器中打开。
https://autodeskviewer.com/viewers-dev/latest/docs/PropDbLoader.html
我在 api 中找到了它,但可以弄清楚它应该如何工作以及它需要什么数据。 API 文档似乎详尽无遗,但对如何使用这些功能没有任何帮助...
我正在尝试做一个扩展,当点击时,我可以访问我点击的模型部分的属性。
(我可以在基本查看器的属性部分看到的相同数据)
到目前为止,我有:
MyAwesomeExtension.prototype.onSelectionEvent = function(event) {
//here i have an ID related to the part clicked
var currSelection = this.viewer.getSelection();
//here I acces what seems to be the data loader, which is defined
console.log(event.model.myData.propDbLoader );
//but here, when i give the first id, it respond null
event.model.myData.propDbLoader.getProperties( currSelection, (e)=>{
console.log('success',e );
},(e) => {
console.log('error',e );
} );
任何想法将不胜感激:)
【问题讨论】:
标签: autodesk-forge autodesk-viewer