Sort Revit Elements by Number then Letter

Think about what’s happening logically…
Whichever parameter you sort by last becomes the most important. Overriding the sorting you did previously.

If number is more important, you have to sort by letter to get the letters in order (A,B,C,etc) disregarding the numbers. The numbers may be out of order but the letters are not. Meaning that when you sort by number next you’ll always run into an A before a B or a C. So you know when you grab the first 1 it’ll be attached to an A.

1 Like

Assume you start with a list {B1,A3,B3,A2,A1,B2}

When you first sort by letter and then number, the sequence of sorting will be something like this…
1…{A3,A2,A1,B1,B3,B2} (first sorts letters irrespective of what the number is)
2…{A1,B1,A2,B2,A3,B3} (next sorts the above list by number, irrespective of what the letter is)

When you first sort by number and then letter, the sequence of sorting will be something like this…
1…{B1,A1,A2,B2,A3,B3} (first sorts numbers irrespective of what the letter is)
2…{A1,A2,A3, B1,B2,B3} (next sorts the above list by letter, irrespective of what the number is)

Hope this makes sense

1 Like

This is gold and helped me solve my issue even though not related specifcally to sorting numbers then by letter but might help some.

1 Like