Populate Parameter Values Sorted by Parameter

I am trying to populate a text parameter of a family from a sorted list. I have gotten my two different families to be in the same sort order but i am unable to write the parameter. More specific, i am trying to take values from a column in a revit schedule, and add those to families i have in my project (tag value of “Rough Power Line”). I collected the "Rough Power Line Elements and sorted them to match the Revit Schedule Column, but i cant figure out how to add the tag value from my sorted list. Not sure if this is very confusing?

I can’t read your graph. Are you getting a warning somewhere? Is the Tag Value an instance or a type parameter?

I assume that the last node in your graph is the SetParameterByName node? It should have elements as input in the top most port, and it seems to me that you are giving it strings. (Interesting challenge by the way, to guess the nodes based on the shape and number of ports, without text :wink: )


Lol. Not sure what happened there. Lets try that again.

Basically i am trying to sort my elements (Rough Power Line) by a parameter that the family contains (Pre-Fab Wire Start). Once sorted i would like to be able to feed the sorted Rough Power Line, into the elements section of the set parameter by name.

I feel like it is possible but it could very well not be possible because i am fairly new to dynamo.

Thank you!

Tag Value is an Instance

Like @Einar_Raknes said, you’re sorting parameter values, not the elements they belong to. You need to make sure you’re keeping the elements. Your lists also don’t match. You have 21 electrical fixtures but only 17 values.

Is it possible to sort the elements by the parameter values? My end goal here is to take the column from the schedule (PR1 Devices for Dynamo) and populate a column of another schedule with those values. Maybe there is a more simple way to achieve this, but im not sure. Is there potentially i write to schedule column node that i havent been able to find somewhere? Am i correct in assuming that in order to populate a schedule column, i need to be assigning the values to actual elements? I am very willing to dig in and figure this out, just want to make sure that it is actually feasible i suppose?

You can use SortByKey to sort your element list based on parameter values.

You are correct in assuming that you need to assign the schedule values to actual elements. It should be as easy as getting all the elements from the first schedule and sorting them by Pre-Fab Wire STA. Then doing the same thing for the second group of elements. You may have to do some filtering to make sure you’re working with only the elements shown in the schedule, but then you should be able to assign the parameter values without any problems.

Ok i will give it a try. The major issue i run into with my schedule is that i am calculating a length of line segements. and revit considers each segment a new family instance. this is why i have 21 vs 16 in my lists. Just an FYI. Thank u for your help i will mess around and see what i can come up with