Set Selection to nothing

On 24/05/2013 at 06:11, xxxxxxxx wrote:

How can you set the selection to nothing?

I know there is nothing selected by default, but in my plugin I used BaseDocument.SetSelection( bl [, mode=SELECTION_NEW ]). At a later point I want nothing to be selected, how should I arrange that, because you need a baseobject for bl?

On 24/05/2013 at 06:46, xxxxxxxx wrote:

Allready found it.

c4d.CallCommand(12113) # Deselect All

On 24/05/2013 at 07:13, xxxxxxxx wrote:

this is how you would do it yourself.

for obj in doc.GetActiveObjects(c4d.GETACTIVEOBJECTFLAGS_CHILDREN) : obj.ToggleBit(c4d.BIT_ACTIVE)
c4d.EventAdd()

On 24/05/2013 at 08:41, xxxxxxxx wrote:

Try to avoid CallCommand() calls. They will break your undo step apart. As littledevil
already showed, you can change the selection-state manually. Rather use DelBit() though,
since ToggleBit() does invert the state, rather then setting it to off/false.

Best,
-Nik

On 24/05/2013 at 08:59, xxxxxxxx wrote:

Thanks guys!