import rhinoscriptsyntax as rs import Rhino.Geometry import scriptcontext def PlaneCurveIntersection(plane, curve, tolerance=rs.UnitAbsoluteTolerance()): "Intersect an infinite plane and a curve object" plane = rs.coerceplane(plane, True) curve = rs.coercecurve(curve, True) if tolerance is None: tolerance = scriptcontext.doc.ModelAbsoluteTolerance intersections = Rhino.Geometry.Intersect.Intersection.CurvePlane(curve, plane, tolerance) if intersections: rc = [] for intersection in intersections: a = 1 if intersection.IsOverlap: a = 2 b = intersection.PointA c = intersection.PointA2 d = intersection.PointB e = intersection.PointB2 f = intersection.ParameterA g = intersection.ParameterB h = intersection.OverlapA[0] i = intersection.OverlapA[1] j = intersection.OverlapB[0] k = intersection.OverlapB[1] rc.append( (a,b,c,d,e,f,g,h,i,j,k) ) else: rc = None return rc a = rs.GetObject() rs.SelectObject(a) b = PlaneCurveIntersection(rs.WorldZXPlane(), a) rs.AddPoint(b[0][3])