GetObject.GetMultiple returns Cancel for no geometry

Hello guys,

via Rhino.Input.Custom.GetObject() I implemented a picking functionality. Today I found out that I can’t pick zero objects because that leads to a Cancel for the CommandResult. I use the parameters minimumNumber=1, maximumNumber=0 for GetMultiple. Changing the minimumNumber to 0 doesn’t change anything, I still can’t differentiate between a real Cancel by the user or a selection of zero objects.

Thank you in advance!

Marcel

Try this:

var go = new GetObject();
go.SetCommandPrompt("Select objects");
go.AcceptNothing(true);
GetResult res = go.GetMultiple(1, 0);
if (res == GetResult.Object)
{
  // TODO...
}
else if (res == GetResult.Nothing)
{
  // TODO...
}

Thank you, dale! I totally missed the AcceptNothing method. It works perfectly fine.