Turn Splines curves into straight Spline paths?

I think I find a solution without manually setting the point type. I start a loop for setting point type before the loop for add spline mesh component.


And the loop starts from 0 and ends at last point index - 2.