These would probably make more sense. I was getting caught up in worrying with it only returning an EName if the user right-clicked, hit enter or the spacebar, but that's kind of silly. If they selected the objects, they're bound to want to, regardless...
(defun AT:CycleThroughENames (lst / l i n)
(if (>= (setq l (length lst)) 2)
(progn (princ "\n<Tab> to cycle through entities: ")
(redraw (setq i (nth (setq n 0) lst)) 3)
(while (eq (cadr (grread nil 10)) 9)
(mapcar 'redraw (list i (setq i (nth (setq n (rem (1+ n) l)) lst))) '(4 3))
)
(redraw i 4)
i
)
(car lst)
)
)
(defun AT:CycleThroughSS (ss / l i e)
(if (eq (type ss) 'PICKSET)
(if (eq (setq l (sslength ss)) 1)
(ssname ss 0)
(progn (princ "\n<Tab> to cycle through entities: ")
(redraw (setq e (ssname ss (setq i 0))) 3)
(while (eq (cadr (grread nil 10)) 9)
(mapcar 'redraw (list e (setq e (ssname ss (setq i (rem (1+ i) l))))) '(4 3))
)
(redraw e 4)
e
)
)
)
)
Thanks for the example to put my head on a little straighter, Lee.