How to add null items to a list?

Hello, I am trying to add null items to multiple lists by using the component “Insert Items”. Basically what I am doing is adding null items to make the length of the lists 4, but I can’t insert nulls where I want with the component insert items.


Thanks.

Insert item uses index (it seems) always referring to the original starting list.
And you have wrap (W) set to true!
i=1 is interpreted as “put this item to the second place”
i=2 is interpreted as “put this item to the first place” (because the original list length is 1 and wrap=true)
i=3 is interpreted as “put this item to the second place” (because the original list length is 1 and wrap=true)

You can solve by setting your second branch as {1, 1, 1} … (3 times index 1)

Or like this:
2020-03-21 21_14_13-Grasshopper - hex-pixels4_
By turning Wrap=false it have to increase the list length to the biggest index you give… and fills everything with nulls.

1 Like