Running Rhino commands in Grasshopper Python

@Mr_Sinter,

Yeah sorry, i’ve just quickly hacked this together. If the solid object you select in Rhino is a 10x10x10 cube or sphere with diameter 5 it should work. Otherwise you can change the cylinder_height, either from within the script or in gh.

good. :wink: Btw. one thing about passing the name of the *.gh file i´ve forgotten: If the file path to this *.gh file or the filename itself has spaces within, you better load it using this line:

Grasshopper.OpenDocument( chr(34) + "C:\DrillHole.gh" + chr(34) )

This will put a pair of extra quotes around the grasshopper file.

c.

There is a little trick with python - as it accepts both double and single quotes and doesn’t mix them - you can usually do something like this:

Grasshopper.OpenDocument("'C:\DrillHole.gh'")

(I hope it works in this case)

–Mitch