# Combining lists at a certain level

**URL:** <https://forum.dynamobim.com/t/combining-lists-at-a-certain-level/8683>\
**Category:** Lists-Logic\
**Tags:** revit\
**Created:** [January 6, 2017, 5:58pm UTC](https://forum.dynamobim.com/t/combining-lists-at-a-certain-level/8683 "2017-01-06T17:58:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![babysatch](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@babysatch](https://forum.dynamobim.com/u/babysatch)\
**Post date:** [January 6, 2017, 5:58pm UTC](https://forum.dynamobim.com/t/combining-lists-at-a-certain-level/8683/1 "2017-01-06T17:58:52Z")

</div>

Hello everyone,

I have four different rectangles as polycurves. Extracting their curves, start and endpoints consequently, I have the following code:

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/2/425e80a72da3e23609cc5d59c17789454822c0f6.png)

I would like to combine the start and endpoints without flattening such that the list @Level1 have 8 elements, namely all startpoints and endpoints of every rectangle beside each other without loosing the level structure.

On of ways I thought of is a list combination by list.join which returns null’s, which I actually cannot understand why. I hope I do it exactly as described [here](https://landarchbim.com/2016/01/13/managing-lists-in-dynamo/).

Does anybody know how it could be possible?

I would be grateful of your help.

---

<div class="post-metadata">

**Author:** ![Yna\_Db](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/yna_db/32/30641_2.png) [@Yna\_Db](https://forum.dynamobim.com/u/Yna_Db)\
**Post date:** [January 6, 2017, 7:30pm UTC](https://forum.dynamobim.com/t/combining-lists-at-a-certain-level/8683/2 "2017-01-06T19:30:15Z")

</div>

Is this what you need?

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/6/764083609c16a15076b706ac50d152a717bdb02f.JPG)

---

<div class="post-metadata">

**Author:** ![babysatch](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@babysatch](https://forum.dynamobim.com/u/babysatch)\
**Post date:** [January 6, 2017, 7:45pm UTC](https://forum.dynamobim.com/t/combining-lists-at-a-certain-level/8683/3 "2017-01-06T19:45:46Z")

</div>

…thank you for your reply. actually this is my case:

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/6/3680c0de13b081698b5a59eb0eca31ab70510089.png)

which doesn’t work also with code blocks because of the 4th level.  
What I want to do is to have a four level list like this as outcome of the two lists above

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/7/078b51dee1514b804f615873e2a24d8815fc45fa.png)

…

---

<div class="post-metadata">

**Author:** ![Yna\_Db](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/yna_db/32/30641_2.png) [@Yna\_Db](https://forum.dynamobim.com/u/Yna_Db)\
**Post date:** [January 6, 2017, 8:06pm UTC](https://forum.dynamobim.com/t/combining-lists-at-a-certain-level/8683/4 "2017-01-06T20:06:21Z")

</div>

Then you could use a _SetUnion_ node instead of _List.Combine_ / _List.Join_  
 ![](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex022/uploads/dynamobim/original/3X/2/7/27fc3b5f037364f5d41be9974171bec8d7a71d8d.JPG)  
Does it solve your issue?

---

<div class="post-metadata">

**Author:** ![babysatch](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@babysatch](https://forum.dynamobim.com/u/babysatch)\
**Post date:** [January 6, 2017, 10:47pm UTC](https://forum.dynamobim.com/t/combining-lists-at-a-certain-level/8683/5 "2017-01-06T22:47:24Z")

</div>

Hi Yna\_Db

thank you for your reply. Your solution works. Thank you.
