# Assign param value by unique param value combination

**URL:** <https://forum.dynamobim.com/t/assign-param-value-by-unique-param-value-combination/18619>\
**Category:** Lists-Logic\
**Tags:** revit\
**Created:** [January 30, 2018, 10:41am UTC](https://forum.dynamobim.com/t/assign-param-value-by-unique-param-value-combination/18619 "2018-01-30T10:41:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jnoordzij](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jnoordzij/32/32419_2.png) [@jnoordzij](https://forum.dynamobim.com/u/jnoordzij)\
**Post date:** [January 30, 2018, 10:41am UTC](https://forum.dynamobim.com/t/assign-param-value-by-unique-param-value-combination/18619/1 "2018-01-30T10:41:52Z")

</div>

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.

 ![20180130-03](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/c/ec9170ff5d61a2e68af3543b54355997ebcd4021.JPG)

 ![20180130-04](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/3/831adbe9ba2e800466f99b9fe2627507c8cb4d24.JPG)

[name objects by unique parameter values.dyn](https://forum.dynamobim.com/uploads/short-url/f9CTWK8od1eVFct5r32F3qd0vIg.dyn) (8.7 KB)

[https://we.tl/nnjGo5rEt7](https://we.tl/nnjGo5rEt7)

---

<div class="post-metadata">

**Author:** ![khuzaimah.ElecEng](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/khuzaimah.eleceng/32/92768_2.png) [@khuzaimah.ElecEng](https://forum.dynamobim.com/u/khuzaimah.ElecEng)\
**Post date:** [January 30, 2018, 10:50am UTC](https://forum.dynamobim.com/t/assign-param-value-by-unique-param-value-combination/18619/2 "2018-01-30T10:50:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jnoordzij](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jnoordzij/32/32419_2.png) [@jnoordzij](https://forum.dynamobim.com/u/jnoordzij)\
**Post date:** [January 30, 2018, 10:52am UTC](https://forum.dynamobim.com/t/assign-param-value-by-unique-param-value-combination/18619/3 "2018-01-30T10:52:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jnoordzij](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jnoordzij/32/32419_2.png) [@jnoordzij](https://forum.dynamobim.com/u/jnoordzij)\
**Post date:** [January 30, 2018, 10:53am UTC](https://forum.dynamobim.com/t/assign-param-value-by-unique-param-value-combination/18619/4 "2018-01-30T10:53:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jnoordzij](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jnoordzij/32/32419_2.png) [@jnoordzij](https://forum.dynamobim.com/u/jnoordzij)\
**Post date:** [January 30, 2018, 11:14am UTC](https://forum.dynamobim.com/t/assign-param-value-by-unique-param-value-combination/18619/5 "2018-01-30T11:14:20Z")

</div>

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! 🙂

 ![20180130-05](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/d/d/dd467c491c536eec0f0105df474b973ff6a7afe6.JPG)
