Sort Type Elements by Name and Change its parameters Values

Hi guys,
I’ve been trying to sort some family types from wall sweeps on a project, to set specific values for the same parameter, but I’m not getting there. This is my roadmap to create this script:
_1st: collect all Wall Sweep types in project;
_2nd: filtering the wall sweep types, based on its names;
_3rd: Sorting the collected wall sweeps by element type names;
_4th: setting the parameter value based on a list already sorted by element type name (in excel but in this sample I made it with a code block).

The struggle here, has being that I cannot get the elements already sorted by name.
The last node is expecting elements (not a string) but in the filter list, it is sorted by ID (not by name).
I’m sending the script sample as well as a RVT sample.
Does anyone know how can it be solved?
Thank you in advance!
Set parameter for System Familytype list.dyn (20.8 KB)
Project1.rvt (352 KB)

“Description” is a Type Parameter So Download Rhythms Package and use “setParameterbynameype orInstance” node

Change the order of the descriptions in the code block aswell
and as @dineshsubramani says , its a type parameter, get it by using Element.Element.Type before the SetParameter node.

1 Like

Hi Marcel, thank you for your answer.
The ListFilterByBoolMask is ordering the elementTypes by its ID, that’s why I need to sort it first by name before set its parameter value. The tricky part here is, once this is just a sample, i cannot change the code block order. Instead of a code block, I will use an excel file with a lot of elements values that makes it impossible to change the order one by one.

You could use a dictionary to pull the values?
See it as a list with counterparts.
Feed it 1 and you’ll get A
Feed it 2 and you’ll get B
and so on
You can create a dictionary with list comming from excel

Thank you again Marcel.
Honeslty, I’ve never worked with dictionary in dynamo. I will try to figure out how it can be helpul in this situation and hope to get some solution to post here.

1 Like

See if this helps with dictionaries…

1 Like

I met same problem. I also follow this instruction But iit didn’t work. My input for element in " Element.SetParameterByname is not correct "
How to fix it ? thank you

Try to set your lacing to longest in "set parameter

this is " Warning: Element.SetParameterByName operation failed.
No parameter found by that name. "

could you show your graph ?

This is my graph, please help me check it. Thank you

can you show your parameter name and value or share the dyn as well

This graph is added with parameter name and values

great …are you sure its a type parameter ? try to write to description parameter for check…

the parameter name alread added in revit model. I would like to set value for parameter but only some kine of family type.

allright looks like a instance parameter and you are writing to the type

sure. I can add for wall categorie, But I only wanna set value parameter for some kind of family type. It is doesn work. Do you know how to solve this problem ?

try something here instead…

thank so much for your helping. But I try but it doesnt work .