http://www.faqs.org/faqs/CAD/autolisp-faq/part2/section-1.html ;;; convert selection set to list, ;;; Note: it's also wise to use ai_ssget, because some ents could be ;;; on locked layers ;;; Ex: (sslist (ai_ssget (ssget))) => list of selected unlocked ents ;;; or (mapcar 'entupd (sslist (ssget "X" '((8 . "TEMP"))))) ;;; - regens all entities on layer TEMP (defun SSLIST (ss / n lst) (if (= (type ss) 'PICKSET) (repeat (setq n (sslength ss)) (setq n (1- n) lst (cons (ssname ss n) lst)))))
http://www.d2cad.nl/lisp/lisps/sslist.html (defun SSList (f_sel) ;converts a selection set to a list of enames (if f_sel (progn (if (/= (type f_sel) 'PICKSET) (exit) ) ; end if (setq f_ss_list nil f_loop -1 ) ; end setq (repeat (sslength f_sel) (progn (setq f_loop (1+ f_loop)) ; (princ (strcat "\rSorting " (itoa f_loop) " of " (itoa (sslength f_sel)) " ")) (setq f_ss_list (append f_ss_list (list (ssname f_sel f_loop)))) ) ; end progn ) ; end repest ) ; end progn nil ) ; end if ) ; end defun
http://forum.paug.org/messages/24/973.html?WednesdayMay1920040929am ;--- sslist ----------------------------------------------- ; convert selection-set into a list of entities ; result is the list ; Example: (sslist ) ; (defun sslist (SS / N P) (repeat (setq N (sslength SS)) ;seed N (setq N (1- N) ;index number P (cons (ssname SS N) P)) ;setq );repeat ); sslist