【发布时间】: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