Edit ALL text color

Discussion in 'AutoCAD' started by GoodJuJu, Feb 7, 2005.

  1. GoodJuJu

    GoodJuJu Guest

    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.
     
    GoodJuJu, Feb 7, 2005
    #1
  2. GoodJuJu

    Tom Smith Guest

    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.
     
    Tom Smith, Feb 7, 2005
    #2
  3. GoodJuJu

    Doug Broad Guest

    Google groups -> propstobylayer

    Modify as necessary.


    attributes inside the block without exploding it.
     
    Doug Broad, Feb 7, 2005
    #3
  4. GoodJuJu

    GoodJuJu Guest

    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)
    )
     
    GoodJuJu, Feb 7, 2005
    #4
  5. 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, Feb 7, 2005
    #5
  6. GoodJuJu

    Jeff Mishler Guest

    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 Mishler, Feb 7, 2005
    #6
  7. GoodJuJu

    GoodJuJu Guest

    Thanks Jeff.... on my way now.
     
    GoodJuJu, Feb 8, 2005
    #7
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.