;;;Attribute update subroutine (attupd [blockname] [attribname] [newvalue]) ;;;Used extensively in scripts to rapidly change title block fill-ins. ;;; ;;; 1-15-2004 added var [testvalue] - user must (setq testvalue ). ;;; If [testvalue] is not NIL AND not eq current [attribname] value the current ;;; [attribname] value remains unchanged. ;;; If [testvalue] is NIL the program will update [attribname] to [newvalue] ;;; ;;;> Author: Henry C. Francis ;;;> 425 N. Ashe St. ;;;> Southern Pines, NC 28387 ;;;> http://paracadd.com ;;;> All rights reserved. ;;; ;;;> COPYRIGHT: 1997-2004 ;;;> EDITED: 11-17-2005 ;;; (defun attupd (blockname attribname newvalue / ttl1ss iniblk inient nxtent) (setq ttl_exst nil bstp 0) (if (setq ttl1ss (ssget "x" (list (cons -4 "") ) ) ;_ end of ssget ) ;_ end of setq ; (while (< bstp (sslength ttl1ss)) (progn (setq iniblk (ssname ttl1ss bstp)) (setq inient (entget iniblk)) (setq nxtent (entget (entnext iniblk))) (while (/= (cdr (assoc 0 nxtent)) "SEQEND") (if (eq (cdr (assoc 0 nxtent)) "ATTRIB") (if (and(eq (strcase(cdr (assoc 2 nxtent)))(strcase attribname))(if testvalue (eq testvalue (cdr(assoc 1 nxtent))) T)) (progn (setq nxtent (subst (cons 1 newvalue) (assoc 1 nxtent) nxtent) ) ;_ end of setq (if (AND(eq (cdr (assoc 2 nxtent)) "SCALE")(equal(cdr(assoc 10 nxtent))'(32.275 1.907 0.0) 0.01)) (setq nxtent (subst (cons 10 (polar (cdr(assoc 10 nxtent))PI 0.25)) (assoc 10 nxtent) nxtent) ) ;_ end of setq ) (entmod nxtent) (entupd iniblk) ) ;_ end of progn (if (eq (strcase(cdr (assoc 2 nxtent)))"SHT_NO.") (setq cur_sht_no (cdr(assoc 1 nxtent))) ) ) ;_ end of if ) ;_ end of if (setq nxtent (entget (entnext (cdar nxtent)))) ) ;_ end of while (princ) ) ;_ end of progn ; (setq bstp (1+ bstp)) ; ) (princ) ) ;_ end of if (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!***|;