如何将 Autodesk Model Derivative API 元数据中的 objectids 与 Forge Viewer 模型 dbids 匹配? [英] How to match objectids from Autodesk Model Derivative API metadata with Forge Viewer model dbids?

查看:23
本文介绍了如何将 Autodesk Model Derivative API 元数据中的 objectids 与 Forge Viewer 模型 dbids 匹配?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在围绕 Autodesk Forge Viewer 构建一个应用程序,我在其中使用 Viewer 的基本功能(着色、隔离等)添加额外的功能,具体取决于客户端数据.

I am building an application around Autodesk Forge Viewer, where I add extra functionalities using basic functions from Viewer (coloring, isolating etc.) depending on client data.

此应用程序还允许您上传新模型.在上传和转换过程之后,使用此模型衍生 API https://forge.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-metadata-guid-GET/,它基本上返回对象树及其 ID/名称.

This application also allows you to upload a new model. After the upload and conversion process, metadata is extracted from the model using this Model Derivative API https://forge.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-metadata-guid-GET/, which basically returns the tree of objects and their ids/names.

在查看器端,所有基本交互功能,如 setThemingColor、显示、隐藏、隔离等,都需要 dbIds 作为参数.为了避免多次搜索请求找出一个项目的dbId,这会导致模型大小高于平均水平会导致巨大的性能问题,dbId从BE端的元数据中检索并提供给FE用于着色或类似操作只需要执行 dbids.

On the viewer side, all the basic interaction functions like setThemingColor, show, hide, isolate etc. requires dbIds as a parameter. To avoid multiple search requests to find out the dbId of an item, which would cause a huge performance problem as the model size is above average, dbIds are retrieved from the metadata on the BE side and provided to FE to for the coloring or a similar operation requiring only dbids to execute.

然而,最近我发现来自 Model Derivative API 元数据的 objectid 和 Viewer 函数中所需的 dbId 不匹配.这两个字段如何相互关联,它们是否应该相同?如果没有,有没有办法将一种转换成另一种?

However, recently I discovered that objectid from Model Derivative API metadata and dbId required in the Viewer functions are not matching. How does these two fields correlate to each other, are they supposed to be the same or not? If not, is there a way of converting one into another?

我找不到任何关于此的官方/非官方文档,感谢任何帮助.

I couldn't find any official/unofficial documentation about this, any help is appreciated.

推荐答案

来自 Model Derivative API 的 objectid 和查看器中的 dbid(来自SVF 文件格式)应该始终匹配.唯一的例外是新的 SVF2 格式(它只有 进入公开测试版),其中 dbid 以不同的方式计算,以便稳定",例如在同一设计的不同版本之间保持一致".

The objectids from the Model Derivative APIs and the dbids in the viewer (coming from the SVF file format) should always match. The only exception is the new SVF2 format (which has just entered public beta) where the dbids are computed in a different way in order to be "stable", as in, "consistent across different versions of the same design".

为了安全起见,您可以使用外部 ID"将设计元素与元数据相关联.这保证是一致的.在客户端,您可以使用 viewer.model.getExternalIdMapping(onSuccessCallback, onErrorCallback) 方法获取从外部 ID 到 dbids 的字典映射.

To be on the safe side, you could link the design elements with your metadata using the "external ID" which is guaranteed to be consistent. On the client side you can use the viewer.model.getExternalIdMapping(onSuccessCallback, onErrorCallback) method to get a dictionary mapping from external IDs to dbids.

这篇关于如何将 Autodesk Model Derivative API 元数据中的 objectids 与 Forge Viewer 模型 dbids 匹配?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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