rs.GetObjects and *then* SelName does not work properly


some of my Python scripts let the user select objects using rs.GetObjects(). The selection is frequently performed with the interactive SelName function. I.e. instead of picking objects with the mouse I type selname and choose objects based on their object name.

When I happen to choose objects that have no name assigned (i.e. the first entry <No name> in the Select Name dialogue box) then this does not seem to work properly. The objects are visually highlighted as selected but the result of the rs.GetObjetcs - function is None.

I think this might be related to this earlier toppic:_SelName from rs.GetObjects not returning expected results


Yes, I can confirm that…

As a workaround, I guess you could try this:

import rhinoscriptsyntax as rs

Seems to work with SelName inside the GetObjects() method, even if the objects have no name.

Oh that was quick. Thanks a lot for this nice idea. Actually my personal workaround is to give those objects a name, in most cases I assign names anyway sooner or later…