# Color by width. List division problem

Hello!

I have a list of 93 land plots. Across them, there is a power line with a security zone divided in 110 segments of different width. There are 13 different values for the width, which are distributed through the 110 segments. When you make an intersection between the plots and the segments, you get 210 fragments. I need to put every land plot with the corresponding fragments of the security zone in a plan of its own with a color for every different width.

Here is the catch.
As you can see in the picture, the order of the fragments is correct until I reach land plot nÂ° 60. Then some of them get mixed. I donâ€™t know why this this happens or how to prevent it. I can get the order to the correct set, but then I canâ€™t group them as it should to give them the right color and at the same time put them in a plan inside the corresponding plot.

In Plot 60, there should go item 138 and item 140/ In plot 61 There should go Item 139 and Item 141 so the colors could be in proper order.

In plot 63 there should go items 144 and 147/ in plot 64 there should go items 145,146 and 148.

List order.gh (139.3 KB)

You must preserve your tree as much as possible, collision test also help with computation time, then is pure data managment with the help of the right indeces.

List order_ev.gh (143.9 KB)

1 Like

Wow! Thanks Erick

Really impressive. Beatiful and simple

Iâ€™m trying to understand how it works, though. How did you get to this? Why did you choose to use â€ślongest listâ€ť?

Thanks again

With this pre-rationalization we already have 207 items sorted in 110 branches before intersection, resulting 210 splitted segments in total. For example, branch 9 shatter in two parts but their indeces is the same, so we repeat it (Longest List). We have to mantein these 210 items to regroup them by their index later.

Hi Erik,

As you can see in the picture, there is a little fragment (169) that should be in the same group as 168 in the land nÂ°75. But is not. Its is assigned to 76.

When you select Branch 77 it shows what should be 76 and so on until number 80

In NÂ°80 It shows 79 and 80 together.

Iâ€™ve havenÂ´t change anything in your definition. I just added the Branch component and a panel.

I have tried to correct this but obviously iÂ´m missing something

Orden fragmentos franja seguridad OK.gh (142.7 KB)

quick fix with a safe region intersection.

Orden fragmentos franja seguridad OK.gh (151.1 KB)

1 Like

Definitely I need to master that one!
I still donâ€™t understand very well how â€śCsetâ€ť and the one next to it really work. Why, some times it is used twice in the same operation.

Thank you very, very much!!!