Hi, EC-Cad, Your code worked perfect, but do you think is possible to select and change attributes that are style "standard" only... like filter from the global selection and changing width to 1 but only specific attributes in all blocks?
(defun C:ChgAttWidth (/ ss sslen cnt blck ent entinfo) (setq ss (ssget "x" '((0 . "INSERT")(66 . 1)))) (setq cnt 0) (setq sslen (sslength ss)) (while (< cnt sslen) (setq blck (ssname ss cnt)) (setq ent (entnext blck)) (setq entinfo (entget ent)) (while (and ent (= (cdr (assoc 0 entinfo)) "ATTRIB")) (if (eq (strcase (cdr (assoc 7 entinfo))) "STANDARD") (progn (entmod (subst (cons 41 1) (assoc 41 entinfo) entinfo)) (entupd ent)) ) (setq ent (entnext ent)) (setq entinfo (entget ent)) ) (setq cnt (1+ cnt)) ) (princ) )
added IF statement on the original
Hi this is amazing, but what if I wanted to change all widths to 0.7?... please would you kindly help.
Many thanks 🙂
You are replying to an archived account.
That aside you could try this but be away it will change the widths of all attribute of all attributed blocks in the drawing.
;;Global Attribute Width (defun C:GAW (/ wid ss cnt blk ent e_lst) (initget 7) (setq wid (getreal "\nEnter Attribute Text Width : ") ss (ssget "X" '((0 . "INSERT")(66 . 1))) );end_setq (repeat (setq cnt (sslength ss)) (setq blk (ssname ss (setq cnt (1- cnt))) ent (entnext blk) e_lst (entget ent) );end_setq (while (and ent (= (cdr (assoc 0 e_lst)) "ATTRIB")) (entmod (subst (cons 41 wid) (assoc 41 e_lst) e_lst)) (entupd ent) (setq ent (entnext ent) e_lst (entget ent) );end_setq );end_while );end_repeat (princ) );end_defun
I am not one of the robots you're looking for
Oh you are a beautiful, kind and talented person!... thank you ever so much for your time !!!
That is absolutely perfect, and I can even choose whatever width I want.
Idiot proof even for me.
Thank you.