【问题标题】:Autodesk Forge - how to get properties of multiple selected objects synchronouslyAutodesk Forge - 如何同步获取多个选定对象的属性
【发布时间】:2021-01-17 01:26:24
【问题描述】:

在我的扩展中,我有一个来自 this.viewer.getSelection() 数组的 ID,例如 1234。

我试图从中获取属性:

this.viewer.getProperties(1234,function(data) {console.log(data);},function(e1,e2) {console.log("ERROR:",e1,e2);})

但我看到了错误:

Properties failed to load since model does not exist

更新的问题: 如何同步获取多个选定对象的属性?

【问题讨论】:

    标签: javascript autodesk-forge


    【解决方案1】:

    在后台,viewer.getProperties 方法调用viewer.model.getProperties,并且如错误消息所述,viewer.model 在调用该方法时不可用。请注意,这种情况可能有几个不同的原因:

    • viewer.getProperties 在不同的查看器实例(未加载任何模型)上调用
    • 在模型加载之前调用viewer.getProperties
    • 在模型卸载后调用viewer.getProperties

    【讨论】:

      猜你喜欢
      • 2018-02-27
      • 1970-01-01
      • 2018-03-24
      • 2023-03-06
      • 2021-05-08
      • 1970-01-01
      • 2018-10-15
      • 2019-02-08
      • 2018-09-12
      相关资源
      最近更新 更多