Add Windows form to plugin

I’ve done this multiple times in a couple of plugins, but creating a new plugin, I’m stumped how to add a win form.

I’ve added System.Windows.Forms to the dependencies assemblies, but when I right-click the project name and select “Add”, “new item” doesn’t list windows form as an option.

What additional step or steps am I missing?

When you create the plugin project, check the box for WinForms:

Thx. Is there a way to recover from dumb mode, having not checked that box when creating the plugin, or do I have to create a new project and check the box?

You should just create a new project, and check the box. You can then copy/paste the other files into the new project and they should work fine.

As you can see on the left, the default is to create a .Net Core only plugin, by checking the Winform it will add the WindowsForms framework logic (seen on the right).

Thanks, how can I have access to that sub-window to check that box? it only shows the “background” window of your image.

Jorge,

You should download and install the latest Rhino Templates extension for Visual Studio. I also recommend installing Visual Studio Community 2022 if you are still running 2019.

Releases · mcneel/RhinoVisualStudioExtensions · GitHub

Do you have any resources that might help me understand how to create my own? I really don’t get where to start from…

Hi @Frusciante,

To get started writing plug-ins for Rhino, start here:

For samples to review, including creating dialog boxes and other UI stuff, see the samples repository on GitHub.

– Dale

Thanks Dale, I’ve seen this posted many times, and actually tried to start from there, but I don’t think it’s that easy, at least for me… I have succesfully tried the “commands” plugins, but never the “forms”.

In other words… “Instructions unclear” :stuck_out_tongue:

It really depends on what you are trying to do, because each part may require a different set of learning for you.

Are you building a simple command? Will your command have a UI? Will you use the Toolbar UI and ETO Forms (Rhino’s UI Tech) or something else?

Give me a summary of what you are trying to build and I’ll see if I can steer you in a direction.

I’m trying to make a command, which makes you select a curve (this part I have it covered) … Upon selection, I want a menu (similar to attributes) to trigger, on which I can populate with different options for a given geometry (like sliders, drop down menus, toggles, checkbox, etc…

So, I believe Rhino UI is the kind of solutions I’m looking for.

Appreciate the help if you have any, and if not thanks anyways!

P.D: I’m not really looking for anyone to solve my problems, I’m just trynna find better resources for me to learn. I know the Rhino-developer samples can be very helpful but can sometime be overwhelming when you have no idea what you are looking at.

I’ll try and put together a sample for you this weekend, you can then have an idea of how to proceed to build out such a plugin application.

Man, that would be awesome, thanks a lot!