Grasshopper definition to toolbar button

Hi,
I need to turn a grasshopper definition (which I did not write myself) into a command that can be run from a toolbar button for a client - it has 5 or 6 numerical inputs that would need to be asked for at the command line, then it should run.

I haven’t ever done this - usually I either write my own Python scripts or just run stuff directly out of Grasshopper, but this is for someone who is not GH-savvy so I thought it would be easier to package it up as a simple toolbar button.

Can someone point me to the documentation for doing this?

Thanks, --Mitch

Hey Mitch -

The documentation to GrasshopperPlayer would be here.
There’s a thread from April 2020 that you could read through:

The basic idea is that you use some “Get” components from the Params -> Util tab (in your case, it sounds like Get Integer or Get Number is all you need), do your magic, and then use Context Bake to bake the geometry into the Rhino document.

Once you have added those components to the Grasshopper definition, you can use the player to run it. You could also use the Script Compiler to turn this into a plug-in.
-wim

Two hints for GHPlayer

Make a dummy definition without function and load it on RH start. (Options General)
This loads all GH-Assembly on RH start, what im mean is here from video time 08:43

Direct opening of Grasshopper should be avoided at the moment, we have a bug here.