Page 1 of 1

Selector.MultipleSelect(dRect, True, False) returns empty collection

Posted: 05 Nov 2018, 13:37
by StefanChrist
Hello support,

after upgrading from v11 to v12 we are facing another issue using Selector.MultipleSelect. In v12 the Selector class always returns an empy collection. Could you please investigate if the class is working as expected.

Thank you.

Re: Selector.MultipleSelect(dRect, True, False) returns empty collection

Posted: 06 Nov 2018, 20:31
by support
Hello Stefan,

In v12 the CADSelector.MultipleSelect() method behaviour depends on a CADSelector.UseShiftToAddSelected property value which determines one of the available selection modes:

CADSelector.UseShiftToAddSelected = False (by default) - allows each selected object (group of objects) to be added to the current selection set without discarding previous selections. You have to hold the Shift key pressed and use the left mouse button to discard the previous selections.

CADSelector.UseShiftToAddSelected = True - when trying to select more objects in a drawing after selecting one or more items, the previously selected objects become unselected. You have to hold the Shift key pressed and use the left mouse button to be able to add new objects to the selection set.

The above mentioned selection modes work in the same way as Use Shift to add to selection option in AutoCAD:

Image

The second parameter of the CADSelector.MultipleSelect() method actually takes the Shift key state (pressed and held or not pressed). When CADSelector.UseShiftToAddSelected = False and this parameter is set to True (that emulates the case when the Shift key is pressed and held), you are only able to discard previous selections. This is the expected behaviour.

Mikhail

Re: Selector.MultipleSelect(dRect, True, False) returns empty collection

Posted: 07 Nov 2018, 09:40
by StefanChrist
Thank you, Mikhail!