Sort Framing based on Width&Depth


Hi all, I am trying to sort framings like the schedule in the snap (width ascending order and than depth for the sorted width in ascending order)

so I can change REF to BC01----- so on.

I am able to sort the width using List.SortBYkey which sort the width in ascending order but when i trying to sort the sorted list further by Depth is changes the sort order of width, which i dont want.

In Revit schedule in Formating tab we can sort by width then depth and it is working properly(in the snap).

Is therre any way that I can sort the element by 2 values with changing the order of 1st sorting

Many thanks

Please try searching the forum for existing topics before making a post. This type of question comes up a lot and has been answered many times. If you run into a specific issue implementing any of those solutions then you can bring that up and we can help you sort it out.

@Nick_Boyts I tried searching what I am looking for, its better than waiting for other to response
and unfortunetly find nothing which help me to get what I want so I posted it in the forum, Thanks for your response though


sorting is not correct see the value

Make sure you’re searching for the general topic, not something exclusive to your specific case. Maybe no one has asked specifically about sorting framing members by width and depth, but plenty of people have asked about sorting by multiple values.

You need to sort and group in order to retain separate “levels” , otherwise you’re just resorting the same list every time.

1 Like