Documentation RhinoCommon API
Python_III_RhinoCommon - RhinoCommon methods that returns multiple outputs:
- Open file: “course_functions_that_outputs_multiple_results.ghx”
In python the function return a tuple, meaning the variable with “out” keywords jumps in front of the function declaration: return_type, output_variable = object_name.function_name(parameters)
from Rhino.Geometry import Plane, Surface
# function call
result, plane = x.FrameAt(u,v)
# output
a = plane
__________TASK__________ :
- Use method Rhino.Geometry.Intersect.Intersection.LineLine to intersect two lines:
from Rhino.Geometry import Line, Point3d
from Rhino.Geometry.Intersect.Intersection import LineLine
# Step 1 - replace ... with your code following the documentation:
#https://developerhttps://developer.rhino3d.com/docify/api/rhinocommon/rhino.geometry.intersect.intersection/lineline
#... = LineLine(...)
# Step 2 - output, uncomment all the lines
# point0 = line0.PointAt(parameter_t0)
# point1 = line1.PointAt(parameter_t1)
Python_III_RhinoCommon - RhinoCommon methods that returns values with “out” keyword:
import Rhino, clr, System
points = clr.StrongBox[System.Array[Rhino.Geometry.Point3d]]()
parameters = x.ToNurbsCurve().DivideByLength(0.1,True,False, points) # x is curve referenced from Grasshopper
a = list(points.Value) # a is output of a component