ghpythonlib (both components and parallel) modules are available in the standard python editor in Rhino. Behind the scenes things are running through Grasshopper code, but you don’t have to use a canvas to do your work.

This also lets you work in a slightly different way where you can get points in Rhino using rhinoscriptsyntax “get input” type functions and pass those points (or curves or breps) into the Grasshopper component code.

9 Comments

One question: when combining the rhinoscriptsyntax functions and these new grasshopper component ones: passing guids is not possible, right?
For example using rs.GetObjects() instead of rs.GetPoints would not work?
These new grasshopper component functions require either object type data (Point3d, Polyline…) or data in the form of lists/tuples (point = [2,0,6])?

That is correct. The component functions would not know how to deal with guids. In those cases you would need to use the “coerce” functions in rhinoscriptsyntax (coercecurve, coercebrep, …) to get the geometry from the guids and then pass those on to the component functions.

Steve, I noticed that “scriptcontext.doc.Objects.” and after that “scriptcontext.doc.Views.Redraw()” is always called behind each rhinoscriptsyntax function which creates geometry. Seems that way geometry is added to Rhino.
What about baking geometry from Grasshopper? We do not need “scriptcontext.doc.Objects.” for that?
Is there some documentation explaining this?

I’m not sure I completely understand your question. It would probably be easier to discuss this at http://discourse.mcneel.com where I can bring other people into the discussion who may be more helpful.

Hey Arash,
In case you couldn’t solve the problem: Are you sure ghpythonlib didn’t load? I thought the same thing because I got no auto-complete while writing the import statement, but after typing it in anyway the function calls worked.