;;; Changes the Width of all attributes within a user selected blocks
;;; Based on https://forums.autodesk.com/t5/user/viewprofilepage/user-id/564264 routine
;;; Saved from here: https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/attribute-width-change/td-p/1525357/page/2
;;; Modified by Igal Averbuh 2016 (added option for selecting blocks and seting New Width Factor for attributes of these blocks)
(defun C:Ca (/ ss sslen cnt blck ent entinfo)
(setq ss (ssget '((0 . "INSERT"))))
(setq cnt 0)
(setq sslen (sslength ss))
(setq wb23 (getdist "\nEnter New Width Factor: "))
(while (< cnt sslen)
(setq blck (ssname ss cnt))
(setq ent (entnext blck))
(setq entinfo (entget ent))
(while
(and ent (= (cdr (assoc 0 entinfo)) "ATTRIB"))
(entmod (subst (cons 41 wb23) (assoc 41 entinfo) entinfo))
(entupd ent)
(setq ent (entnext ent))
(setq entinfo (entget ent))
)
(setq cnt (1+ cnt))
)
(princ)
)
(c:ca)

Advertisements