I have written / patched together this lsp with help from the forum.. What commands should I be looking at to change the sort order from sorted by x value (current) to say starting at a point bottom left and drawing pline to next nearest point and repeating (defun C:P1 () (setq ss (ssget '((0 . "CIRCLE")))) (if ss (progn (setq n (1- (sslength ss)) c nil) (while (>= n 0) (setq elist (entget (ssname ss n)) c (cons (cdr (assoc 10 elist)) c) n (1- n) ) ) (setq csor (vl-sort c (function (lambda (e1 e2) (< (cadr e1) (cadr e2)))))) (command "._pline") (foreach n csor (command n) ) ) ) )