Change text style in blocks.

BillZ

Usenet Archive
Joined
Jul 9, 2003
Messages
1,001
Reaction score
0
R14 Autolisp:

I have many blocks in a drawing that have a visible attribute that has a text style of "style1" that is roamans, I want to change it to romand text type.
Any ideas?

Bill
 
The battman command will allow you to change the style for an attribute and then syncronize this change across all insertions of the same block.

 

HTH,

Mike Weaver

 

"BillZ" <> wrote:

R14 Autolisp:

I have many blocks in a drawing that have a visible attribute that has a text style of "style1" that is roamans, I want to change it to romand text type.
Any ideas?

Bill
 
I know this could be refined, and made more flexible but real quick....

; Jason Piercey . June 2nd, 2003
; [ename] - entity name - block, insert or polyline
; [filter] - string, re: wcmatch
; return: list of enames or nil
(defun nEnts (ename filter / data ent rtn)
(setq filter (strcase filter))
(while (and ename (setq ename (entnext ename)))
(setq data (entget ename))
(setq ent (cdr (assoc 0 data)))
(if (wcmatch ent filter)
(setq rtn (cons ename rtn)) )
(if (= "SEQEND" ent) (setq ename nil))
)
(reverse rtn)
)

; [blockName] - string, attributed block name
; [oldStyle] - string, textstyle to seach for
; [newStyle] - stirng, textstyle for replacement
(defun updateAttStyle (blockname oldStyle newStyle / data pair ename ss i) (setq oldStyle (strcase oldStyle) newStyle (strcase newStyle) ) (foreach x (nEnts (tblobjname "block" blockname) "ATTDEF") (setq data (entget x) pair (assoc 7 data) ) (if (= oldStyle (strcase (cdr pair))) (entmod (subst (cons 7 newStyle) pair data)) )
)

(if
(setq
ss
(ssget
"x"
(list
'(0 . "INSERT")
(cons 2 blockName)
'(66 . 1)
(cons 410 (getvar "ctab"))
)
)
)
(progn
(setq i -1)
(repeat (sslength ss)
(setq ename (ssname ss (setq i (1+ i))))
(foreach x (nEnts ename "ATTRIB")
(setq data (entget x)
pair (assoc 7 data) )

(if (= oldStyle (strcase (cdr pair)))
(entmod (subst (cons 7 newStyle) pair data))
)
)
)
)
)
)

BillZ said:
R14 Autolisp:
I have many blocks in a drawing that have a visible attribute that has a text style of
"style1" that is roamans, I want to change it to romand text type.
 
Upgrade.  Sorry.

"BillZ" <> wrote:

Where do I find this battman for r14?
 

Latest threads

Back
Top