Numbering of dynamo parts

Hello community,

I am turning to you today because I have a problem.
I would like to make a numbering of the parts thanks to a script but when I launch it, it numbers everything, no problem, but it does not follow the spline that I have set up.
What did I forget in my script?

Thanks to you for your help :slight_smile: