How to enable search for the model structurue panel with Forge Viewer

我是研究僧i 提交于 2019-12-13 03:18:26

问题


By default search is disabled for the model structure panel on mobile devices...

For enabling search box in mobile devices, I am using

this.viewer.setModelStructurePanel(new Autodesk.Viewing.Extensions.ViewerModelStructurePanel(this.viewer, 'Model browser', {hideSearch: false})).

I think because of this the model structure is rebuilt and hidden model is not listed in the model browser. Can you help me solving this?


回答1:


Simply add the missing model back programmatically with

var model = NOP_VIEWER.impl.modelQueue().getHiddenModels()[0]
NOP_VIEWER.modelstructure.addModel(model)

And you might want to round out the missing configuration for your new model panel as well:

new Autodesk.Viewing.Extensions.ViewerModelStructurePanel(this.viewer, 'Model browser', {
  docStructureConfig: viewer.config.docStructureConfig,
  hideSearch: false,
  excludeRoot: viewer.config.modelBrowserExcludeRoot,
  startCollapsed: viewer.config.modelBrowserStartCollapsed,
  isolate: viewer.config.modelBrowserIsolateSelectedNodes
})


来源:https://stackoverflow.com/questions/58022319/how-to-enable-search-for-the-model-structurue-panel-with-forge-viewer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!