Issue with TakeEveryNthItem

Hi All

 

I am trying to understand the TakeEveryNthem but without success. My aim is to place a adaptive component with 4 points. My list of point is listed, so that I need point [0+1+6+7] to create the component I wish for.

When I use TakeEveryNthem with the offset of 1 and N of 2 I get point number 0+2+4+6 and so on.

When I use TakeEveryNthem with the offset of 2 and N of 2 I get point number 1+3+5+7 and so on.

When I use TakeEveryNthem with the offset of 7 and N of 2 I get point number 0+2+4+6 and so on.

When I use TakeEveryNthem with the offset of 8 and N of 2 I get point number 1+3+5+7 and so on.

What am I doing wrong here?

Palle

You need to use the “GetItemAtIndex” node. The TakeEveryNthItem node gets items on a repeating pattern. GetItemAtIndex gets the Nth item from every sublist. So in your case, the TakeEveryNthItem is getting every 2nd number. The offset shifts the list by the remainder of the offset number you supplied (1,2,7,8) divided by your N value (2).

This should work for you:

Getitematindex