How does Autodesk forge close expanded nodes in the model tree?

Brother Dong said that the component is selected, but when we select the component and click blank, the model tree will still be open, but there is no component selected. So in view of this situation, combined with the code of Dongge, we made some improvements.

Step 1: get all the parent nodes removed from the first level (because 1 is the first level root node, because the array operation containing 1 before 7.0 will blank the model tree ~)

Step 2: we understand the obtained array as ms.selectedNodes That’s it.. The rest is circulation

Read more here: Source link