Curve from line

Curve.PointAtParameter(c,0) = StartPoint
Curve.PointAtParameter(c,1) = EndPoint

line = Line.ByStartAndEndPoint(StartPoint,EndPoint)