[Python] Select objects from script

Could anyone give me an example how can I select different objects in the active document?

I’m not talking about GetObjed() that allows me to select something.

I’m talking about running a script and it selects something based on some criteria.

Thanks in advance.

Hi,
you can use, for instance, the below commands to get a list of objects corresponding to some criteria then rs.SelectObjects(guids) to select them. Start with rs.UnselectAllObjects() to clear the current selection.

ObjectsByColor

ObjectsByGroup

ObjectsByLayer

ObjectsByName

ObjectsByType

SelectedObjects

UnselectAllObjec

2 Likes

Thank you Graham.

@Dancergraham,

what about objects that do not have GUID? :slight_smile: like control points ( SelectObjectGrops)

But not all, just some of them that comply with a criteria?

Never mind I got it:

rs.SelectObjectGrip( obj, point_index )

1 Like