Avoiding repetition

I’m working on this script part that I need to repeat it several times, changing the X variable from 0 to 17, as you can see on the image below.

Is there a way that I can avoid this repeating?

Use a list. If it’s not that obvious because we can’t see your cluster, how about attaching a file?

Replace the slider with a Series for the ‘x’ input.

series
series2

Auto-Nesting 2 - Rhino 6.gh (37.4 KB)