Connect lists. A misunderstanding with trees

Dear Friends,

I am working on a project to create a glass window with different colors and I am stuck organizing the different parts for water cutting. I believe the reason is that I have some kind of basic misunderstood with what are date trees and how to use them.

What I want to do is this: I have a list of breps with a specific color, area and Id number and I want to move them into a matrix of rectangles to print them. Each of them has to include the id number, area and a color sample.

The problem is that in the process the list of breps and the list of colors end in a different order and they don’t match anymore. My doubts are:

  • How can I keep them connected in the process?
  • Can I have a tree with lists of different components (i.e. a tree with breps, text objects, materials) that keeps all the information together while I am moving or scaling the breps?
  • In case this is something basic that I should have known by now. Could you suggest me resources to learn more about it?

I added some pictures and my files in case it helps to understand me better.
Thank you very much.



ordering and tress.3dm (7.4 MB)
ordering_tress.gh (236.8 KB)

You are sorting your geometry and colors in different places:

Add another input and output parameter to the Sort List where you are sorting your geometry by zooming in until you see the plus sign at the bottom and clicking it:

Connect your color to the Sort List component input & output added above as shown:

I think this should fix your problem:

ordering_tress_211104a.gh (235.9 KB)

-Kevin

2 Likes

I’m so glad I saw this, I was about to start making diagrams too :rofl:

Thank you, Kevin. I didn’t know I could sort more than one list at once. Anyway, is possible to have trees with different info? In python you can have a list with different info inside, I was wondering if it is possible to do the same in grasshopper. Like: [a,[1,2,3],b,c,[1.1,1.2,1.3]]

Sure, you can combine different types of data in trees and lists.

-Kevin