Reduce levels of list

Hi There

Here there is a 1 main list (As shown in blue circle) in which there are 18 lists (As shown in red circle). There are 6 lists (As shown in green circle) in each of 18 sub lists.

Now here in output i want directly those 6 lists & eliminate those 18 lists.

0 List-Main List
0 List - Sub List
0 Surface
1 Surface
2 Surface
3 Surface
4 Surface
5 Surface
1 List - SubList
0 Surface
1 Surface
2 Surface
3 Surface
4 Surface
5 Surface

103

I’m not exactly sure on what basis you do or don’t want those lists but couldn’t List.GetItemAtIndex do the job?

If you are just after the list of surfaces then using the “Use Levels” in the node downstream would give you that access?
Or use the List.GetItemAtIndex as @PauLtus suggested.

Hi Guys thanks for response.

I will clarify what i want & what am i getting right now.

As shown in blue circle there are 2 main list 0 & 1 containing 19 & 16 sublists respectively.

Now when i go for surface 1 output, i get all 35 surfaces in single list as shown in circle green, but i want separate list of surfaces for separate main lists as it is shown in red circle.

Please note here data shown in red circle is just for example to explain what i am looking for.

I could be wrong

What is suggested should very well do the job, just make sure to ask for the right list at the right level.
image

Hi Guys

Thanks for suggestions. But here as per your suggestions i am getting all surfaces of all lists whereas i am looking to get specific surface of all lists. Please see example in green circle. Here i am trying to get surface 1 of all sub-lists.

Also note i want surface 1 main list wise, under main list 0, surface 1 of all 18 sub list & under main list 1, surface 1 of all 16 sub-lists.

I’m still not sure what exact list you want to extract but have a look here:

Hi Jonathan

Thanks mate…i almost got what i want. Only a little change i want is i want separate list wise output as shown in green circle. Here output is same as per your suggestion (Shown in red circle) just it is separated list wise.

Again Manny thanks…cheers…!

image
I realize now this input is what you have originally… Think there is some minor changes from 1.3 to 2.0 (i’m on 1.3). You could use a “list.Chop” with length 1 after your get your items at index? :slight_smile:
image

1 Like