Elements sorting

Hy guys! I am a beginner in Dynamo. I don’t know what node or nodes can help me to sort the selected elements by FamilyType (see snapshot) and further attach them to “Element.SetParameterByName”.

use string contains and boolmask

2 Likes

This is a great use case for dictionaries:


Element Grouping.dyn (32.6 KB)

First, group your list of elements using their names as the “Keys” input in the List.GroupByKey node. Then you can connect this directly to a Dictionary.ByKeysValues node which will create a table which associates each element to a unique name. You can then retrieve the same elements further down the line by providing the same key name. I also added a key called “Basement” which is purposefully not in the list of names and therefore shows a warning that it couldn’t be found in the dictionary.

3 Likes