Forge Viewer加载具有共享坐标的多个Revit模型 [英] Forge Viewer loading multiple Revit models with shared coordinates

查看:287
本文介绍了Forge Viewer加载具有共享坐标的多个Revit模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在加载按共享坐标对齐的Revit模型时,这些模型在具有globallOffset设置的Forge Viewer中不对齐.

When loading Revit models which are aligned by shared coordinates, the models does not align in Forge Viewer with globallOffset settings.

带有placementTransform选项的loadModel似乎可行,但是直到通过viewer.model.getDocumentNode().getAecModelData().refPointTransformation

The loadModel with placementTransform option seems to be viable, but the shared coordinates data is not made available until after the model is loaded, via viewer.model.getDocumentNode().getAecModelData().refPointTransformation

最早我将模型数据存储在onLoadModelSuccess内部,现在已经太晚了,无法将其输入到加载选项中,并且需要转换几何形状.

earliest I have the model data is inside the onLoadModelSuccess which is too late to feed into the load options, and will require to transform the geometries.

var modelOptions = {
  sharedPropertyDbPath: doc.getPropertyDbPath(),
  globalOffset: offset,
  placementTranform: ???,
  isAEC: true
};

viewer.loadModel(svfUrl, modelOptions, onLoadModelSuccess, onLoadModelError);

否则如何对齐模型?还是加载模型而不先渲染几何以获取数据,然后将变换矩阵输入另一个loadModel调用中?

How would it be possible to align the models otherwise? Or maybe to load the model without rendering the geometry first to get the data then feed the transform matrix into another loadModel call?

推荐答案

同时使用以下两个选项来应用Revit共享坐标:

Use the following two options together to apply Revit shared coords:

  • globalOffset-告诉LMV不要自动居中模型
  • applyRefPoint-告诉LMV如何为Revit文件应用任何svf定位元数据
  • globalOffset - tells LMV not to auto centre model
  • applyRefPoint - tells LMV how to apply any svf positioning meta-data for Revit files

因此,请在您的加载选项中尝试以下操作:

So try the below in your load options:

var modelOptions = {
  sharedPropertyDbPath: doc.getPropertyDbPath(),
  globalOffset: offset,
  applyRefPoint: true,
  isAEC: true
};

并在此处上查看此实时示例,以获取有关使用情况的参考placementTranform选项.

And see this live sample here for usage reference on the placementTranform option.

这篇关于Forge Viewer加载具有共享坐标的多个Revit模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆