;;;"Display Text Found by Search" dialog. ;;; ;;; ;;; ;;; ;;;> Author: Henry C. Francis ;;;> 425 N. Ashe St. ;;;> Southern Pines, NC 28387 ;;;> http://paracadd.com ;;;> All rights reserved. ;;; ;;;> COPYRIGHT: 12-22-97 ;;;> EDITED: 08-18-1999 ;;; (defun c:srcht ( ) (text_list) (setq num (load_dialog "srcht")) (new_dialog "srcht" num) (mode_tile "found_list" 2) (action_tile "found_list" "(setq cur_ndx(get_tile \"found_list\"))(set_tile \"edit_str\"(nth (atoi cur_ndx) tx_list))") (action_tile "edit_str" "(setq new_str (get_tile \"edit_str\"))") (action_tile "mod_text" "(done_dialog 2)(setq do_this T)") (action_tile "del_text" "(done_dialog 2)(setq do_this nil tx_list nil)(del_text)") (action_tile "cancel" "(setq do_this nil)(done_dialog)") (start_list "found_list") (mapcar 'add_list tx_list) (end_list) (start_dialog) (unload_dialog num) (if do_this (text_mod) ) (princ) );defun (defun text_list ( ) (if do_this (setq tx_list nil) (setq tx_list nil chstr (ustr 1 "String to search for" chstr T) otstr (ustr 0 "Additional selection filter (exact match, wildcards ok)" nil T) count 0 srchlst (if (and otstr (/= otstr "")) (list (cons -4 "") ) (list (cons -4 "") ) ) ) ) (setq tset (ssget "X" srchlst)) (if tset (setq sslen (sslength tset) count 0 ) (setq tx_list (list "*** NONE FOUND ***")) ) (while (and(< count sslen)tset) (setq curent (entget(ssname tset count)) curstr (cdr(assoc 1 curent)) ) (if tx_list (setq tx_list (append tx_list (list curstr))) (setq tx_list (list curstr)) ) (setq count (1+ count)) ) ; (setq tx_list (acad_strlsort tx_list)) ) (defun text_mod () (setq newent (subst (cons 1 new_str) (assoc 1 (entget(ssname tset (atoi cur_ndx)))) (entget(ssname tset (atoi cur_ndx))) ) ) (entmod newent) ; (setq do_this nil) (princ) ) (defun del_text () (setq ename_list nil) (if tset (setq sslen (sslength tset) count 0 ) ) (while (and(< count sslen)tset) (setq cur_ename (ssname tset count)) (if ename_list (setq ename_list (append ename_list (list cur_ename))) (setq ename_list (list cur_ename)) ) (setq count (1+ count)) ) (foreach n ename_list (entdel n)) )