Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Edit ALL text color

7 REPLIES 7
Reply
Message 1 of 8
goodjuju
579 Views, 7 Replies

Edit ALL text color

Is there a way using Lisp to convert ALL text to be color 7 within a drawing?
I can change Mtext, Text, ArcAlignedText, Dimension Text and Attributes using

(Defun C:TxtCol)
(setq ALLTEXT (ssget "X" '((0 . "*TEXT,DIMENSION,ATTDEF,DIMENSION"))))
(Command "Change" ALLTEXT "" "P" "C" "7" "")

However, when it comes to blocks in the drawing I need to change the color of text and attributes inside the block without exploding it.
Looking through other posts here, it appears that I need to search blocks for -2 codes.
Any help is much appreciated.
7 REPLIES 7
Message 2 of 8
Anonymous
in reply to: goodjuju

> However, when it comes to blocks in the drawing I need to change the color of text and attributes inside the block without exploding it. You have to redefine the blocks to do that.
Message 3 of 8
Anonymous
in reply to: goodjuju

Google groups -> propstobylayer Modify as necessary. "GoodJuJu" wrote in message news:32956523.1107782885140.JavaMail.jive@jiveforum2.autodesk.com... > Is there a way using Lisp to convert ALL text to be color 7 within a drawing? > I can change Mtext, Text, ArcAlignedText, Dimension Text and Attributes using > > (Defun C:TxtCol) > (setq ALLTEXT (ssget "X" '((0 . "*TEXT,DIMENSION,ATTDEF,DIMENSION")))) > (Command "Change" ALLTEXT "" "P" "C" "7" "") > > However, when it comes to blocks in the drawing I need to change the color of text and attributes inside the block without exploding it. > Looking through other posts here, it appears that I need to search blocks for -2 codes. > Any help is much appreciated.
Message 4 of 8
goodjuju
in reply to: goodjuju

I got this from the Lisp forum here, posted by Ken Alexander. It edits the text of all attributed block text to 'ByLayer'........ just need to edit the text now.

(defun C:ChgAttCol (/ name ss sslen cnt blck ent entinfo)
(setq name (strcase (getvar "loginname")))
(setq ss (ssget "x" '((0 . "INSERT"))))
(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 (assoc 62 entinfo)
(entmod (subst (cons 62 256) (assoc 62 entinfo) entinfo))
)
(entupd ent)
(setq ent (entnext ent))
(setq entinfo (entget ent))
)
(setq cnt (1+ cnt))
)
(princ)
)
Message 5 of 8
Anonymous
in reply to: goodjuju

Any chance that all of those text-type objects are color BYLAYER on (a) separate text layer(s), and you could just change the color of the layer(s)? That would fix the ones inside blocks, too. -- Kent Cooper, AIA "GoodJuJu" wrote in message news:32956523.1107782885140.JavaMail.jive@jiveforum2.autodesk.com... > Is there a way using Lisp to convert ALL text to be color 7 within a > drawing? > I can change Mtext, Text, ArcAlignedText, Dimension Text and Attributes > using > > (Defun C:TxtCol) > (setq ALLTEXT (ssget "X" '((0 . "*TEXT,DIMENSION,ATTDEF,DIMENSION")))) > (Command "Change" ALLTEXT "" "P" "C" "7" "") > > However, when it comes to blocks in the drawing I need to change the color > of text and attributes inside the block without exploding it. > Looking through other posts here, it appears that I need to search blocks > for -2 codes. > Any help is much appreciated.
Message 6 of 8
goodjuju
in reply to: goodjuju

If only..... but I`m afraid not. Most of the text entities are color by object, so simply changing the layer won`t work. It seems strange that it is relatively simple to edit an attributes properties within a block, but a real headache to edit standard Text entities within a block.
Message 7 of 8
Anonymous
in reply to: goodjuju

If you go see the replies to your question about this at cadvault.com, you'd see that I posted a lisp that will do this. Just be sure to read to the end, as I missed some ents in the first version. -- Jeff check out www.cadvault.com "GoodJuJu" wrote in message news:10900432.1107786466140.JavaMail.jive@jiveforum2.autodesk.com... > If only..... but I`m afraid not. Most of the text entities are color by > object, so simply changing the layer won`t work. It seems strange that it > is relatively simple to edit an attributes properties within a block, but > a real headache to edit standard Text entities within a block.
Message 8 of 8
goodjuju
in reply to: goodjuju

Thanks Jeff.... on my way now.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost