Connect curves in Rhino Common (Iron Python)

Hi,

I have a python function that works well, however I cannot figure out how to assign variables for the both curves as result objects. It would be better to use the input curves however the method creates new curves.

def Connect(rc0,rc1):
    c0 = rs.coercecurve(rc0, -1, True)
    c1 = rs.coercecurve(rc1, -1, True)
    p0 = rs.CurveStartPoint(rc0)
    p1 = rs.CurveStartPoint(rc1)
    t = scriptcontext.doc.ModelAbsoluteTolerance
    a = scriptcontext.doc.ModelAngleToleranceDegrees
    rc = Rhino.Geometry.Curve.CreateFilletCurves(c0, p0, c1, p1, 0, False, True, True, t, a)
    if rc.Count != 0:
        for crv in rc: 
            scriptcontext.doc.Objects.AddCurve(crv)
        scriptcontext.doc.Objects.Delete(rc0, False)
        scriptcontext.doc.Objects.Delete(rc1, False)
        scriptcontext.doc.Views.Redraw()
newIds = []
for crv in crvs:
    id = scriptcontext.doc.Objects.AddCurve(crv)
    if id:
        newIds.append(id)

Something like that is maybe what you are looking for?

-Pascal

1 Like

Thank you!,

It works well…