Hi all,
I have a simple python script that references the Grasshopper .dll in order to open a grasshopper file. It works in Rhino 7 and (I’m 98% sure) it was working in Rhino 8 until recently.
Now, when Rhino 8 runs the script, it opens the referenced file in Grasshopper but it does recognise bulit-in GH components like XY plane. Here is an example GH file that loads in Rhino 8 when loaded manually in Grasshopper but fails to load via the script.
CurveBoolean.gh (8.5 KB)
Here are the errors it displays when it loads via the script:
you can see for example, that none of the curve components have loaded:

Here is the script. Any help would be much appreciated - thanks!
#! python 2
import clr
import os
import Rhino
rv = major_version = int(str(Rhino.RhinoApp.Version).split('.')[0])
if rv == 7:
clr.AddReferenceToFileAndPath(r"C:\Program Files\Rhino 7\Plug-ins\Grasshopper\Grasshopper.dll")
elif rv == 8:
clr.AddReferenceToFileAndPath(r"C:\Program Files\Rhino 8\Plug-ins\Grasshopper\Grasshopper.dll")
#Previously the Rhino 8 Fix to get it working
#https://discourse.mcneel.com/t/system-uri-not-working/148206
clr.AddReference("System.Runtime")
import Grasshopper as gh
print rv
gh_scriptinterface = gh.Plugin.GH_RhinoScriptInterface()
gh_scriptinterface.OpenDocument(r"C:\Users\mho\Downloads\CurveBoolean.gh")