Hi, Giulio. Happy New Year. Thanks for your toturial, that’s very helpful.
But there is a error that troubles me a lot and I can’t figure out why. Here is the code:
from ghpythonlib.componentbase import executingcomponent as component
import Grasshopper, GhPython
import System
import Rhino
import rhinoscriptsyntax as rs
import scriptcontext as sc
class MyComponent(component):
def RunScript(self, crv_id):
sc.doc = Rhino.RhinoDoc.ActiveDoc
crv_o = sc.doc.Objects.Find(crv_id)
a = crv_o.Attributes.Name
sc.doc = ghdoc
return a
Compiling this code follow your tutorial, I got a new GH component without any error. But when I put this component into canvas and loaded input it get red and says:
Solution exception: global name “ghdoc” is not defined.
Do you know why? Can’t run correctly after compiling into GH component. But this code runs OK before the final step.