Lacing Lists with Nested Lists

I’m having a difficult time finding a method to sort lists similar to the attached image. The idea is to list all levels of a building, and different types of content of the level, then export to excel for reporting, even if the level has no content. In the image, the top list would represent the content being reported, with the nested list being reported content, and the bottom would represent a single list of levels.

Any insight would be much appreciated.

You’ll want to make sure your content from each level keeps its list structure. Then it’s an easy process of combining the lists.

1 Like

Thanks @Nick_Boyts. I was actually trying to pair up a level with an object, so there would be an equal listing of relevant levels and objects. I got close the other night and will post if I get there.

There are some custom nodes that could clean this up but it’s still possible with the core nodes.

This is great! Thank you. I headed down a similar path leveraging indexes, isempty, and count, but wasn’t able to get past it. I haven’t used list.cycle yet. Looking forward to piecing this together. Thanks again.

Looks like a Flatten node with an L2 would have gotten you where you wanted to go in your first example.

@Ryan_C If you don’t mind using a code block …

List.AddItemToFront(a<1>,b<1><2>);

20170824-1

1 Like

Don’t mind at all @Vikram_Subbaiah. Thank you.

1 Like