populating >1 PMP SelectionBox using MultiSelect

we make PropertyManagerPages that can contain PropertyManagerPageSelectionboxes. We were populating them programmatically by calling SetSelectionFocus(), then calling Entity.Select4() for each face we wanted to appear in the box.

This was fine except it gets slow for lots of faces, as the view seems to be redrawn between each entity, so the you can see the selection growing bit by bit over several seconds (or even minutes). Setting ModelView.EnableGraphicsUpdate = false didn't seem to help.

So I tried using ModelDocExtension.MultiSelect() to select all the faces at once. This is very quick, and works fine if there is only one selection box in the PMP, but if there are more it seems to ignore which box has selection focus, so the selection for all boxes ends up going to one box, each overwriting the previous.

Any ideas to fix this? Either speeding up Entity.Select4(), probably by suppressing graphics redraw, or getting MultiSelect to send the selection to a particular selection box - or any other approach.

BTW the API for selection generally seems pretty unfriendly - i seem to need ISelectionMgr to query the current selection, but cannot use this to set a selection, instead I have to use ModelDocExtension for this.

cheers,

rob

SolidworksApi macros