Python JoinCurves issue

Apologies if this is something simple that I’m doing wrong but I can’t figure out why the JoinCurves function doesn’t work for the following python script-

import rhinoscriptsyntax as rs

c1 = (0,-70,40)
c2 = (76,-70,40)
c3 = (76,70,40)
c4 = (0,70,40)

corners = (c1,c2,c3)
corners1 = (c3,c4,c1)

curve1 = rs.AddPolyline(corners)

curve2 = rs.AddCurve(corners1)

rs.JoinCurves(curve1,curve2)

All I want to do is join the 2 curves to get a single closed curve but I end up with this error-

Message: len() of unsized object

Traceback:
  line 2070, in JoinCurves, "C:\Users\telfers\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\curve.py"
  line 18, in <module>, "C:\Users\telfers\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\samples\Interp_curve.py"

Hi,

You need to add it as an array

import rhinoscriptsyntax as rs

c1 = (0,-70,40)
c2 = (76,-70,40)
c3 = (76,70,40)
c4 = (0,70,40)

corners = (c1,c2,c3)
corners1 = (c3,c4,c1)

curve1 = rs.AddPolyline(corners)

curve2 = rs.AddCurve(corners1)

curves = {curve1, curve2}

rs.JoinCurves(curves, delete_input=True)

Brilliant, thanks for the fast reply!

Can also be

rs.JoinCurves([curve1,curve2], delete_input=True)

–Mitch