Extrusion of surface on curve with orientation

I want to extrude a plane surface on a curve in python. But the orientation of the extruded object is always the same and does not follow the curve. Can someone help me?

# -*- encoding: utf-8 -*-
import rhinoscriptsyntax as rs
import math
# delete all
objs = rs.AllObjects()
for obj in objs: 
   rs.DeleteObject(obj)
L=5;
surface = rs.AddSrfPt([(0,0,0), (L,0,0), (L,L,0), (0,L,0)])
radius=10;
n=20
m=3;
myLine=[]
for i in range(0,m*n):
    myLine.append((i*1,radius*math.sin(i/n*2.0*math.pi),radius*math.cos(i/n*2.0*math.pi)))

curve = rs.AddPolyline(myLine)
obj = rs.ExtrudeSurface(surface,curve,True)
rs.DeleteObject(curve)

Just like in normal Rhino, Extrude keeps the profile orientation the same as it goes along the curve. What you want is Sweep1Rail. See the rs help for the parameters.

Hello Helvetosaur, thank you very much for your quick answer. But I can’t find any command “Sweep1Rail” in rhinoscript or in other libraries.

https://developer.rhino3d.com/api/RhinoScriptSyntax/#surface-AddSweep1

Thank you very much!