我是否可以使用服务器端 API(不是 Forge Viewer)创建 BIM 360 图钉问题?



在 https://forge.autodesk.com/en/docs/bim360/v1/tutorials/pushpins/create-pushpin/文档示例中,它显示了如何创建与文档相关的(图钉(问题,但它利用Autodesk Forge Viewer获取文档中的选定工作表(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的每个问题的查看器。 有没有办法从 BIM 360 文档中获取工作表 GUID 以插入到调用中,而无需查看器前端 API,以及生成 issue.position 和 issue.viewerState 对象以编程方式传递给调用?

我已经查看了问题 我可以通过 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,但欢迎其他语言的任何代码示例。

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

最新更新