Does anyone know how to change the font of a specific attribute in all my blocks in a drawing. I am trying to change the INST attribute font to Arial but I have thousands of them through out my project. My other attributes that I do not want to change are using the same Style as this block so I can not simply change the style.
Solved! Go to Solution.
Solved by mewescott. Go to Solution.
AFAIK you can not change the font of the attributed block string , and changing fonts would affect on text styles in tables , anyway create a TEXT STYLE named ARIAL and try this piece of code .
(defun c:TesT (/ Unlock-layers lock-layers l lst ss n e i) ;; Tharwat 17. Sep. 2012 ; ;; Change a specific attributed ' Value style name ; ;; to ARIAL ; (while (setq l (tblnext "LAYER" (null l))) (if (eq (Logand 4 (cdr (assoc 70 l))) 4) (setq lst (cons (cdr (assoc 2 l)) lst)) ) ) (defun Unlock-layers (layerlist / tbl) (foreach x layerlist (if (tblsearch "LAYER" x) (entmod (subst (cons 70 0) (assoc 70 (setq tbl (entget (tblobjname "LAYER" x)))) tbl)) ) ) (command "_.regen") ) (defun lock-layers (layerlist / tbl) (foreach x layerlist (if (tblsearch "LAYER" x) (entmod (subst (cons 70 4) (assoc 70 (setq tbl (entget (tblobjname "LAYER" x)))) tbl)) ) ) (command "_.regen") ) (if (and (tblsearch "STYLE" "ARIAL") (setq ss (ssget "_:L" '((0 . "INSERT") (66 . 1))))) (progn (if lst (Unlock-layers lst) ) (repeat (setq i (sslength ss)) (setq n (entnext (ssname ss (setq i (1- i))))) (while (not (eq (cdr (assoc 0 (setq e (entget n)))) "SEQEND")) (if (eq (cdr (assoc 1 e)) "INST") (entmod (subst (cons 7 "ARIAL") (assoc 7 e) e)) ) (setq n (entnext n)) ) (setq n nil) ) (if lst (lock-layers lst) ) ) (princ) ) (princ) )
Tharwat
Bedit with ATTSYNC would work if it was only a couple of blocks. I may have anywhere from 20 to 50 blocks per drawing with the same INST attribute that I want to change.
Hi ,
It should work except if you do not have the attribute value INST within the selected blocks .
can you upload a sample drawing ?
You are right Moshe , but the OP have many different blocks as he/she mentioned that in post No. 5
i'm sorry i meant BATTMAN (instead of bedit+attsync)
if the problem is a text style? why don't you consider modifiy it to use the right font file
(even change it's name if needed)
moshe
@Moshe-A wrote:if the problem is a text style? why don't you consider modifiy it to use the right font file
(even change it's name if needed)
moshe
You may need to re-read the first post again Moshe .
The OP wants specific attribute entity with vallue and not the text style that holds them .
I do have multiple blocks with the same attribute name that I want to change the font on. I have received a solution to my posting in the posting I put on the Autocad Electrical forum. Pat Muren created a custom lisp file and script that worked like a charm. To view the posting go to: http://forums.autodesk.com/t5/AutoCAD-Electrical/Change-the-font-of-the-Installation-code-through-ou...
Thank you for assistance.
Can't find what you're looking for? Ask the community or share your knowledge.