# Treating lists

**URL:** <https://forum.dynamobim.com/t/treating-lists/65338>\
**Category:** Lists-Logic\
**Created:** [June 21, 2021, 2:06am UTC](https://forum.dynamobim.com/t/treating-lists/65338 "2021-06-21T02:06:34Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![OmarElwan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/omarelwan/32/118824_2.png) [@OmarElwan](https://forum.dynamobim.com/u/OmarElwan)\
**Post date:** [June 21, 2021, 2:06am UTC](https://forum.dynamobim.com/t/treating-lists/65338/1 "2021-06-21T02:06:35Z")

</div>

Hi all,  
This is a simple example of what i want to do.  
I want to add each item at level L1 in the upper list to the corresponding list at level L2 in the bottom list.  
i.e: all the items next to the red marks should be added to the list surrounded by the blue box. And all items next to the green marks should be added to the list surrounded by the purple box and so on.  
This should result in a new nested list with a new L5.

How can i do this?

Thanks in advance.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/9/d948187823352e3fefe9152e15233a7eca985643.png)

---

<div class="post-metadata">

**Author:** ![\_Vijay](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/_vijay/32/91307_2.png) [@\_Vijay](https://forum.dynamobim.com/u/_Vijay)\
**Post date:** [June 21, 2021, 2:29am UTC](https://forum.dynamobim.com/t/treating-lists/65338/2 "2021-06-21T02:29:40Z")

</div>

Hi, @OmarElwan welcome them to the community!

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/3/23f122ec867344bee5641dbf270e464966d26ce8.png)

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/8/f86c4ae371e0e3747e019974d11d92d7a89fc26c.png)

[List.dyn](https://forum.dynamobim.com/uploads/short-url/cf7PzZfBZFb9EwEpztpJui4sqXg.dyn) (12.1 KB)

---

<div class="post-metadata">

**Author:** ![OmarElwan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/omarelwan/32/118824_2.png) [@OmarElwan](https://forum.dynamobim.com/u/OmarElwan)\
**Post date:** [June 21, 2021, 2:50am UTC](https://forum.dynamobim.com/t/treating-lists/65338/3 "2021-06-21T02:50:38Z")

</div>

Thanks @_Vijay for your reply but i dont think you understood what i want.

I want to do as this picture:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/9/6989c6e780b6fe7bed96465fec33d4348c402b48.png)

---

<div class="post-metadata">

**Author:** ![\_Vijay](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/_vijay/32/91307_2.png) [@\_Vijay](https://forum.dynamobim.com/u/_Vijay)\
**Post date:** [June 21, 2021, 2:57am UTC](https://forum.dynamobim.com/t/treating-lists/65338/4 "2021-06-21T02:57:00Z")

</div>

like this

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/2/a29de8d4211a29215eea259180c2c60cc208b29a.png)

---

<div class="post-metadata">

**Author:** ![\_Vijay](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/_vijay/32/91307_2.png) [@\_Vijay](https://forum.dynamobim.com/u/_Vijay)\
**Post date:** [June 21, 2021, 2:59am UTC](https://forum.dynamobim.com/t/treating-lists/65338/5 "2021-06-21T02:59:08Z")

</div>

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/2/2275d541db15447359bd15b11a87edde04beca2e.png)

---

<div class="post-metadata">

**Author:** ![\_Vijay](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/_vijay/32/91307_2.png) [@\_Vijay](https://forum.dynamobim.com/u/_Vijay)\
**Post date:** [June 21, 2021, 2:59am UTC](https://forum.dynamobim.com/t/treating-lists/65338/6 "2021-06-21T02:59:49Z")

</div>

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/4/a4a09f878a451774101f90e02e8fd724d5a1935c.png)

---

<div class="post-metadata">

**Author:** ![OmarElwan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/omarelwan/32/118824_2.png) [@OmarElwan](https://forum.dynamobim.com/u/OmarElwan)\
**Post date:** [June 21, 2021, 3:27am UTC](https://forum.dynamobim.com/t/treating-lists/65338/8 "2021-06-21T03:27:23Z")

</div>

![11](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/2/e244efb316d1f3fae90af5cf87ca1c95e3bf73a0.jpeg)

---

<div class="post-metadata">

**Author:** ![OmarElwan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/omarelwan/32/118824_2.png) [@OmarElwan](https://forum.dynamobim.com/u/OmarElwan)\
**Post date:** [June 21, 2021, 3:27am UTC](https://forum.dynamobim.com/t/treating-lists/65338/9 "2021-06-21T03:27:53Z")

</div>

![12](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/7/6704fe4ac9332a42e876841365789d90e4d94446.jpeg)

---

<div class="post-metadata">

**Author:** ![Vikram\_Subbaiah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vikram_subbaiah/32/50797_2.png) [@Vikram\_Subbaiah](https://forum.dynamobim.com/u/Vikram_Subbaiah)\
**Post date:** [June 21, 2021, 4:10am UTC](https://forum.dynamobim.com/t/treating-lists/65338/10 "2021-06-21T04:10:49Z")

</div>

`a<1><2><3> + b<1><2>;`

 ![lists](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/0/00b1509388439477f8af4c7a078ee30433b98e3e.png)

---

<div class="post-metadata">

**Author:** ![OmarElwan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/omarelwan/32/118824_2.png) [@OmarElwan](https://forum.dynamobim.com/u/OmarElwan)\
**Post date:** [June 21, 2021, 4:53am UTC](https://forum.dynamobim.com/t/treating-lists/65338/11 "2021-06-21T04:53:00Z")

</div>

very thank you. Thats exactly what i need.  
but can you do that with nodes? 😃  
I am still a beginner.  
sorry for that.

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [June 21, 2021, 1:43pm UTC](https://forum.dynamobim.com/t/treating-lists/65338/12 "2021-06-21T13:43:43Z")

</div>

A + node should do the trick. Use @L1 and @L2 for the two inputs, and longest lacing.

---

<div class="post-metadata">

**Author:** ![OmarElwan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/omarelwan/32/118824_2.png) [@OmarElwan](https://forum.dynamobim.com/u/OmarElwan)\
**Post date:** [June 21, 2021, 5:08pm UTC](https://forum.dynamobim.com/t/treating-lists/65338/13 "2021-06-21T17:08:11Z")

</div>

Unfortunately, that is not working like what i need.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/5/8573b943a05409b9a4397be1709cc790ae8cc803.png)

---

<div class="post-metadata">

**Author:** ![jwroelofs](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jwroelofs/32/55712_2.png) [@jwroelofs](https://forum.dynamobim.com/u/jwroelofs)\
**Post date:** [June 21, 2021, 5:17pm UTC](https://forum.dynamobim.com/t/treating-lists/65338/14 "2021-06-21T17:17:16Z")

</div>

Cross lacing??

---

<div class="post-metadata">

**Author:** ![OmarElwan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/omarelwan/32/118824_2.png) [@OmarElwan](https://forum.dynamobim.com/u/OmarElwan)\
**Post date:** [June 21, 2021, 5:49pm UTC](https://forum.dynamobim.com/t/treating-lists/65338/15 "2021-06-21T17:49:08Z")

</div>

😕

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/c/cc69789da61f8df882fc7e34c32c46972bca7610.png)

---

<div class="post-metadata">

**Author:** ![jwroelofs](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jwroelofs/32/55712_2.png) [@jwroelofs](https://forum.dynamobim.com/u/jwroelofs)\
**Post date:** [June 21, 2021, 6:07pm UTC](https://forum.dynamobim.com/t/treating-lists/65338/16 "2021-06-21T18:07:57Z")

</div>

Ik am in the phone. So i can not check before. Try Both lists @1 instead of @1 and @2. Good Luck.

Crossprodukt by sublist.

---

<div class="post-metadata">

**Author:** ![jwroelofs](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jwroelofs/32/55712_2.png) [@jwroelofs](https://forum.dynamobim.com/u/jwroelofs)\
**Post date:** [June 22, 2021, 12:32pm UTC](https://forum.dynamobim.com/t/treating-lists/65338/17 "2021-06-22T12:32:52Z")

</div>

![List_list_2021-06-22_02-30-55](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/0/802a2526befe37a71494dca092f7a79e8d92d03f.png)

It is working but not the niced code.

---

<div class="post-metadata">

**Author:** ![OmarElwan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/omarelwan/32/118824_2.png) [@OmarElwan](https://forum.dynamobim.com/u/OmarElwan)\
**Post date:** [June 22, 2021, 12:57pm UTC](https://forum.dynamobim.com/t/treating-lists/65338/18 "2021-06-22T12:57:33Z")

</div>

yeah its working but the problem is that we will have to distribute the lists manually.  
Imagine if we have hundreds of lists?  
It will be very hard to use such method.  
But thanks very much for your trials. I really appreciate that 🙂

---

<div class="post-metadata">

**Author:** ![jwroelofs](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jwroelofs/32/55712_2.png) [@jwroelofs](https://forum.dynamobim.com/u/jwroelofs)\
**Post date:** [June 22, 2021, 12:57pm UTC](https://forum.dynamobim.com/t/treating-lists/65338/19 "2021-06-22T12:57:33Z")

</div>

Great coding. Do you have some practical examples (easier) I try to find your in de the DesignscriptGuide but love to hear if there is some easier reading.

---

<div class="post-metadata">

**Author:** ![solamour](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/solamour/32/153516_2.png) [@solamour](https://forum.dynamobim.com/u/solamour)\
**Post date:** [June 22, 2021, 1:27pm UTC](https://forum.dynamobim.com/t/treating-lists/65338/20 "2021-06-22T13:27:49Z")

</div>

Hi @jwroelofs - You can check out my presentation for BILT EU a few years ago: [GitHub - Amoursol/dynamoDesignScript: DesignScript workflows for Dynamo](https://github.com/Amoursol/dynamoDesignScript) 🙂 That should be a more gentle introduction.

---

<div class="post-metadata">

**Author:** ![Vikram\_Subbaiah](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vikram_subbaiah/32/50797_2.png) [@Vikram\_Subbaiah](https://forum.dynamobim.com/u/Vikram_Subbaiah)\
**Post date:** [June 22, 2021, 2:23pm UTC](https://forum.dynamobim.com/t/treating-lists/65338/21 "2021-06-22T14:23:52Z")

</div>

> [@jwroelofs](#):
>
> I try to find your in de the DesignscriptGuide but love to hear if there is some easier reading.

The aspect of Design Script that I’ve used here and which has always impressed me are the _Replication Guides_  
I’ve explained my understanding of replication guides in these two articles  
[Design Script’s ambiguous and versatile Replication Guides \<1\>](https://www.linkedin.com/pulse/design-scripts-ambiguous-versatile-replication-guides-vikram-subbaiah?trk=public_profile_article_view)  
[Design Script’s ambiguous and versatile Replication Guides \<2\>](https://www.linkedin.com/pulse/design-scripts-ambiguous-versatile-replication-guides-vikram-subbaiah-1c?trk=public_profile_article_view)

Once you grasp the working of Replication guides list management becomes intuitive and fun.

> [@OmarElwan](#):
>
> but can you do that with nodes? 😃  
> I am still a beginner.

Some things are far less complicated with code.  
I’d advise you not to shy away from code, especially the one liners.  
Hope the links to the articles helps you begin to understand the code.
