Grasshopper from c# plugin

I have searched with no success
I would like to Open a file in grasshopper and let it execute from within
a Rhino c# plugin

Any hint ?
Thanks
Gerry

Keep searching.

There are several ways. You can do it from rhino commands, from GrasshopperPlayer, from the GH SDK, from RhinoInside or from RhinoCompute…

I’d start here: RhinoApp.RunScript Method (String, Boolean)
Your script will start with :cricket:

Here is My Solution for others searching on same topic

public bool RunGrasshopperScript(string filename, bool close_doc )
{
string gh_is = “b45a29b1-4343-4035-989e-044e8580d9cf”;
Guid ghuid = new Guid(gh_is);
object ghplugin = RhinoApp.GetPlugInObject(ghuid);
if (ghplugin == null) return false;

        Grasshopper.Plugin.GH_RhinoScriptInterface ghInterface = ghplugin as Grasshopper.Plugin.GH_RhinoScriptInterface;

        ghInterface.OpenDocument(filename);
        ghInterface.RunSolver(true);
        if(close_doc) ghInterface.CloseDocument();
        ghInterface.HideEditor();
        return true;
    }

gd

1 Like