Not sure if this is a dream or I missed some announcement.
Is this what I think it is?
@piac, can you chime in here?
@velopl Yes, RhinoCommon give have access to all Grasshopper functionality.
This might still change a little in the next few weekly WIP updates, so as a namespace it is still in beta.
@piac I have to say this is probably the most exacting feature in R6 for me personally so far but I have to say I don’t know how to start with it. Would you be able to provide even the simplest example of use? Let’s say equivalent of ghcomp.components.Line ? How to create parameters in code as driving in Rhino.Geometry straight in gives me error. I’d be really grateful.
private void RunScript(Point3d x, Point3d y, ref object A)
{
Rhino.NodeInCode.ComponentFunctionInfo cfi = Rhino.NodeInCode.Components.FindComponent("Line");
string[] warnings = null;
A = cfi.Evaluate(new object[]{x,y}, true, out warnings)[0];
if(warnings != null && warnings.Length > 0){
Array.ForEach(warnings ,w=>Print(w));
}
}
http://developer.rhino3d.com/api/RhinoCommon/html/T_Rhino_NodeInCode_ComponentFunctionInfo.htm
Thank you for adding this McNeel!
EDIT* Ok, better look Using the NodeInCode namespace