简体   繁体   English

在 Autodesk Forge 上合并 model

[英]combine model on Autodesk Forge

I have couple of questions about combine model on forge viewer (load list urn to 1 viewer):我有几个关于在 forge 查看器上组合 model 的问题(将列表 urn 加载到 1 个查看器):

  1. when i combine model. i only can get data from 1 main model in that combine.当我合并 model 时。我只能从该合并中的 1 个主要 model 获取数据。 for instance, var instanceTree = GlobalViewer.model.getData().instanceTree;例如, var instanceTree = GlobalViewer.model.getData().instanceTree; var allDbIdsStr = Object.keys(instanceTree.nodeAccess.dbIdToIndex); var list = allDbIdsStr.map(function (id) { return parseInt(id) }); list will return all dbid of main model, how can i access all data of all model when i combine?列表将返回主要 model 的所有 dbid,当我合并时如何访问所有 model 的所有数据?
  2. what is the unique id for object in combine model. i do some function with dbid and i realize it can appear in others model too.结合 model 中 object 的唯一 ID 是什么。我用 dbid 做了一些 function,我意识到它也可以出现在其他 model 中。
  3. When i combine 3d model(revit) with 2d model(autocad).当我将 3d 模型 (revit) 与 2d 模型 (autocad) 结合时。 it has 2 case: if 3d model load first i can rotate like normal, if 2d model load first i cant rotate the model any more.它有 2 种情况:如果 3d model 首先加载我可以正常旋转,如果 2d model 首先加载我不能再旋转 model。 how can i force it always can rotate?我怎么能强制它总是可以旋转?
  4. Autocad unit seems different with model in viewer. Autocad 单位在查看器中似乎与 model 不同。 it always scale down compare with the model. how can i fix that?与 model 相比,它总是缩小。我该如何解决?

Appreciate any comments,感谢任何评论,

Regarding #1: viewer.model obviously only references one of the models (I believe it's the last one you loaded), but you can use viewer.getVisibleModels() or viewer.getHiddenModels() to get other loaded models as well.关于 #1: viewer.model显然只引用了其中一个模型(我相信这是您加载的最后一个模型),但您也可以使用viewer.getVisibleModels()viewer.getHiddenModels()来获取其他加载的模型。

Regarding #2: dbIDs are only unique within a single model;关于 #2: dbIDs仅在单个 model 中是唯一的; many of the viewer methods accept an additional parameter specifying the model on which to operate, for example, you could say viewer.select([123, 456], oneOfMyModels) .许多查看器方法接受一个附加参数,指定要在其上操作的 model,例如,您可以说viewer.select([123, 456], oneOfMyModels)

Regarding #3: that's a good question;关于#3:这是个好问题; loading a 2D model first puts the viewer into 2D viewing mode (where only zoom and pan is allowed);加载 2D model 首先将查看器置于 2D 查看模式(仅允许缩放和平移); if you know you will be working with 3D models, I'd recommend always loading those first如果您知道您将使用 3D 模型,我建议始终先加载这些模型

Regarding #4: yes, each loaded model can have different units;关于#4:是的,每个加载的 model 可以有不同的单位; when loading a model using the loadDocumentNode method you can specify additional options (for example, a placement transform for the loaded geometries), and one of them is an object called applyScaling , for example, like so:使用loadDocumentNode方法加载 model 时,您可以指定其他选项(例如,加载几何图形的放置变换),其中之一是 object ,称为applyScaling ,例如,如下所示:

viewer.loadDocumentNode(doc, viewable, {
    applyScaling: { to: 'mm' }
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM