We use AutoCAD 14. This LISP routine was written by someone that is no longer with our company. The program asks a user what number they want to search for. It then searches a drawing for that number, and zooms in on the number if found. The problem is that it will only do this for the first instance of that number that it finds. Can someone please modify this program so that the user can hit a button, and go to the next instance of that number until it zooms to them all. I am unfamiliar with AutoCAD's lisp programs, and would not any clue where to start. Any help will be greatly appreciated. ;PROGRAM FINDS THE TEXT STRING ENTERED BY USER ;AND ZOOMS INTO THE LOCATION OF THE NUMBER (defun c:partnum (/ ANAME ALIST BNAME BLIST PNSET POS NB MATCH END LOCATION) ;ask user for part number and store in PNUM (setq PNUM (getstring "Enter Part # To Search For....")) ;create selection set of all blocks and text with filter-list (setq PNSET (ssget "X" (list (cons -4 "<OR")(cons 0 "insert") (cons 66 1)(cons 0 "text")(cons -4 "OR>")))) ;get number of entities in "PNSET" (setq NB (sslength PNSET)) ;set ssname position number to 0 (setq POS 0) ;enter while loop and remain looped until (MATCH = 1) or (1 + POS = NB) ;this is due to position starting at 0 (while (and (= MATCH nil) (/= (+ POS 1) NB) );and ;get entity name of entity in selection set "PNSET" (setq BNAME (ssname PNSET POS)) ;set ssname position number to 1 + POS (setq POS (1+ POS)) ;get association list for entity (setq BLIST (entget BNAME)) ;enter block cond if entity is a block (cond ( (and (= "INSERT" (cdr (assoc 0 BLIST))) (= 1 (cdr (assoc 66 BLIST))) );and ;get next entity name after block entity name ;this may or may not be an attribute (setq ANAME (entnext BNAME)) ;get association list for this entity (setq ALIST (entget ANAME)) ;test to see if it is an attribute and if not ;then loop until attribute is present (while (/= "ATTRIB" (cdr (assoc 0 ALIST))) (setq ANAME (entnext ANAME)) (setq ALIST (entget ANAME)) );while ;get number from ALIST (setq NUM (cdr (assoc 1 ALIST))) ;test for end of sequence (setq END (cdr (assoc 0 ALIST))) ;test for match between PNUM and NUM (if (= PNUM NUM) (progn (setq MATCH 1) (setq LOCATION (cdr (assoc 10 ALIST))) (setq THEIGHT (cdr (assoc 40 ALIST))) ); );if ;enter block while loop to get next entity and re-test attributes for match (with PNUM) (while (and (= END "ATTRIB") (= MATCH nil) );and (setq ANAME (entnext ANAME)) (setq ALIST (entget ANAME)) (setq NUM (cdr (assoc 1 ALIST))) (setq END (cdr (assoc 0 ALIST))) (if (= PNUM NUM) (progn (setq MATCH 1) (setq LOCATION (cdr (assoc 10 ALIST))) (setq THEIGHT (cdr (assoc 40 ALIST))) );progn );if );while );cond );cond ;enter conditional for text (cond ((= "TEXT" (cdr (assoc 0 BLIST))) ;get number from BLIST (setq NUM (cdr (assoc 1 BLIST))) ;test for match between PNUM and NUM (if (= PNUM NUM) (progn (setq MATCH 1) (setq LOCATION (cdr (assoc 10 BLIST))) (setq THEIGHT (cdr (assoc 40 BLIST))) );progn );if );COND );COND );while ;zoom to location if MATCH = 1 (cond ((= MATCH 1) (setq DIST (* THEIGHT 8.5)) (setq P1 (polar LOCATION 3.2 DIST)) (setq P2 (polar LOCATION 0.3 DIST)) (command "zoom" "w" p1 p2) ));cond ;print message if no number found (if (= MATCH nil) (progn (princ " Part #.. ")(princ PNUM)(princ "..Not Found")(princ) );progn );if );defun partnum