Circular Shift of a List (Code Block)

I’m trying to develop a Code Block definition to do a circular shift of list elements.

So far i’ve been able to do it successfully in the manual way.
The first part of the IF STATEMENT in the code block definition also works well.
The second part of the definition only produces NULL values, anybody know why?

List Shift.dyn (10.0 KB)

Thanks.

Why not just use a List.ShiftIndicies node?

https://dictionary.dynamobim.com/#/Core/List/Action/ShiftIndices

I believe that you need to set the value for list1 inside your imperative block, but before the for loop starts.

1 Like

Wow, that List.ShiftIndices is cool :sunglasses: solves all my problems. Thanks @JacobSmall

1 Like