Issue
I wanted to build a Selection Tree like Navisworks GUI. The code of .NET API traverses the whole model and add each model item to the tree node. But it is too slow, especially for a large model. Is there any way to improve the speed?
Solution
The standard Windows tree controls are very poor at handling very large trees, and as such are often unsuitable for representing large selection trees. Traversing the entire hierarchy will be slow for large models using recursion, and added to the use of the Windows tree control, the slow performance is as expected.
We suggest doing something similar to the AppInfo sample by storing the ModelItem with the TreeNode and only looking at the children when the node is expanded, that way you limit the effect of the expansion speed to only examine children when it is needed.

Leave a Reply