在伪造查看器中保留对项目的引用的最佳方法是什么? [英] What is the best way to persist a reference to an item in forge viewer?

查看:25
本文介绍了在伪造查看器中保留对项目的引用的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我们正在将一些 Revit 模型导入到 forge 查看器中.在查看器中,我们希望能够将一些附加到我们在查看器中看到的模型元素(例如门)的信息存储到外部数据库中.

Currently, we are importing into forge viewer some revit models. In the viewer, we want to be able to store into external database some info attached to an element of the model we see in the viewer (for example a door).

我们有 3 种方法来识别项目:

We have 3 ways to identify an item:

  • dbid(例如 2214)
  • guid/externalId(例如 a6aa132d-ccd7-408f-b2f9-ed67350c8c3a-0003b64a)
  • 名称旁边括号中的 Revit ID(例如屋顶 [243274])

我需要能够在外部数据库中引用模型上的项目,即使 revit 模型在中间得到更新和重新转换.

I would need to be able to reference an item on the model in external database, even if the revit model gets updated and reconverted in the middle.

1-是 Guid,我们应该使用它来引用 revit 文件中的项目(甚至在更新之间)吗?

1-Is Guid, the thing we should use to reference items in revit file (even between updates) ?

2-如果这是 Guid,我们如何直接获得从 guid 到 dbid 的映射(因为查看器中的所有内容都由 dbid 处理)?

2-If this is Guid, how can we directly have a mapping from guid to dbid (since all in viewer is handled by dbid) ?

  • 现在我看到上面的解决方案
  • 也许可以使用模型衍生的 :urn/metadata/:guid/properties 来获取所有 guid
  • 也许在查看器的某处已经有这个 guid->dbid 映射,我想念它(在 getBulkProperties 后面,我看到了一个 getPropertyDb,可能有它)

谢谢

推荐答案

首先总结一下:

  • Revit ID 是在 Revit 桌面上使用的顺序编号,它可以重复使用并且不是唯一的
  • Revit GUID 是唯一的(与任何 GUID 一样)并在版本之间维护,并在查看器(JavaScript 库)和模型衍生 GET 属性端点上公开为外部 ID
  • dbId 只是模型上用于访问几何图形的索引,不保证模型的版本/翻译之间会相同.
  • Revit ID is a sequential numbering used on Revit desktop, it may be reused and it's not uniqu
  • Revit GUID is unique (as any GUID) and maintained between versions and exposed on both Viewer (JavaScript library) and Model Derivative GET Properties endpoint as external id
  • dbId just index used on the model to access geometry, no guarantee will be the same between versions/translations of the model.

现在,您可以用来在版本之间跟踪相同元素的唯一真实标识符是外部 ID(来自 Revit GUID).

Now, the only true identifier you can use to track the same element between versions is the external id (from Revit GUID).

如果您需要服务器端映射,请使用 模型派生 GET 属性 在所有模型视图上.在客户端,我建议先 enumerateLeafNodes 然后调用getBulkProperties 在这些节点上获取外部 ID.

If you want a server-side mapping, use Model Derivative GET Properties on all model views. On the client-side, I would suggest first enumerateLeafNodes and then call getBulkProperties on these nodes to get the external id.

这篇关于在伪造查看器中保留对项目的引用的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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