【问题标题】:Use getBulkProperties2 within userFunction to speed up performance在 userFunction 中使用 getBulkProperties2 来提高性能
【发布时间】:2021-05-19 11:44:33
【问题描述】:

我目前正在通过getBulkProperties2查询房产数据库。我通过在数据库上运行 bruteForceFinduserFunctionexecuteUserFunction 获得此查询的 ID。

在我们公司的一些速度较慢的笔记本电脑上,getBulkProperties2 通话大约需要 40-50 秒。由于单线程 JS 的性质,整个 Vue 应用程序和 UI 都冻结了。我尝试将批量调用移至 WebWorker,但您无法将模型传递给 WebWorker,因为模型对象引用了自身,因此无法序列化(循环引用)。

理想的解决方案是在userFunction 中执行批量调用,因为它是在设计上在 WebWorker 上执行的。我在文档(或我反编译的源代码)中看不到执行此类操作的方法。

userFunction 中执行批量调用的推荐方法是什么?

【问题讨论】:

    标签: autodesk-forge autodesk-viewer


    【解决方案1】:

    您可以在userFunction 内拨打pdb.getObjectProperties。见https://forge.autodesk.com/en/docs/viewer/v7/reference/globals/PropertyDatabase/#getobjectproperties-dbid-propfilter-ignorehidden-propignored

    const ignoreHidden = false;
    pdb.getObjectProperties( dbId, ['myAttributeName'], ignoreHidden );
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-17
      相关资源
      最近更新 更多