AggregatedView 的 keepCurrentModels 选项

keepCurrentModels option for AggregatedView

我正在尝试加载多个模型,请按照本文中描述的步骤操作:https://forge.autodesk.com/blog/loading-multiple-models-forge-viewer-v7

如果您不使用新的 AggregatedView class,您可以在 viewer.loadDocumentNode(...) 期间使用选项 keepCurrentModels: true,如文章中所述。

但是,在使用 AggregatedView 时,我无法保留已加载的模型。这是因为您没有使用 loadDocumentNode(...).

加载模型

我使用网站示例中提供的代码 (https://gist.github.com/yiskang/c404af571ba4d631b5929c777503891e)。如何修改此代码以便在加载初始模型后加载模型?

只需调用 AggregatedView#show( bubble ) 即可在首字母后加载其他模型。 AggregatedView#show 将在根据当前设计加载新模型时应用选项 keepCurrentModels: true。相反,要卸载已加载的模型,请调用 AggregatedView#hide( bubble ).