能否在Forge Viewer中获取BIM360 Model Coordination的模型变换参数?
BIM360 Model Coordination变换参数获取说明
使用AggregatedView方法加载模型时,可以直接在Forge Viewer中获取到BIM360 Model Coordination里设置的transform变换参数,具体说明如下:
- 参数存储位置:所有通过AggregatedView加载的BIM360协调模型,其重定位变换参数会直接内置到对应的模型实例对象中,无需调用额外接口拉取。
- 获取代码示例:
// 监听AggregatedView加载完成事件 viewer.addEventListener(Autodesk.Viewing.AGGREGATE_VIEW_READY_EVENT, () => { // 遍历所有已加载的模型实例 const allModels = viewer.getAllModels(); allModels.forEach(model => { // 获取模型的4x4变换矩阵,即为Model Coordination中配置的transform参数 const coordinationTransform = model.getPlacementTransform(); // 可直接打印或使用该矩阵 console.log(coordinationTransform); }) })
- 参数说明:返回的
coordinationTransform是标准4x4齐次变换矩阵,包含了模型的平移、旋转、缩放三类变换信息,可直接用于坐标转换、模型二次定位等开发场景。 - 注意事项:请确保你的Forge Viewer版本在v7.40及以上,低于该版本的Viewer原生不支持同步BIM360 Model Coordination的变换参数,需要手动升级Viewer版本才能正常获取。
内容的提问来源于stack exchange,提问作者Nic Maes
相关产品推荐
相关产品推荐

