import Rhino
import scriptcontext
def select_curves(prompt, preselect=True):
go = Rhino.Input.Custom.GetObject()
go.SetCommandPrompt(prompt)
go.GeometryFilter = Rhino.DocObjects.ObjectType.Curve
go.SubObjectSelect = False
if not preselect:
go.EnablePreSelect(False, False);
go.DeselectAllBeforePostSelect = False;
go.GetMultiple(1, 0)
if (go.CommandResult() == Rhino.Commands.Result.Success):
return go.Objects()
return None
def print_objects(objects):
for obj in objects:
print(obj.ObjectId)
obj_list0 = select_curves("Select first set of curves")
if obj_list0:
obj_list1 = select_curves("Select second set of curves", False)
if obj_list1:
print('First set:')
print_objects(obj_list0)
print('Second set:')
print_objects(obj_list1)
The curve that was selected during the first call to selectObject1() is still selected when selectObject1() is called the second time, and by default, pre-selected objects are used by GetObject() without allowing post-selection.
Are they anyway to select in the second set of curves some curves selected in the first set ?
I mean to unselect all before entering the post-selection of the second.