Changing color of mtext universally in a drawing

Discussion in 'AutoCAD' started by Yanko, Feb 3, 2008.

  1. Yanko

    Yanko Guest

    I have a situation where I have to clean up architectural drawings from
    outside our office... They come with all the text in blue (mtext)... I work
    with a black background and would like to change all the text to a light
    color, without having to double click on each bit of mtext and manually change
    it to something light.

    Is there a setvar or something similar that I can set to force all mtext to
    conform to what I want... Or a list routine that I can run

    Thanx
     
    Yanko, Feb 3, 2008
    #1
  2. You could use the FILTER and CHANGE commands to do that
     
    Michael Bulatovich, Feb 4, 2008
    #2
  3. Yanko

    alanjt Guest

    try this. you can pick anything in a drawing that is say the color
    BLUE and it will change everything that is BLUE in the drawing (by
    layer) to a newly selected layer.

    ;|
    ************************************************************************
    GCC.LSP - (c) 1998 Tee Square Graphics

    Global Color Changer for AutoCAD R14. Changes all objects and layer
    definitions of a selected color to a different color of user's
    choice.

    (load "GCC") to load, GCC<enter> to run.
    ************************************************************************
    |;

    (defun C:GCC (/ cmd old ent clr lyr new ss col)
    (command "_.undo" "_be")
    (setq cmd (getvar "cmdecho")
    old (entsel "\nPick Object of Color to change: ")
    ent (entget (car old))
    clr (cdr (assoc 62 ent))
    lyr (cdr (assoc 8 ent)))
    (if (null clr)
    (setq clr (cdr (assoc 62 (tblsearch "layer" lyr)))))
    (setq new (acad_colordlg clr nil)
    ss (ssget "x" (list (cons 62 clr)))
    lyr (tblnext "layer" T))
    (if ss
    (command "_.chprop" ss "" "_c" new ""))
    (while lyr
    (setq ent (entget (tblobjname "layer" (cdr (assoc 2 lyr))))
    lyr (tblnext "layer"))
    (if (= (cdr (setq col (assoc 62 ent))) clr)
    (progn
    (setq ent (subst (cons 62 new) col ent))
    (entmod ent))))
    (setvar "cmdecho" cmd)
    (command "_.undo" "_e")
    (princ)
    )
    (alert (strcat
    "GCC.LSP - (c) 1998 Tee Square Graphics\n\n"
    "Global Color Changer (Objects and Layers)\n"
    " Type GCC<enter> to start."))
    (princ)



    hope this helps.
     
    alanjt, Feb 4, 2008
    #3
  4. Yanko

    Yanko Guest


    Thanks for all the suggestions... Unfortunately none of them worked
    I finally decided I'd go back to the old days and attack the database...
    dxfout, then used windows notepad to search and replace as needed... A lot
    faster than text editing each piece of mtext... (maybe not as fast as somebody
    probably knows aout there)

    If I listed the text I would get something like This:

    "{\C174;\lSTEP IN L26 CLG. SLAB}"

    in notepad I would search and remove: "{\C174;\l" and "}"

    reducing the text to: "STEP IN L26 CLG. SLAB"

    then the layer would determine the colour "bylayer"

    again, thanks.
     
    Yanko, Feb 5, 2008
    #4
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.