Take varying indices from sublist

G’day Dynamo users.

In my current script i want to take varying amounts (indices) from a bigger sublist. As the example beneath shows i want to take every index 18…20 from list 1 level 0. And every index 18…21 from list 2 level 0.

Somehow i can’t get the list.getitematindex to work. What should i do?

Thanks in advance!

Hello!

Try using a code block like so:

And of course, you can get multiple list structures from single code block and get different values:

I hope it helps.

@Dynamo_Noob, Tried this but it didn’t work.
Maybe i wasn’t that clear in what i exactly wanted so let me try again.

I don’t want the lists to combine. i need the seperation of 3 lists for future use of the script. Therefore i need to take a varying amount of indices.

Hope this image gives more clarity

This is what i’m looking for but i.m.o this should be doable in a single list.getitematindex node, shouldn’t it?


sublists.dyn (4.7 KB)

List.GetItemAtIndex(lst<1><2>,ind<1>);

2 Likes