Python script advice

I’m new to python programming and currently having a few issues in getting this script to work. Been fixing errors, but then it leads to other errors.

The problem I am trying to solve is that I want to take a input curve and split it into separate lines of a specified length with a certain gap between them.

The original curve is a spline and the new curves need to be straight so that I can host elements on them.

I was wondering if anyone has some advice on where I’m going wrong, I know I’m probably making this a lot more difficult than it needs to be.

Many thanks


Is there a reason why you wish to use Python and not dynamo?

Mainly because I’m learning python and want to have some practical application for it.

It also makes sense to group a lot of this together rather than having lots of dynamo nodes. If you were to use just dynamo how would you loop through this? The loop while node seems pretty limited.

Well depending on the final purpose I’d probably use PointsAtEqualChordLength because that gives you (surprise surprise) lines with the same length.


Many thanks for your help Viktor.

Looks great, but I was looking to start from one end of the curve and generate out as many of these lines of specified length (2500 with 10 gap) as I can until I run out of line.

Ill have another play and post if I work out the solution.

Thanks again

I feel like I’m so close to getting this to work. I run this and it seem to go into a infinite loop.

Any advice would be amazing.