;;; ;;; ;;;> Author: Henry C. Francis ;;;> 425 N. Ashe St. ;;;> Southern Pines, NC 28387 ;;;> http://paracadd.com ;;;> All rights reserved. ;;; ;;;> COPYRIGHT: 8-8-97 ;;;> EDITED: 02-04-2001 ;;; (DEFUN c:rattr (/ tset sslen count cstrl nstrl cind strlm tent tstr strl str1 str2 istr) (IF (AND ustr ukword) nil (LOAD "uutils") ) ;_ end of if (SETQ blknm (ustr 1 "Name of Block containing attributes" blknm nil) chstra (ustr 1 "Attribute string to replace" chstra "T") nwstra (ustr 0 "New string to replace it with" nwstra "T") chngit nil getstr (READ (STRCAT "((-4 . \"\"))" ) ;_ end of strcat ) ;_ end of read ) ;_ end of setq (SETQ zoom_to_attr (ukword 1 "Yes No" "Zoom attribute to center screen? (Yes or No)" zoom_to_attr ) ;_ end of ukword ) ;_ end of setq (SETQ attset (SSGET "x" getstr)) (IF attset (PROGN (SETQ atslen (SSLENGTH attset) blkcnt 0 match# 0 cv_max (GETVAR "vsmax") cv_min (GETVAR "vsmin") ) ;_ end of setq (WHILE (AND (< blkcnt atslen) (/= chngit "Quit")) (SETQ atentn (SSNAME attset blkcnt)) (SETQ atentl (ENTGET (ENTNEXT atentn))) (WHILE (/= (CDR (ASSOC 0 atentl)) "SEQEND") (SETQ attpnt (CDR (ASSOC 10 atentl))) (IF (WCMATCH (CDR (ASSOC 1 atentl)) chstra) (PROGN (SETQ cv_ctr (GETVAR "viewctr") vptd1 (/ (GETVAR "viewsize") 10) vpt11 (POLAR attpnt (* PI 0.25) vptd1) vpt12 (POLAR attpnt (* PI 0.75) vptd1) vpt13 (POLAR attpnt (* PI 1.25) vptd1) vpt14 (POLAR attpnt (* PI 1.75) vptd1) ) ;_ end of setq (GRVECS (LIST 256 vpt11 vpt13 256 vpt12 vpt14 ) ;_ end of list ) ;_ end of grvecs (IF (EQ chngit "GLobal") nil (PROGN (IF (EQ zoom_to_attr "Yes") (COMMAND ".zoom" "c" attpnt "") ) ;_ end of if (SETQ chngit (ukword 1 "Yes No GLobal Quit" (STRCAT "Change this \"" chstra "\" text? (Yes/No/GLobal/Quit) " ) ;_ end of strcat chngit ) ;_ end of ukword ) ;_ end of setq ) ;_ end of progn ) ;_ end of if (IF (OR (EQ chngit "Yes") (EQ chngit "GLobal")) (PROGN (SETQ atentl (SUBST (CONS 1 nwstra) (ASSOC 1 atentl) atentl ) ;_ end of subst ) ;_ end of setq (ENTMOD atentl) (ENTUPD atentn) (SETQ match# (1+ match#)) ) ;_ end of progn ) ;_ end of if (IF (EQUAL cv_ctr (GETVAR "viewctr") 0.00001) (GRVECS (LIST 256 vpt11 vpt13 256 vpt12 vpt14 ) ;_ end of list ) ;_ end of grvecs (SETQ cv_ctr (GETVAR "viewctr")) ) ;_ end of if ) ) (SETQ atentl (ENTGET (ENTNEXT (CDAR atentl)))) ) (SETQ blkcnt (1+ blkcnt)) ) (IF (AND (/= chngit "Quit") (= match# 0)) (PRINC "\No matching attributes found. ") (PRINC (STRCAT "\n" (ITOA match#) " \"" chstra "\" attributes were replaced with \"" nwstra "\" attributes." ) ;_ end of strcat ) ;_ end of princ ) ;_ end of if ) ) (PRINC) ) ;|«Visual LISP© Format Options» (72 2 40 2 T "end of " 60 9 2 0 0 T T nil T) ***Don't add text below the comment!***|;