I’m trying to find a way to run Grasshopper Definitions as a script.
Here is an example GH Definition, I would like to automate:
The goal would be to run the Rhino Command “CreateManyCircles”
Have the user be prompted for one or several Curves and then have 13 circles be backed / added to the document
WHAT THE RHINO COMMAND SHOULD DO:
protected override Result RunCommand(RhinoDoc doc, RunMode mode)
string path = @“c:\test.ghcluster”;
if (!System.IO.File.Exists(path)) return Result.Cancel; //Read GH Cluster at file location c:\test.ghcluster //Find out which clusters inputs are required //Foreach Input in Cluster: Promt the User in Rhino //Varify Input //Call Grasshopper Cluster File and hand over input as variables to GH Definition //Get Geometry Objects back from the Grasshopper Clusters //Add the Objects to the document return Result.Success; }
Even though I created custom Grasshopper Components, I still can’t really wrap my head around the GH Code Architecture in depth.
Could someone provide an example of the bulletpoints above.
P.S. Added the Grasshopper definition (as gh File not as ghcluster file, because of the upload filter)test.gh (4.3 KB)