Separate path list into lists of same values

Hei, is there a way to put all paths with same values into separate list and also get count paths?

Thanks
.Mohamad
Rhino Trainee

Can you write down the data you’d like to end up with?

You’ll probably end up formatting your lists as individual pieces of text so they can be compared. I sense a lot of Set components in your immediate future, but since I don’t fully understand what the end-goal is I cannot yet propose a specific approach.

Yes,

Actually the values in paths represent width and height value of rectangles.

IF iam having this kind of list
Path 1
0- 0.15
1- 0.4

Path 2
0- 0.15
1- 0.6

How can split the paths with same values into different lists ? because what i want to do is that all rectangles with same values can have same multileader which i want to implement it .
So i think , if i have all paths separated to their own lists, then it is easier to achieve what i want.

So given input data in this form:

\text{path = }\{0;0\}, \text{values = } (0.15, 0.4)
\text{path = }\{0;1\}, \text{values = } (0.15, 0.6)
\text{path = }\{0;2\}, \text{values = } (0.15, 0.6)
\text{path = }\{0;3\}, \text{values = } (0.15, 0.4)
\text{path = }\{0;4\}, \text{values = } (0.15, 0.6)

you want to end up with two separate trees, the first one looking like this:

\text{path = }\{0;0\}, \text{values = } (0.15, 0.4)
\text{path = }\{0;3\}, \text{values = } (0.15, 0.4)

and the second like this:
\text{path = }\{0;1\}, \text{values = } (0.15, 0.6)
\text{path = }\{0;2\}, \text{values = } (0.15, 0.6)
\text{path = }\{0;4\}, \text{values = } (0.15, 0.6)

Yes, exactly!

Since you cannot compare lists in Grasshopper, you’ll have to convert each list of numbers into individual values which can be compared. I recommend text, because that allows you to store numeric values in a lossless fashion. The Text Join component can help with this.

In fact I’d recommend just doing that to your width+height pairs, since these two numbers are basically part of the same ‘thing’. If you combine them in this way it’ll be much easier to manage your data. But that’s something you can decide later.

My initial approach would be:

  1. Convert your number lists into text.
  2. Create a Set out of this text so you can categorise the various dimension pairs.
  3. Distribute the pairs based on what category they fall into.
  4. Reconstruct your number pairs from the intermediate text.

data filtering.gh (35.3 KB)

There are many other ways of doing this, and you may need to resort to those if you really need your tree paths to be the same before and after.

Good Solution David, Thanks a lot!

Regards!