Random Line on Points

hi everyone , I recently started using grasshopper and I can not generate a line of 22 meters through points to generate a random pattern
Tree Rh6.3dm (173.5 KB)
what I try to do is create a random pattern for lights ( 22 meters) of a Christmas tree

first your file is for Rhino 7, bad idea to name it with Rh6 !
Your file is in centimeter, so does the points are at scale. And you still want 22 m of polyline.
A line is straight between 2 points so I imagine you want a polyline.

You could use a script like that to generate a path

Or something simple

exactly , the result is a similar thing but the problem is to use a polyline long maximum 22 meters even not using all the points available

Remake the last script I put, it generate a 22301 cm long polyline, you’ll just have to suppress some of the points to have the good length

christmas tree.gh (13.3 KB)

Another version

christmas tree v2.gh (10.2 KB)