To sort by Z then X then Y use the following:
import clr orglst = IN[0] orglst.sort(key = lambda orglst: (orglst.Z, orglst.X, orglst.Y)) OUT = orglst
Adaption of the code by: