List B as sublist of list A

Hello everyone !
I am also pretty new to Dynamo, and I guess what I am trying to do should be very simple, but I cant make it work.

I have list A and list B and I want List B (and its sublists) to be the sublist of list A. it should be something like this:


  • B1a
  • B1b
  • B1x
  • B2a
  • B2b
  • B2x

Can someone help me out?

Hi Kalle,

You can just use “List.LastItem” node with lacing to longest.

Something like this?

@ Kulkul: how can I combine list A and list B with the “List.LastItem”-node?
@ Vikram_Subbaiah: Yes, something like this but for now the Input is little different…

So, I have a List A with Wall-IDs. The Walls are divided in multiple parts, so the same ID appears there multiple times. Then I have List B with represents the length of each part of the Walls.

The Goal is, to make a List with the Wall-IDs and assign the correct length as a sublist to each Wall.

Wall 1 (part 1)

  • Length 1
    Wall 1 (part 2)
  • Length 2
    Wall 1 (part 3)
  • Length 3
    Wall 2 (part 1)
  • Length 4
    Wall 3 (part 1)
  • Length 5
    Wall 4 (part 1)
  • Length 6
    Wall 4 (Part 2)
  • Length 7

Then I want to sort all Wall-IDs and have all length of the same wall under each other.

Wall 1

  • Length 1
  • Length 2
  • Length 3
    Wall 2
  • Length 4
    Wall 3
  • Length 5
    Wall 4
  • Length 6
  • Length 7

Is this what you are after? I have created 2 possible outputs depending on your requirements.

this is exactly what i was looking for !
Thanks a lot