Alternative to get/set Parameters by Name

Hello Dynamo Community,

Is there an alternative to get or set the Parameter of an Element by Name.

Currently my Scripts get or set Parameters this way:

The Problem im facing is that if someone wants to use the scripts and has Revit started in another language it wont find BuiltInParameters. In the example above im accessing the Parameter “Länge” (German) but if Revit is running in Englisch the Builtin Parameter is named “Length”.

Is there an alternative way to get / set Parameters?

1 Like

Thank you for the link, the solutions mentioned here are pretty good. I was able to address the right Parameter by ID (I assume that the ID stays the same for BuiltIn Parameters) -> let Dynamo find out the Name and set / get ParameterByName.

Feel free to share improvements to this solution.

Edit 2020_06_02:

Code Block to get ID from Name:

parameters = Element.Parameters(elements[0]);
all_param_names = Parameter.Name(parameters);
dict_ = List.FilterByBoolMask(parameters, parameter_name == all_param_names);
param_Id = Parameter.Id(Dictionary.ValueAtKey(dict_, "in")@L1<1>)[0];

Code Block to get Name from ID:

parameters = Element.Parameters(elements[0]);
all_param_ids = Parameter.Id(parameters);
dict_ = List.FilterByBoolMask(parameters, parameter_id == all_param_ids);
param_Name = Parameter.Name(Dictionary.ValueAtKey(dict_, "in")@L1<1>)[0];
2 Likes

You might like this: