问题描述
我目前正在一家专门从事 BIM 的公司实习.到目前为止,我的任务是实施 Forge Autodesk 查看器,适用于多个模型的聚合和显示.我设法编写了一个工作查看器,并找到了一种聚合模型的方法,但我无法理解如何使它们协同工作.
我已经按照 Forge Autodesk 教程实现了一个查看器,并在 Forge Autodesk 博客上找到了一篇关于使用我尝试集成到我的查看器的代码查看多个模型的文章,但目前未成功.
>我实现的查看器:
I'm currently doing an internship in a company specialized in BIM. My mission so far consists in implementing a Forge Autodesk viewer, suited for the aggregation and the display of multiple models. I've managed to code a working viewer, and to find a supposed way to aggregate models, but I can't understand how to make them work together.
I've already implemented a viewer, following the Forge Autodesk tutorial, and found on the Forge Autodesk blog an article about viewing multiple models with a code I'm trying to integrate to my viewer, at this point unsuccessfully.
The viewer I implemented : http://learnforge.autodesk.io/#/
The supposed way to display aggregated models : https://forge.autodesk.com/blog/supporting-multiple-models-new-modelstructurepanel
I should be able to select and display several loaded models in the same viewer (for example a model for a building and a model for the pipe network). However, I can't figure out how this script has to be added to my viewer.I've already tried to contact the author, but he answered me he was not working with Autodesk anymore, and told me to ask the Forge support about my issue.
Thanks in advance !
Basically in simpler terms to aggregate models one will need to load them respectively:
viewer.start(model1URL, options); //first model
...
viewer.loadModel(model2URL, options) //second model
... //more models
See a simple live sample here
As was mentioned in Philipe's article you will need to subscribe to different events as opposed to single model like AGGREGATE_SELECTION_CHANGED_EVENT
, Autodesk.Viewing.AGGREGATE_ISOLATION_CHANGED_EVENT
, Autodesk.Viewing.AGGREGATE_FIT_TO_VIEW_EVENT
etc when working with multiple models.
And starting from Viewer v6 the built-in model browser
deals a lot better with multiple models and almost covers the functionality described in the article - you can look into the code sample there and come up with your own extension:
这篇关于如何实现 Forge Autodesk 模型聚合查看器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!