I’m having a little difficulty ascertaining the best practices for building a Python plugin. I basically just want multiple commands in a single file. And I want to install the plugin the same way I would a C# plugin. This isn’t quite the same as running scripts.
You probably want to look at the page that has this on it Rhino - RhinoCode Command Line Interface
Working with projects: Rhino - RhinoCode Command Line Interface
Thanks Nathan! Stuff I need to learn eventually I think.
I might have created a misleading post title. Basically what I’m working with is this:
So not so much a plugin but rather a “Command Script” I guess… maybe? At the bottom I am prompted for the name of my “plugin”. I’m not sure if an RHP file is automatically generated here or not.
I created some tools in C# that I’m porting (trying to) over to Python. I want to utilize the built-in Python editor. Similar to my C# code I want to have multiple commands in a single file. Failing that I want to have a relatively easy way of referencing the same file which will contain base commands, etc… (your basic OOP structure).
Also, where do I store my command script files and how to I load/install them?
I guess the SDK package for Visual Studio actually supports Python? Maybe I ought to just go that route?
I leave answering that to @eirannejad
I haven’t done any commands with Python, for that I always use C#.
This is a great video by @eirannejad and you don’t have to setup a complex development environment, all you need is Script editor.
See this as well for documentation links:
I’ve been using “EditPythonScript” this whole time. f-strings were throwing errors and I was thinking WTF as I swore I had read that Rhino supports the (close to) latest version of Python.
I didn’t even know about the C# lol!
Very much looking forward to more videos!!
Haha yes. In Rhino >= 8 the command ScriptEditor
is the new hot thing (sometimes it might not feel as matured as the older editor but we are on it and keep improving it)