How to group items that have two parameters that are the same

hello, I am trying to wrap my head around how to group elements by two (or more) parameters. But I am getting confused on how to take an element and compare two of its parameters to all the other similar families in the list. I think I got onto the right track when I found the unique items node, but if I use that then I lose the association to the individual elements. what I want to do is group all elements that have the same Rod Length and Strut Length into individual groups or sub-lists, so that I can assign the same number tag to all the instances where the elements match. Does that make sense? I may have thousands of hangers but ultimately probably only a few dozen different types, and I what Dynamo to help me determine which ones are the same and then give them the same tag value. Please help. Below is what I have done so far, please forgive me I have dynamo 1.3 at work but only 08.2 at home. I dont have access to custom nodes at work either so if you can leave those out in your reply please do so. Thanks!


perhaps you’re over thinking your workflow. Take a look at this:

I’m using different nodes as i’m currently working on SandBox mode but the principle is the same. Use the “==” node to find the lengths with the same value. This will return true for the matching lengths and false for else.

Now you can filter the true values (matching lengths) from your list of elements with the “ListFilterByBollMask” node.

I don’t think you need to group anything after this as you’ll have a list of elements with matching length.

hope this helps!

Hello Renzoji14,
I am sure you are correct that I am probably over thinking things as I tend to do that, but I dont see how what you are doing will work for me. You are taking two parameters from each item and comparing them to the other parameter in the same item. That is not what I am trying to do. I need to take first parameter of the first item and check to see which of all the other items it equals their first parameter. Using your example it would have to compare the 100 to the 300 to the 250 to the 405 to the 810 to the 520 and then do the same for the other parameter then, only if both of the parameters are equal create a separate sublist or group of some kind. Does that make sense? .In the list you have there, there would be no equal items, and everything would have to be in separate groups.I need to figure out a way to do like a custom sort, like how excel does, except in dynamo. I had the idea from yours that I might want to concatenate the two parameters from the same element into a single string, and then compare that to the rest of the items in the list. but when I tried to concatenate in dynamo, it doesnt actually do it. What am I doing wrong? shouldnt it be concatenating the 1.6914… with the 10 from the next list and so on? Why isnt it doing that? Even when I try to do it with “hello” and “world” it cant seem to do it. Why? Please advise. Thanks!

Combine the parameters and look for unique occurrences.

1 Like

Beaker has also nodes to filter elements by parameter value but it has to be installed

1 Like

thats great, but my IT department wont let me download packages.

Thats great! that is exactly what I need! but I dont have the ability to use clockwork but I think i was able to do it with built in nodes. See below. Now how to i add an incremental parameter to this choped list, or how do I modify a parameter of just one of these sublists and give an new incremental number to the next sublist and so on and so on? Thanks!

Wait a minute, these elements that are grouped together dont actually have the same parameter values. What did I do wrong.

You’re using List.Count to get the number of unique items, not the number of times the unique items occur within the list.

Use List.GroupByKey to group the unique items and get that count.