Set of tools for a rhino plugin

Hello, my goal is to create a responsive tool that does some basic validation relevant to my use cases after each point, curve etc. is added. Results of such validation should be displayed in a seperate window. Another functionality is to generate a txt file containing output of my calculations where the input for these calculations are again points, curves etc. I am deciding which set of tools to use for this, what language to use that would satisfy my needs. I have tried c++ but the sdk seems to be lacking in documentation and doesnt really support gui if I understand correctly. I would prefer Python as thats what I am most proficient at but I am not really fond of Rhinos python environment. Is it possible to use for example pyqt, numpy and other libraries within a rhino plugin? Can I get some reccommendations what languages I should use? Thank you

In Rhino8 there have been big changes to the Python environment, that is, you no longer need to use IronPython, but you can use what I can only call “normal Python”, which has support for things like numpy.

For examples with python, check https://github.com/mcneel/rhinocommon/tree/master/examples/py (these may or may not be up-to-date with Rhino8).

If you’re creating user interfaces, you may also want to look at C# plug-ins based on RhinoCommon, with Eto for the UI, which is cross-platform so your plug-in will work on both Rhino platforms (Windows and Mac OS X).

Here are some examples with C# https://github.com/mcneel/rhinocommon/tree/master/examples/cs

3 Likes

The debugging environment is definitely superior with the C# toolchain from MS.

In addition to Menno’s links to github, have you found developer.mcneel.com, particularly
Rhino - Rhino.Python Guides (rhino3d.com)
and
Rhino - RhinoCommon Guides (rhino3d.com)
?

What you describe should be possible in pure scripts if you want to prototype it that way. You didn’t list deployment for other users or similar needs. If you added that, I’d point at C#.

2 Likes

I want the user to basically only run the plugin command once, that would start up a standalone window with like two buttons, one for export into a txt file, and the other to run a validation, either that or have the validation done in real time, not sure about that yet, I would also like to highlight the errors of said validation, for example make a point red. Basically my concern is what set of tools to choose to be able to create an application that starts with a plugin command and ends with the user closing it, not a set of commands
regarding deployment, it is going to be used by a few people within a team but I havent worked on deploying anything before so I did not take that into consideration

Eto forms is supported by Python as well isnt it? is there any difference/disadvantage to using it in either python or c#?

That could very well be, I don’t know.

Hi @Vojta_Hanzlík ,

Eto Forms are supported in both IronPython (Rhino 7) and CPython (Rhino 8), and they are cross-platform.
Winforms are supported in IronPython (Rhino 7) and C# (Rhino 8/7), but they are limited to Windows only.
WPF Forms are supported only in C# (Rhino 8/7) and are also limited to Windows.

Anything you can do in C# you can do in python, but It’s remarkably slower. Unnoticable if your task is not computationally intensive.
Hope that clarifies things,

Farouk

2 Likes

You’re describing most of my own use cases.

My advice is: C#, RhinoCommon, and call it a day.

Re: your question about using Eto forms from Python vs C#- I don’t think there’s anything in particular that can only be used in one vs the other. That said, again, if you want to be able to run things in a debugging environment the MS toolchain is IMO night vs day ahead of alternatives.

1 Like