Python Plugin Creation Issues


I’m trying to create a plugin but I’m running into several issues I can´t find a satisfactory answer to in the forums, I’m just gonna list them here, any help or directions on where to find explanations about these subjects is much appreciated.

I´m using Python and Rhino 6 on Windows 7 with service pack 1.

  1. Compiling a Plugin including my own modules, I´ve tried both using the RhinoScriptCompiler.exe and clr.CompileModules(…) but haven’t been able to get any of them to work.

  2. </solved by Nathan Coatney> Getting compiled python scripts (.rhp) to run on a toolbar button. Apparently RunPythonScript “…” wont work on a compiled script, or otherwise non .py file, that makes sense, but there must be some other way to do it in order to be able to distribute a .rhi with both a .rhp and a .rui toolbar referencing its own scripts compiled into the .rhp, right?*
    </solved by Nathan Coatney>

  3. Lastly, is there anyway to create an installer for both a regular plugin for rhino and a grasshopper assembly (.ghpy) ?

Thanks for your help!


Have you tried these instructions:


Yes, this didn’t work for me, the resulting .rhi file gave me an error whereas the .rhi created using RhinoScriptCompiler didn’t. Also this solution is not compiled.

And have you tried RunScript instead of RunPythonScript ?

Yes, I get type errors, or an “instruction was expected” error. I don’t really know how to go about trying it that way because I haven’t been able to find any guide, tutorial or example on RunScript for a compiled python file.

If you have commands associated with the plugin, then maybe the buttons need to run the commands, rather than the script?

1 Like

Thanks mate! That really was an obvious idea I hadn`t thought about. this works for me, I don´t mind all my toolbar buttons being associated to a written command. Thank you so much!