Getting even numbers from index

hi guys I’m a new learner of dynamo


i’m having problem to get even numbers from index
I mean…
I want to have the : list of numbers from (get.item.a.tindex_level4)
and then pick odd numbers from the index

so i can get the points of odd numbers

can i do that?

You need to get all of the index numbers first. Then you can filter out the odd ones and use them with GetItemAtIndex. A shortcut would actually be to get the list count (c) for each sublist and then create a sequence from 1 to c by 2, effectively getting you all the odd indices in that sublist.

thank you for your advice NIck
I did what you said and I can’t get the results,


b

are these lists right for what i need to get?

Thanks.

Your list level isn’t right. You’re getting the count of each object. You need to get the count of each list. Try list level @L2.

Your sequence isn’t quite right either as that node uses an amount instead of an end. Use a codeblock with 1..c..2.

Are you attempting to extract every alternate item?
If you are, you could do that like this
take
If you need items at even indices, change offset to 1

3 Likes

Hi Vikram
Thank you for your reply
I got the results what I want

Sir, can you help me one more problem?


Here, i want the cubids to be parallel with surface orientation

But it works like this