Cancel active Rhino.Input.Custom.GetObject()

Hello,

Does anybody knows if is there a way to cancel a Rhino.Input.Custom.GetObject() to force _go.GetMultiple() or _go.GetOneObject to continue the execution (RhinoCommon)?

There are several times that the user doesn’t realize about the form (is asking for a geometry) and closes it, so the command prompt is still asking for an object.

I’m using RhinoApp.SendKeystrokes(); to send “Esc” key, when the form is closed, but it looks a little bit tricky…
So do you know if is there any other more elegant method to cancel the GetObject?

Thanks in advance.

Hi @Harper,

You should consider implementing a “push pick button” on your form.

For example, run the SelLayer command and then click 'Select`. Notice how the form hides until picking is finished?

If your form is based on WinForms, then see the SampleCsModalForm sample, part of our developer samples found on GitHub.

If you are coding in Rhino 6 and using Eto, then look at the SampleCsEtoSemiModalDialog sample.

Does this help?

– Dale

That’s a good worflow, Thanks for the suggest @Dale

Best Regards