Treating lists

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.

Hi, @OmarElwan welcome them to the community!

List.dyn (12.1 KB)

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

I want to do as this picture:

like this

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


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

1 Like

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

Unfortunately, that is not working like what i need.

Cross lacing??


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.

1 Like

It is working but not the niced code.

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 :slight_smile:

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.

1 Like

Hi @jwroelofs - You can check out my presentation for BILT EU a few years ago: GitHub - Amoursol/dynamoDesignScript: DesignScript workflows for Dynamo :slight_smile: That should be a more gentle introduction.


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>
Design Script’s ambiguous and versatile Replication Guides <2>

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

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.