Nobody replied …ok … Looks like I have to use transformation matrix.
I did not want to do Transformation matrix, so was looking for an easy way other than using Grasshopper.
I use grasshopper. But this particular tool must need to be in RhinoCommon.
Why would you want to avoid that?
If I’m not mistaken its fairly easy if you have the 2 planes
1: get the plane of the sectional profile
2: get the frame of the curve at the parameter:
frame = curve.FrameAt(parameter)
3: transform from one plane to the other:
xform = Rhino.Geometry.Transform.PlaneToPlane(initial_plane, final_plane)
scriptcontext.doc.Objects.Transform(object_id, xform, not copy)
I can see Willem has already sorted this out, just a small addition:
The above crv.ClosedCurveOrientation has nothing to do with Grasshopper’s Orient component. It simply returns CurveOrientation (clockwise or counterclockwise) based on curve’s direction. To replicate the Orient component, you have to use transformation matrix.