Clockwork Sort lists by lists (of script itself) not working as expected

Hi everyone,

I’ve been messing with a script to order all piles in a project grouped by pile host (IE a slab, floor, column, beam, …) then by pilecap, then the individual piles. (if there are no pilecaps between the host and pile, the coordinates of the pile are kept in the pilecap list to avoid sorting issues).

Each of these groups are individually sorted by the X and Y axes to sort from the bottom left to top right.

I took some screenshots displaying the results on my test file in red, with the intended results in blue. I also had the script export its list to an excel document for evaluating all parameters. Some things don’t seem right in the sorting results… Anyone else experienced this? Or did I make a mistake somewhere?

[1] Script_Pilenumbering 20_03_18.dyn (96.8 KB)
No file selected.xlsx (21.3 KB)