Hi all,
I need a function to sort a list by first element , like this :
(("3" Xc Yc) ("1" Xc Yc) ("2" Xc Yc)) >> (("1" Xc Yc) ("2" Xc Yc) ("3" Xc Yc))
(("003" Xc Yc) ("001" Xc Yc) ("002" Xc Yc)) >> (("001" Xc Yc) ("002" Xc Yc) ("003" Xc Yc))
(("A3" Xc Yc) ("A1" Xc Yc) ("A2" Xc Yc)) >> (("A1" Xc Yc) ("A2" Xc Yc) ("A3" Xc Yc))
(("B" Xc Yc) ("C" Xc Yc) ("A" Xc Yc)) >> (("A" Xc Yc) ("B" Xc Yc) ("C" Xc Yc))
I mean the function should work on the above lists, Xc and Yc are center point of a polyline.
I'm using this code to sort :
(vl-sort
lst
'(lambda (x y)
(< (atoi (car x))
(atoi (car y))
)
)
)
But the code only works on the first and the second lists.