How can I cleanly exit a "while" function used with "ssget"? I thought an empty return would work but it exits the whole routeen. If I give give the "while" a fixed exit the routeen works fine. It crashes out befor the list is written to a txt file. Thanks for any help.
See below
Code:(defun c:BB () (setq ss x) (Setvar "osmode" 0) (setq infolst nil) (setq T1 1) (while (/= ss nil) (Prompt "Pick Dimension") (setq SS (ssget)) (setq elst1 (entget(ssname SS 0))) (setq P1 (cdr(assoc 11 elst1))) (setq p2 (list (+ (car p1) 0.55)(+ (cadr p1) 0.38) 0.0)) (setq p3 (list (- (car p2) 0.10)(- (cadr p2) 0.10) 0.0)) (command "circle" P2 0.25 "") (setq T2 (itoa T1)) (command "text" P3 "0.180" "0" T2) (setq D1 (cdr(assoc 42 elst1))) (setq D1 (rtos D1 2 3)) (setq INFOLST (append INFOLST (list D1))) (setq T1 (1+ T1)) );while ;Write INFOLST out to file (setq R (length INFOLST) FN "c:\\cad\\Iso9000.txt" I 0 TEX (open FN "w") ) (repeat R (setq L (nth I INFOLST)) (write-line L TEX) (setq I (1+ I)) ) (close TEX) (princ) ) (princ)Moderator Note: