About a month ago I needed some sorting help and ronjonp came to me rescue. I though I could just modify the previous code for my new task but I can't get it to work. I have a list as follows:
((((
58097.8 68160.0) (58279.0 67834.1)) (#<VLA-OBJECT #<VLA-OBJECT)) (((
58793.2 68703.3) (58974.4 68377.4)) (#<VLA-OBJECT #<VLA-OBJECT)) (((
58097.8 68426.5) (58279.0 68257.3)) (#<VLA-OBJECT #<VLA-OBJECT)) (((
58489.9 68305.8) (58671.1 67979.9)) (#<VLA-OBJECT #<VLA-OBJECT)) (((
58097.8 68861.5) (58279.0 68535.6)) (#<VLA-OBJECT #<VLA-OBJECT)))
I want to sort each element first by the smallest x-value shown in red and if the x-values match, then sort by largest y-value shown in green. The final list should look like:
((((
58097.8 68861.5) (58279.0 68535.6)) (#<VLA-OBJECT #<VLA-OBJECT)) (((
58097.8 68426.5) (58279.0 68257.3)) (#<VLA-OBJECT #<VLA-OBJECT)) (((
58097.8 68160.0) (58279.0 67834.1)) (#<VLA-OBJECT #<VLA-OBJECT)) (((58489.9 68305.6) (58671.1 67979.9)) (#<VLA-OBJECT #<VLA-OBJECT)) (((58793.2 68703.3) (58974.4 68377.4)) (#<VLA-OBJECT #<VLA-OBJECT)))
I tried the following code but without success:
;; Get X value
;; Grab all other list entries with same X within a fuzz of 12 while sorting by largest Y value
ss
) ;_ end of vl-remove-if-not
) ;_ end of >
) ;_ end of lambda
) ;_ end of vl-sort
) ;_ end of setq
;; Put items in list 'out'
;; Remove from list 'ss' we're iterating
) ;_ end of while
Can anybody help?