【问题标题】:Can I create BIM 360 Pushpin issues using server-side APIs (not Forge Viewer)?我可以使用服务器端 API(不是 Forge Viewer)创建 BIM 360 Pushpin 问题吗?
【发布时间】:2020-01-11 02:18:13
【问题描述】:

https://forge.autodesk.com/en/docs/bim360/v1/tutorials/pushpins/create-pushpin/ 文档示例中,它显示了如何创建与文档相关的(图钉)问题,但它使用 Autodesk Forge 查看器来获取文档中的选定工作表 (attributes.sheet_metadata.sheetGuid),位置位于工作表 (attributes.pushpin_attributes.location) 和视图状态 (attributes.pushpin_attributes.viewer_state) 以便传递给实际的服务器端 POST /issues/v1/containers/{container-id}/quality-issues API打电话。

我只需要调用服务器端 API,因为我需要自动输入数百个问题,而不显示我添加到 BIM 360 的每个问题的查看器。 是否有任何方法可以在没有查看器前端 API 的情况下从 BIM 360 文档中获取工作表 GUID 以插入到调用中,以及生成 issue.position 和 issue.viewerState 对象以传递给调用的编程方式?

我已经查看了Can I create document (pushpin) issues via api? 的问题,它指向相同的方向,但没有详细说明如何使用服务器端 API 来实现这一点。

var issue = PushPinExtensionHandle.getItemById('0');

var data = {

    sheet_metadata: { // `viewerApp.selectedItem` references the current sheet
      is3D: viewerApp.selectedItem.is3D(),
      sheetGuid: viewerApp.selectedItem.guid(),
      sheetName: viewerApp.selectedItem.name()
    },
    pushpin_attributes: { // Data about the pushpin
      type: 'TwoDVectorPushpin', // This is the only type currently available
      object_id: issue.objectId, // (Only for 3D models) The object the pushpin is situated on.
      location: issue.position, // The x, y, z coordinates of the pushpin.
      viewer_state: issue.viewerState // The current viewer state. For example, angle, camera, zoom.
    },
  }
};

我正在使用 NodeJS,但欢迎使用其他语言的任何代码示例。

【问题讨论】:

    标签: javascript autodesk-forge autodesk-bim360


    【解决方案1】:

    我通过在创建 BIM360 问题时对查看器发出的 HTTP 请求进行逆向工程来实现这一点。这是我使用 Node.js 从服务器端创建问题的代码:https://github.com/petrbroz/poc-hololens-bim360/blob/develop/helpers/forge/bim360.js#L73-L131

    【讨论】:

      猜你喜欢
      • 2018-04-01
      • 2018-05-29
      • 2020-06-24
      • 2020-11-05
      • 2021-10-27
      • 2020-06-08
      • 2018-08-24
      • 2021-07-17
      • 2023-03-30
      相关资源
      最近更新 更多