http://image.prntscr.com/image/1d3ebd863adf490382ab2c2c5a008929.png
1 Like
reset = IN[0]
if IN[1] != True: off = 1/0
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
from operator import itemgetter
pts0 = IN[2]
pts = map(lambda p: [p.X, p.Y, p.Z, p], pts0)
sortpts = sorted(pts, key = itemgetter(0,1,2))
OUT = map(lambda x: x[3], sortpts)
2 Likes
And if it’s not Dynamo points, but nested lists
http://image.prntscr.com/image/6c2a7674c6204c0e92c35fbad05ee2b6.png
But be aware that the Python script works much faster than the Dynamo script. This becomes clear when the elements are sorted by more than a thousand