How to change start and end of the curve(open)

Hi everyone, i faced with the problem - i built a curve and after “subcurving” it and joining with another it changed direction, lets say. If i divide it with points and number them, they will be in the wrong order and i cant connect them properly.
Hope the image is enough for advice

This image is good to say that you use Rhino 5! Not a lot more. You don’t need to share all your script extract what is problematic and internalize data (just some curves).
See here some advices (7.6 KB)
Here it is

You didn’t internalize curves. In order to look if your script works without Rhino just open a new empty file and if a component is orange so no inputs.
I put some curves and I get problem in numerotations mainly due to the fact that subcurve cannot be joined with others. Si if you have 2 main curves and you want 2 outputs you get 4 outputs.

I internalized and put into the new project. Result was the same.Anyway, here is the whole project Сидение в секционном виде (55.5 KB)
Im sorry for taking your time. Here you will see that curves including subcurve joined into one perfectly. I put point list to see the problem, thanks in advance

Here a solution to orient numbers/points. Not bullet proof.

Сидение в секционном виде (60.2 KB)

Thank you!