如何从 revit 插件或使用 Forge api 为 Revit 文件创建 URN

How to create URN for Revit File from revit plugin or using Forge apis

我想知道是否可以从 BIM 360 Design 中的 Revit 文件创建 URN。

我手里有模型 GUID 和项目 GUID。

重播将不胜感激。

Collaborate tab > Manage Collaboration panel 中通过 Revit 的协作按钮初始化 BIM360 Design 中的云协作时,Revit 将上传您的模型,并在此过程中将第一个版本发布到 BIM360 文档管理(也称为 Docs)。

完成初始化后,您可以调用Forge DMAPIs获取您BIM360项目中的模型URN,如projects/:project_id/folders/:folder_id/contents or GET Versions。之后,迭代 API 响应中的项目并找到与您提到的模型 GUID 和项目 GUID 相匹配的版本。看起来像这样,id值就是你想要的URN。

{  
   "type":"versions",
   "id":"urn:adsk.wipprod:fs.file:vf.abcd1234?version=1",
   "attributes":{  
      "name":"fileName.rvt",
      "displayName":"fileName.rvt",
      ...
      "mimeType":"application/vnd.autodesk.r360",
      "storageSize":123456,
      "fileType":"rvt",
      "extension":{  
         "type":"versions:autodesk.bim360:C4RModel",
         ....
         "data":{  
            ...
            "projectGuid":"48da72af-3aa6-4b76-866b-c11bb3d53883",
            ....
            "modelGuid":"e666fa30-9808-42f4-a05b-8cb8da576fe9",
            ....
         }
      }
   },
   ....
}

顺便说一句,您可能对这个博客主题感兴趣 Accessing BIM 360 Design models on Revit

我在 The Building Coder as well, in the discussion on Accessing BIM360 Models 上分享了陈奕迅的回答。