Element.SetParameterByName Error message

Hello,

I’m working on a Dynamo graph to


modify the “Description” parameter of a group of selected Revit elements. I’m using the Element.SetParameterByName node to set the parameter value, but I’m encountering an error when I try to connect the output of the List.Sort node to the Element.SetParameterByName node.

Specifically, when I connect the output of the List.Sort node to the Element.SetParameterByName node, I see an error message that says “Input is not a Revit element.” I’m not sure why this error is occurring, since the input to the Element.SetParameterByName node is a list of elements.

I’ve attached a screenshot of my Dynamo graph below, along with the error message. Can anyone help me figure out what I’m doing wrong?

Thanks in advance for your help!

You are given string value instead of element.

Hello Robert,

I am trying to sort the Element types in order. So that it matches the value as per Excel.

How to convert a String value into an Element?

Just get the new indexes from the sorted list and use these indexes to fetch the elements in the right order.

1 Like

List.SortByKey also works. You can insert the elements List input and element names as key you will get the element output.

2 Likes