Brep.CreateFromSweep() not work correct

I develop software with VB and Rhinocommon. If I try to create the sweep with this code

code.cs (1.6 KB)
and model
su.3dm (46.7 KB)
,but get erroneous result
企业微信截图_16679657849986

Hello.
The seam point of the rail curve and the section curve are far apart.

crvseam

If you want to fix it in Rhino, you can use the [CrvSeam] command.

If you want to do this in RhinoCommon, you can use the ChangeClosedCurveSeam method.

thanks,is useful.I have set seam point,but my result is different with expected which is created by command[sweep1]
image
su.3dm (196.8 KB)

The result is indeed as you say.

I checked the SweepOneRail class, but I can’t seem to find such a setting.

Perhaps I think the Sweep1 command is performing its own modification that is not in RhinoCommon…

Thank you