;;;Append TEXT to strings ;;; ;;; ;;; ;;;> Author: Henry C. Francis ;;;> 425 N. Ashe St. ;;;> Southern Pines, NC 28387 ;;;> http://paracadd.com ;;;> All rights reserved. ;;; ;;;> COPYRIGHT: 9/9/98 ;;;> EDITED: 08-18-1999 ;;; (defun c:atext (/ tset sslen count tent strl str1 str2 istr) (if (and ustr ukword) nil (load "uutils") ) ;_ end of if (setq chstr (ustr 1 "String to search for" chstr T) nwstr (ustr 0 "String to add" nwstr T) addend (ukword 1 "Beginning End" "Add end (eginning or nd)" (if addend addend "End" ) ;_ end of if ) ;_ end of ukword ) ;_ end of setq (setq cnumb 0 srchlst (list (cons -4 "") ) ;_ end of list ) ;_ end of setq (setq tset (ssget srchlst) sslen (sslength tset) count 0 ) ;_ end of setq (while (not (>= count sslen)) (setq tent (entget (ssname tset count)) tstr (cdr (assoc 1 tent)) ) ;_ end of setq (progn (cond ((eq addend "Beginning") (setq istr (strcat nwstr (cdr (assoc 1 tent)))) ) ((eq addend "End") (setq istr (strcat (cdr (assoc 1 tent)) nwstr)) ) ) ;_ end of cond (setq tent (subst (cons 1 istr) (assoc 1 tent) tent ) ;_ end of subst ) ;_ end of setq (setq chgstr (ukword 0 "Yes No" (strcat tstr " Change To:\n" istr " ?") "Yes" ) ;_ end of ukword ) ;_ end of setq (if (eq chgstr "Yes") (progn (entmod tent) (setq cnumb (1+ cnumb)) (princ "\n ") ) ;_ end of progn ) ;_ end of if ) ;_ end of progn (setq count (1+ count) ) ;_ end of setq ) ;_ end of while (princ (strcat "\n" (itoa cnumb) " \"*" chstr "*\" strings had \"" nwstr "\" strings added to their " addend ) ;_ end of strcat ) ;_ end of princ (princ) ) ;_ end of defun ;|«Visual LISP© Format Options» (72 2 40 2 T "end of " 60 9 0 0 0 T T nil T) ***Don't add text below the comment!***|;