List.SortByKey https://forum.dynamobim.com/t/how-to-get-the-elements-back-by-list-sortbykey/38155
Courtesy of @Nick_Boyts