How do I get the objects I've filtered from the model browse? I've used OBJECT_TREE_CREATED_EVENT, but it's only used the first time when the model is loaded.
You can subscribe to HIDE_EVENT
and SHOW_EVENT
. You will get the dbid of hidden or showed nodes.
viewer.addEventListener(Autodesk.Viewing.HIDE_EVENT, (nodes, model)=> {
// nodes returns an object like that :
// {type: "hide", nodeIdArray: [<dbid>], model: Model, target: GuiViewer3D}
})
viewer.addEventListener(Autodesk.Viewing.SHOW_EVENT, (nodes, model)=> {
// nodes returns an object like that :
// {type: "show", nodeIdArray:[<dbid>], model: Model, target: GuiViewer3D}
})
Also, if you want to access the complete list of hidden nodes for a model, you can use viewer.getHiddenNodes(model)