rhino1railSweep Problem

sweep1.rar (614.3 KB)
The attachment file has six chilid files.
testSweep1.3dm is the test 3dm file.
sweep1.png is the result Using Sweep1 command created
Rhino1RailSweep.png is the result using Rhino1RailSweep function creatted,and Rhino1RailSweep.rhp is the correspond plugin.
MyRhinoSweep1.rhp is another test commond using RhinoApp().RunScript.
sweep1.cpp is these two commonds codes.
My problem inclund:
1:Rhino1RailSweep fucntion creat a warping brep.
2:MyRhinoSweep1.rhp will failed.

Looking at your model, the direction of the last circle (curve) does not match the direction of the other two circles. This is why you are getting a “bow-tie” looking surface. Reverse the direction of the last circle and your sweep will work.

When pre-processing cross section curves, you can use the RhinoDoCurveDirectionsMatch() SDK function to make sure they are generally oriented in the same direction.

tanks,dale,but when I use the RhinoDoCurveDirectionsMatch() SDK function ,the second and the last curve are both need Reversed because they are both return false.

and please also help me to see the second question: when I using RhinoApp().RunScript write MyRhinoSweep1.rhp ,will failed