Function definition and loop cycle



I’m trying to extract a combination of two elements in a list that are sequencing.

I have create my list for a test and used code-block script testing with different numbers and it does work, but when I put the same code inside a Function definition code-block I get something I cannot understand. I have also tried with a Function definition that use a cycle for (the same result I got white a “while” loop). Any idea why I’m getting these null lists?

The final aim of the exercise is to get elements (points) two by two from several paths divided in “n” elements so that I could use an adaptive component to create a mesh.

coupleofelements.dyn (16.5 KB)



How about something like this ?


Wow, this you made it look so easy and simple: as usual I made it too complex and then I got stucked against a wall…I will give it a try in the main routine and test it.
Thank you for the tip!