WinForms: Button EventHandler for GetObject


I spent all day methodically piecing code together to make a valid attempt at a user interface for a simple script that pipes surface normals. I’m stuck trying to “GetObject” by pressing a button. I scoured the forums and the internet for possibilities and made some valiant attempts with no luck (limited skill). Any help would be appreciated.

Draw Surface Normals (with GUI interface) (8.8 KB)



One way is to hide the modal form before requiring user input in Rhino’s main window:
Draw Surface Normals (with GUI interface) (9.1 KB)



Hi @stevefuchs,

in case of a modal form, there is [Rhino.UI.Dialogs.PushPickButton] ( which allows to pick an object and return to the modal state of the dialog.

You might also consider using Rhino.UI.Dialogs.Dialogs.ShowSemiModal to still display your dialog as modal but allow interaction with Rhino. Compared to form.ShowDialog() it does have a return value.