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

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

问题描述

加载通过共享坐标对齐的 Revit 模型时,模型不会在 Forge Viewer 中使用 globallOffset 设置对齐.

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 定位元数据

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

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天全站免登陆