did you sort it because the selection order? if so, how did you get the idea that Z is to be sorted?
Please see
this post.
as i understand you sort lst list, couldn't you just redefine lst with the new sorted list?
(setq lst (mapcar '(lambda ( n ) (nth n lst)) (vl-sort-i ins '>))
couldn't you just
(setq lst (vl-sort-i ins '>))
No, I am using the list of z-values (
ins variable) as a sorting index by which to sort the list of DXF data for each text entity (
lst variable). Note that the
vl-sort-i function does
not return the supplied list of items sorted by the given sorting function, but rather a list of indexes giving the new positions of the items in the orginal list. This list of indexes is then used by the program to sort the items in the main list (
lst).
This method is far more efficient, since the value by which the list of items is sorted (i.e. the z-value under our new coordinate system) does not need to be retrieved & calculated for each comparison within the sorting function.