Python plugin, menu's

Hi!

I’ve created a bunch of Python scripts and zipped them into a RHI-file to act as a plugin. How would I go about to create a menu with these commands on?

Regards

  • Björn

Hi @bjornsyse, have you seen this in the compiler thread ?

_
c.

Thanks, I wasn’t even using the compiler!

Oh, but btw. It says it’s a Rhinoscript compiler. Will it compile the python scripts aswell?

Yes, it will. We use it a lot in a production environment. Works really well

1 Like

Same here. I’ve only noticed one issue, which I’ve pointed out in the past. If your script uses rs.Command(_New) or rs.Command(_Open) you may experience problems unless you add this right after:

scriptcontext.doc = Rhino.RhinoDoc.ActiveDoc

It was very frustrating to have scripts that worked perfectly, but a compiled plug-in that didn’t.

Dan

1 Like

Hey Dan,
I have this on my list to fix for the initial service release of Rhino 6 (yes, we are getting that close and locking down change).
https://mcneel.myjetbrains.com/youtrack/issue/RH-29456

I think this can be fixed by adjusting the rhinoscriptsyntax.Command function instead of making any changes to the script compiler. scriptcontext.doc can be something other than the RhinoDoc when run in the context of Grasshopper so a little extra checking needs to be done on our part.

Hi Steve,

Sounds good. I’ll watch for it when SR1 comes out.

Thanks,

Dan