Assign param value by unique param value combination

Hi,

Hope the text is not too long.

I am trying to do the following.

-obtain all family parameters that are associated with all elements in my revit model
-(my model has 231 elements)
-(a total of 64 parameters are associated with these elements)
-now i want to obtain the parameter values of all 64 parameters of all elements. this results in a list of 231 sublists of 64 values
-now i want to filter out only the unique combinations of these 64 values, by list.unique.items. This results in a list with 171 sublists with unique combinations of 64 parameters.
-furthermore i have created a list with numbers 1-171 (based on the number of unique parameter value combinations)

now, the missing link to what i am trying to do:

-i want to assign a number 1-171 to each element based on its combination of parameter values.
-there are 171 unique parameter value combinations, so elements which have exactly the same values should get the same number 1-171
-i have created a project parameter called ‘Unique Number’ for this

I dont see how to do this I dont see how to [step 1] select the elements by their unique parameter value sets and [step 2] assigning the numbers 1-171 to them.

-I know i can do step [2] with Element.SetParameterByName node.
-But how can i do step [1], in a smart way ? And how to combine the two operations in the right way, with regards to lacing / hierarchy /

Can you give my a hint for this? Many thanks in advance! Ill attach revit project + .dyn file.

name objects by unique parameter values.dyn (8.7 KB)

https://we.tl/nnjGo5rEt7

try to use GroupByKey node … the list is from SetParameter node, The key from ListUniqueItems
now you have the same parameters value in same groupyou can set the same number to their parameter

I am thinking about the ‘equals’ node.

The idea is to check if a sublist is exactly equal to 1 of 171 unique lists, and if equal … return index number 1-171, and then assign this number 1-171.

So I would get 231 elements x 171 checks = 39501 equality checks.

Thanks @khuzaimah.ElecEng. Ill give that a try!

Using the GroupByKey as suggested by @khuzaimah.ElecEng does not work for me. I do not understand the logic of how to do it.

But somehow i answered my own question by using ‘if equal return index’. Works fine! :slight_smile:

1 Like