Discussion:
Edit ALL text color
(too old to reply)
GoodJuJu
2005-02-07 13:27:34 UTC
Permalink
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.
Tom Smith
2005-02-07 13:35:44 UTC
Permalink
Post by 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.
GoodJuJu
2005-02-07 14:09:28 UTC
Permalink
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)
)
Doug Broad
2005-02-07 13:57:53 UTC
Permalink
Google groups -> propstobylayer

Modify as necessary.
Post by GoodJuJu
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.
Post by GoodJuJu
Looking through other posts here, it appears that I need to search blocks for -2 codes.
Any help is much appreciated.
GoodJuJu
2005-02-07 14:27:15 UTC
Permalink
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.
Jeff Mishler
2005-02-07 17:05:35 UTC
Permalink
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
Post by 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.
GoodJuJu
2005-02-08 07:49:32 UTC
Permalink
Thanks Jeff.... on my way now.

Kent Cooper, AIA
2005-02-07 14:15:29 UTC
Permalink
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
Post by GoodJuJu
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.
Loading...