如何从 BIM 360 问题有效负载中检索链接的文档?
Posted
技术标签:
【中文标题】如何从 BIM 360 问题有效负载中检索链接的文档?【英文标题】:How to retrieved linked document from a BIM360 issue payload? 【发布时间】:2021-01-17 04:54:23 【问题描述】:标题中都说了,但让我详细说明一下我的问题:
我想检索链接到给定 BIM360 问题的文档。因此,在那种特定情况下,我想找到“georef.dwg”(至少它是 BIM360 上的 URN 存储版本),知道问题 #31 或 #32。
当我查看来自GET issues/:id 的有效负载时,我看到的是:
"data":
"id":"0f84bfa2-43be-4761-8c84-ff5314fca382",
"type":"quality_issues",
"links":
"self":"https://developer.api.autodesk.com/issues/v1/containers/86fe431f-012b-4349-939e-cbb0788cfbba/quality-issues/0f84bfa2-43be-4761-8c84-ff5314fca382"
,
"attributes":
"created_at":"2020-09-24T13:45:02.754Z",
"synced_at":"2020-09-24T13:45:02.759Z",
"updated_at":"2020-09-24T13:45:02.756Z",
"close_version":null,
"closed_at":null,
"closed_by":null,
"created_by":"TT4KN3D3PWME",
"opened_at":"2020-09-24T13:45:02.740Z",
"opened_by":"TT4KN3D3PWME",
"updated_by":"TT4KN3D3PWME",
"starting_version":1,
"title":"Issue for testing georeferencing",
"description":"",
"location_description":null,
"markup_metadata":null,
"tags":null,
"target_urn":"urn:adsk.wipprod:dm.lineage:BAu6NmpZRyW913SLf6J6IA",
"target_urn_page":null,
"collection_urn":null,
"due_date":"2020-09-30T00:00:00.000Z",
"identifier":30,
"status":"open",
"assigned_to":"201007062239661",
"assigned_to_type":"user",
"answer":null,
"answered_at":null,
"answered_by":null,
"pushpin_attributes":
"type":"TwoDRasterPushpin",
"location":
"x":5.710041960416264,
"y":4.169567131777653,
"z":0
,
"object_id":null,
"viewer_state":null,
"created_at":"2020-09-24T13:45:02.766Z",
"created_by":"TT4KN3D3PWME",
"created_doc_version":1,
"external_id":null,
"attributes_version":2
,
"snapshot_urn":"urn:adsk.objects:os.object:ng-issues-prod-86fe431f-012b-4349-939e-cbb0788cfbba/25881168-6246-4c32-9cc2-f31409ce519a",
"owner":"TT4KN3D3PWME",
"issue_type_id":null,
"issue_type":null,
"issue_sub_type":null,
"root_cause_id":null,
"root_cause":null,
"quality_urns":null,
"permitted_statuses":[
"answered",
"closed",
"void"
],
"permitted_attributes":[
"answer",
"assigned_to",
"assigned_to_type",
"description",
"due_date",
"location_description",
"trades",
"owner",
"issue_type",
"issue_type_id",
"root_cause",
"root_cause_id",
"title",
"status",
"sheet_metadata",
"lbs_location",
"pushpin_attributes",
"snapshot_urn",
"close_version",
"comments_attributes",
"attachments_attributes",
"markup_metadata",
"updated_at",
"tags",
"collection_urn",
"custom_attributes",
"ng_issue_subtype_id"
],
"comment_count":0,
"attachment_count":0,
"permitted_actions":[
"add_comment",
"add_attachment"
],
"sheet_metadata":
"is3D":false,
"sheetGuid":"6882be48-6626-5238-d3df-94e9f0a0019d",
"sheetName":"2D View"
,
"lbs_location":null,
"ng_issue_subtype_id":"1611f9cf-4ba0-43d0-af0b-0047499beb81",
"ng_issue_type_id":"5830d615-c7fa-4aa3-8f9e-aa520176fa4d",
"issue_template_id":null,
"custom_attributes":[
],
"trades":null,
"comments_attributes":null,
"attachments_attributes":null
,
"relationships":
"container":
"links":
"self":"https://developer.api.autodesk.com/issues/v1/containers/86fe431f-012b-4349-939e-cbb0788cfbba/quality-issues/0f84bfa2-43be-4761-8c84-ff5314fca382/relationships/container",
"related":"https://developer.api.autodesk.com/issues/v1/containers/86fe431f-012b-4349-939e-cbb0788cfbba/quality-issues/0f84bfa2-43be-4761-8c84-ff5314fca382/container"
,
"attachments":
"links":
"self":"https://developer.api.autodesk.com/issues/v1/containers/86fe431f-012b-4349-939e-cbb0788cfbba/quality-issues/0f84bfa2-43be-4761-8c84-ff5314fca382/relationships/attachments",
"related":"https://developer.api.autodesk.com/issues/v1/containers/86fe431f-012b-4349-939e-cbb0788cfbba/quality-issues/0f84bfa2-43be-4761-8c84-ff5314fca382/attachments"
,
"changesets":
"links":
"self":"https://developer.api.autodesk.com/issues/v1/containers/86fe431f-012b-4349-939e-cbb0788cfbba/quality-issues/0f84bfa2-43be-4761-8c84-ff5314fca382/relationships/changesets",
"related":"https://developer.api.autodesk.com/issues/v1/containers/86fe431f-012b-4349-939e-cbb0788cfbba/quality-issues/0f84bfa2-43be-4761-8c84-ff5314fca382/changesets"
,
"comments":
"links":
"self":"https://developer.api.autodesk.com/issues/v1/containers/86fe431f-012b-4349-939e-cbb0788cfbba/quality-issues/0f84bfa2-43be-4761-8c84-ff5314fca382/relationships/comments",
"related":"https://developer.api.autodesk.com/issues/v1/containers/86fe431f-012b-4349-939e-cbb0788cfbba/quality-issues/0f84bfa2-43be-4761-8c84-ff5314fca382/comments"
,
"activity_batches":
"links":
"self":"https://developer.api.autodesk.com/issues/v1/containers/86fe431f-012b-4349-939e-cbb0788cfbba/quality-issues/0f84bfa2-43be-4761-8c84-ff5314fca382/relationships/activity-batches",
"related":"https://developer.api.autodesk.com/issues/v1/containers/86fe431f-012b-4349-939e-cbb0788cfbba/quality-issues/0f84bfa2-43be-4761-8c84-ff5314fca382/activity-batches"
,
"root_cause_obj":
"links":
"self":"https://developer.api.autodesk.com/issues/v1/containers/86fe431f-012b-4349-939e-cbb0788cfbba/quality-issues/0f84bfa2-43be-4761-8c84-ff5314fca382/relationships/root-cause-obj",
"related":"https://developer.api.autodesk.com/issues/v1/containers/86fe431f-012b-4349-939e-cbb0788cfbba/quality-issues/0f84bfa2-43be-4761-8c84-ff5314fca382/root-cause-obj"
,
"issue_type_obj":
"links":
"self":"https://developer.api.autodesk.com/issues/v1/containers/86fe431f-012b-4349-939e-cbb0788cfbba/quality-issues/0f84bfa2-43be-4761-8c84-ff5314fca382/relationships/issue-type-obj",
"related":"https://developer.api.autodesk.com/issues/v1/containers/86fe431f-012b-4349-939e-cbb0788cfbba/quality-issues/0f84bfa2-43be-4761-8c84-ff5314fca382/issue-type-obj"
我没有看到任何信息可以让我检索“georef.dwg”,但 BIM360 显然可以...我看到 targetUrn
但这不是 BIM360 项目版本的 URN。
当我在 Revit 文件上创建问题时,我在 issue.attributes.pushpin_attributes.viewer_state.seedURN
中得到一些似乎指向正确版本 URN 的内容,但在 dwg 上创建问题时却没有。
【问题讨论】:
【参考方案1】:target_urn 是要走的路。在此示例中,我在自己帐户的 Drawing1.dwg 上创建了一个问题。
从 BIM360docs folder content,我得到了这个
"id": "urn:adsk.wipprod:dm.lineage:_3AoTpMBQDm060PABvgQKg",
"name": "Drawing1.dwg",
"type": "items",
"state": true,
…
从Issues API,我得到以下信息:(我删除了所有不相关的属性)
[
"created_at": "2020-10-01T14:05:06.524Z",
"synced_at": "2020-10-01T14:05:06.528Z",
…
"starting_version": 6,
"title": "cyrille",
"target_urn": "urn:adsk.wipprod:dm.lineage:_3AoTpMBQDm060PABvgQKg",
"target_urn_page": null,
…
"pushpin_attributes":
"type": "TwoDRasterPushpin",
"location":
"x": 2.8286987422505243,
"y": 5.8554650473401395,
"z": 0
,
….
,
…
"sheet_metadata":
"is3D": false,
"sheetGuid": "6882be48-1234-5238-d3df-94e9f000019d",
"sheetName": "2D View"
,
….
"id": "ae09c72c-8236-6895-ba27-0141bf6aae97"
]
查看 target_urn = urn:adsk.wipprod:dm.lineage:_3AoTpMBQDm060PABvgQKg,与我的项目 id 匹配 = urn:adsk.wipprod:dm.lineage:_3AoTpMBQDm060PABvgQKg
starting_version 将为您提供所需的 BIM360docs 项目版本。
【讨论】:
非常感谢。令人困惑的是,目标“URN”实际上是一个项目“Id”。我还想知道为什么“pushpin_attributes.viewer_state”对于.dwg 是空的,而对于.rvt 却不是。当我在 BIM360 中单击问题时,似乎将查看器恢复到显示特定问题的状态... @Philippe - 要回答您问题的第一部分,它引用了一个项目,因为一个问题从一个版本开始,但可能会关闭另一个版本(问题的生命周期),因此更容易一个项目而不是一个版本。对于您的第二个问题,它与 snapshot_urn 有关,如果您需要我可以研究如何查询它,请告诉我。以上是关于如何从 BIM 360 问题有效负载中检索链接的文档?的主要内容,如果未能解决你的问题,请参考以下文章
使用 Model Derivative api 的 BIM 360 设计能够看到 SVF2
如何使用 javascript/Nodejs 从生成的 urn 中查看 Forge 中的 BIM360 Revit 文件