For me if its a table can do a check "strlen" find max str in a column and change the column width to suit, a fairly simple fix.
Sorry read again its a block, same thing though check strlen and change for tagname.
So no sample dwg to test
In the code the 25 is the number of characters that will fit so change to suit.
(defun c:resatt ( / data len wid)
(setq data (entget (car (setq ent (nentsel "\nPick attribute ")))))
(setq len (strlen (cdr (assoc 1 data))))
(setq wid (/ 25.0 len ))
(if (< wid 1.0)
(entmod (subst (cons 41 wid) (assoc 41 data ) data))
)
(princ)
)
Another way is to make the changes on the source block then use tool palette or design center to update/redefine the blocks on the current session.
thank you pbejse for your help, in fact, I thought in this way but I didn't use it, what I want to say is if I did like that I will be lost all data entry in the rest tags and this block will redefine as a new one without keeping my data into 100 sheet
Dear sea. haven
thanks for your response, what I need to ask in your lisp routine to change 25 by my tag, and which one will use in the new value for width factor for example 0.70
(defun c:resatt ( / data len wid) (setq data (entget (car (setq ent (nentsel "\nPick attribute "))))) (setq len (strlen (cdr (assoc 1 data)))) (setq wid (/ 25.0 len )) (if (< wid 1.0) (entmod (subst (cons 41 wid) (assoc 41 data ) data)) ) (princ) )