;;;Change attribute's thickness (attributes and text with thickness other than zero may
;;;be hidden by solids, 3dfaces, circles or any other surface upon hidden line removal).
;;;
;;;> Author: Henry C. Francis
;;;> 425 N. Ashe St.
;;;> Southern Pines, NC 28387
;;;> http://paracadd.com
;;;> All rights reserved.
;;;
;;;> COPYRIGHT: 3-16-2001
;;;> EDITED: 05-06-2001
;;;
;;; Modified: 02-16-2016 to accommodate for all Blocks with Attributes
;;;
(defun c:a0 (/ bmcnt bment bmss modcnt newatthk newent ustr ureal)
;;; This function is freeware courtesy of the author's of "Inside AutoLisp" for
;;; rel. 10 published by New Riders Publications. This credit must accompany all
;;; copies of this
;;; function.
;;;
;;; USTR User interface string If BIT=1 no null "" input allowed, 0 for none, BIT
;;; ignored if DEF present. MSG is the prompt string, to which a default string
;;; is added as (nil or "" for none), and a : is added. If SPFLAG T, spaces
;;; are allowed in
;;; string.
;;;
(DEFUN ustr (bit msg def spflag / inp nval)
(IF (AND def (/= def ""))
(SETQ msg (STRCAT "\n" msg " : ")
inp (GETSTRING msg spflag)
inp (IF (= inp "")
def
inp
) ;_ end of if
) ;_ end of setq
(PROGN
(SETQ msg (STRCAT "\n" msg ": "))
(IF (= bit 1)
(WHILE (= "" (SETQ inp (GETSTRING msg spflag))))
(SETQ inp (GETSTRING msg spflag))
) ;_ end of if
) ;_ end of progn
) ;_ end of if
inp
) ;_ end of defun
(PRINC)
;|«Visual LISP© Format Options» (80 2 40 2 T "end of " 60 9 2 1 0 T T T T)
***Don't add text below the comment!***|;

;This function is freeware courtesy of the author's of "Inside AutoLisp" for rel. 10 published by New Riders Publications. This credit must accompany all copies of this function.
;
;* UREAL User interface real function
;* BIT (0 for none) and KWD key word ("" for none) are same as for INITGET.
;* MSG is the prompt string, to which a default real is added as (nil
;* for none), and a : is added.
;*
(defun ureal (bit kwd msg def / inp)
(if def
(setq msg (strcat "\n" msg " : ")
bit (* 2 (fix (/ bit 2)))
)
(setq msg (strcat "\n" msg ": "))
);if
(initget bit kwd)
(setq inp (getreal msg))
(if inp inp def)
);defun
;*
(princ)
;*

(setq modcnt 0)
(setq batname (strcase (ustr 1 "Block name for new attribute thickness? " (if batname batname "") nil)))
(setq newatthk (ureal 1 "" (strcat "New attribute thickness for all " batname " attributes? ") (if newatthk newatthk 0.0)))
(setq bmss (ssget "x" (list
(cons -4 "")
)
)
)
(setq bmss (ssget "_X" '((0 . "INSERT")(66 . 1)))) ; select all blocks with attributes
(setq bmcnt (1- (sslength bmss)))
(while (>= bmcnt 0)
(setq bment (entget (ssname bmss bmcnt)))
(while (/= (cdr(assoc 0 bment)) "SEQEND")
(if (eq (cdr (assoc 0 bment)) "ATTRIB")
(IF (assoc 39 bment)
(progn
(setq newent (subst (cons 39 newatthk)(assoc 39 bment) bment))
(if
(entmod newent)
(setq modcnt (1+ modcnt))
)
)
(progn
(setq newent (append bment (list (cons 39 newatthk))))
(if
(entmod newent)
(setq modcnt (1+ modcnt))
)
)
)
)
(setq bment (entget (entnext (cdr(assoc -1 bment)))))
)
(setq bmcnt (1- bmcnt))
)
(princ (strcat "\nThickness set to " (rtos newatthk 2 2) " for " (itoa modcnt) " attributes in " (itoa (sslength bmss)) " " batname " blocks."))
(princ (strcat "\nThickness set to " (rtos newatthk 2 2) " for " (itoa modcnt) " attributes in " (itoa (sslength bmss)) " blocks."))
(princ)
)
(c:a0)

Advertisements