Search code examples
performanceselectionautodesk-forgeautodesk-viewer

Autodesk Forge Viewer - Selecting large number of elements (performance)


I have a large federated model loaded in Autodesk Forge Viewer (~300k elements from several IFC files). I'm doing a cross-model (aggregate) selection like this:

var selection = [{model1 : [ids...]}, {model2 : [ids...]}, {model3: [ids...]}, etc...);
viewer.impl.selector.setAggregateSelection(selection);

Now, given that the number of selected elements goes to 100k+, this freezes the UI for a couple of seconds, then once all of the elements get highlighted in the viewer the performance (fps) of the viewer degrades significantly. Switching to isolation instead of selection (highlighting) improves viewer performance but it still freezes the UI for a couple of seconds while doing it.

Are there any performance tips when doing these large selections, can the selection/isolation process be done async so the UI feels more responsive?

Cheers


Solution

  • I'm afraid the selection mechanism (both the state toggling and the rendering) isn't optimized for such numbers, and there's no way to optimize it yourself. This would require a code update in the internal viewer implementation.

    Before we pass this to the engineering team, however, I would like to ask about your actual use case. The selection functionality is typically used to bring user's attention to one (or a small number) of elements in the design, or to allow the user to choose one (or a small number) of elements for some further processing. But selecting 100k+ elements, and then continuing the use of the viewer with those 100k+ elements selected? What exactly do you need that for? Have you considered using other features of the viewer such as the theming colors?