模型导数 API:无法查看

发布于 2025-01-11 11:18:00 字数 1472 浏览 0 评论 0 原文

我正在构建一个 .NET 应用程序,旨在使用 BIM360/模型协调 API 提取冲突,然后使用模型衍生 API 获取冲突元素的详细信息,这与 https://github.com/Autodesk-Forge/forge-bim360-clashview(请参阅链接下的关系图),只是没有查看器。

我已经成功地进行了冲突提取,但在获取模型视图对象层次结构方面遇到了困难。问题的根源似乎是缺乏对视图的访问:在提取冲突时,我收集了冲突模型集文档版本的 versionUrnviewableGuid 。然后,当我尝试在 Model Derivative API 调用中使用这两个值时(例如调用 https://developer.api.autodesk.com/modelderivative/v2/designdata/{urn}/metadata/{guid}/ properties),我收到 404 错误,我认为该错误与给定资源不存在有关。这很令人困惑。

我开始使用 https://developer.api.autodesk.com/modelderivative/v2/designdata/{urn}/metadata 挖掘并提取可用模型视图的列表:所有可用视图都没有 < code>viewableGuid 等于我正在寻找的那个。

当我查询版本的清单(https://developer.api.autodesk.com/modelderivative/v2/designdata/{urn}/manifest)时,事情变得更加混乱:它返回了视图我在冲突提取期间收集了该视图作为 SVF 衍生产品之一的直接子级,但该视图还有更多子级,其中之一属于元数据查询返回的集合!

简而言之:

  • 提取冲突时,我得到 versionUrnviewableGuid,后者在
  • 元数据查询的模型派生 API 调用中使用时失败,我得到 availableViewables 的集合
  • 在清单查询中,我得到一个 SVF 衍生产品,它有一个子 viewableGuid,它有嵌套的子项,其中一个属于 availableViewables

我认为也许视图的子视图使用与其父视图相同的 objectid,但不幸的是不是:从冲突结果中提取的查看器 ID(rvidlvid)不存在于子视图中。

我的问题是:我做错了什么?如何访问冲突提取期间收集的 viewableGuid 指定的模型视图的对象层次结构?任何帮助将不胜感激。谢谢!

I am building a .NET app meant to extract the clashes using BIM360/Model Coordination API and then get the details of clashing elements using Model Derivative API, quite similar to what is done in https://github.com/Autodesk-Forge/forge-bim360-clashview (see the relationship diagrams under the link), just without the viewer.

I have succeeded with clash extraction, but am struggling with obtaining the model view object hierarchy. The root of the problem seems to be the lack of access to the view: while extracting the clashes, I collected the versionUrn and viewableGuid of the clashed model set document versions. Then, when I tried to use these 2 values in Model Derivative API calls (e.g. to call https://developer.api.autodesk.com/modelderivative/v2/designdata/{urn}/metadata/{guid}/properties), I get 404 error, which I assumed is related to the fact that the given resource does not exist. This was confusing.

I started digging and extracted the list of available model views using https://developer.api.autodesk.com/modelderivative/v2/designdata/{urn}/metadata: none of the available views had viewableGuid equal to the one that I was looking for.

Things got even more confusing when I queried the manifest of the version (https://developer.api.autodesk.com/modelderivative/v2/designdata/{urn}/manifest): it returned the view that I collected during clash extraction as a direct child of one of the SVF derivatives, but that view had further children, one of them belonging to the collection returned by the metadata query!

So in short:

  • when extracting clashes, I get versionUrn and viewableGuid, the latter failing when used in Model Derivative API calls
  • on metadata query I get a collection of availableViewables
  • on manifest query I get a SVF derivative that has a child viewableGuid that has nested children, one of them belonging to availableViewables

I thought that maybe children of views use the same objectids as their parents, but unfortunately not: the viewer ids extracted from the clash results (rvid and lvid) do not exist in the child view.

My question is: what am I doing wrong? How can I access the object hierarchy of a model view specified by the viewableGuid collected during clash extraction? Any help will be appreciated. Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

只想待在家 2025-01-18 11:18:00

抱歉回复晚了。我认为您是正确的,模型协调 API 的清单不会直接告诉模型的元数据 ID,因为模型协调协调模型版本的默认 {3D} 视图快照。它专注于视图,而不是作为元数据管理的视图源(svf/svf2)(带有您正在查找的 id)。

我可以提出一个愿望,询问模型坐标API是否也提供元数据id。作为解决方法,您可以尝试搜索模型版本的通用清单。

//stands for one geometry node in the derivative
 var viewableGuid = 'a3186f12-7750-fa47-f60a-610a779ba5ac'
//stands for the id for explictly view within the geomtry node
 var viewableId = '24bb580c-5e74-4a65-bcae-e97c21424529-00027e16'

 var model_manifest =  <by GET:Manifest of the model version of Model 
  Coordination>

  var find_top_svf_derivative = 
   model_manifest.derivatives.find(i=>i.outputType=='svf2' 
  ||i.outputType=='svf' )
 if(find_top_svf_derivative){
      var find_derivative = find_top_svf_derivative.children.find(i=>i.guid 
   == viewableGuid)
      if(find_derivative){
          var find_metadata = 
    find_derivative.children.find(i=>i.mime=='application/autodesk-svf' || 
      i.mime=='application/autodesk-svf2')
     {
        //find the metadata id now
        //the source of svf/svf2 which stores the metadata
        var metadata_id = find_metadata.guid
      }
   } 
 }

Sorry for late response. I think you are correct that the manifest of Model Coordination API does not tell metadata id of the model directly as Model Coordination coordinates the default {3D} view snapshot of the model versions. It focuses on the view, instead of the source of the view (svf/svf2) which is managed as metadata (with the id you are looking for).

I can raise a wish to ask Model Coordinate API also provides metadata id. As a workaround, you may try to search the general manifest of the model version.

//stands for one geometry node in the derivative
 var viewableGuid = 'a3186f12-7750-fa47-f60a-610a779ba5ac'
//stands for the id for explictly view within the geomtry node
 var viewableId = '24bb580c-5e74-4a65-bcae-e97c21424529-00027e16'

 var model_manifest =  <by GET:Manifest of the model version of Model 
  Coordination>

  var find_top_svf_derivative = 
   model_manifest.derivatives.find(i=>i.outputType=='svf2' 
  ||i.outputType=='svf' )
 if(find_top_svf_derivative){
      var find_derivative = find_top_svf_derivative.children.find(i=>i.guid 
   == viewableGuid)
      if(find_derivative){
          var find_metadata = 
    find_derivative.children.find(i=>i.mime=='application/autodesk-svf' || 
      i.mime=='application/autodesk-svf2')
     {
        //find the metadata id now
        //the source of svf/svf2 which stores the metadata
        var metadata_id = find_metadata.guid
      }
   } 
 }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文