Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

background colors

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
eswartwout
646 Views, 5 Replies

background colors

Our corporate Autocad standards recently change from all drawings having a black background to all drawings having a white background. This renders many of our layers to become invisible when opened in a white background. I have to spend hours going thru drawings changing all light colors to dark colors in order to be seen against a white background. Is there anything that can be done to make this task easier?

 

5 REPLIES 5
Message 2 of 6
pendean
in reply to: eswartwout

Nope, sorry.

PS: that's a, well, pointless "standard" on the face of it, what triggered that quirky need? Are you all in an eye-strain study?
Message 3 of 6
p_mcknight
in reply to: eswartwout

If you were to make a list of the colors that you currently use crossed to the colors that you would like to use it wouldn;t be too difficult to write a small program that you could run on your drawings to change everything for you in a single command.  If you make the list, I'll help with the program.

Message 4 of 6
p_mcknight
in reply to: p_mcknight

Below is a pretty simple command to translate the layer colors from whatever they are currently to something new.  I started an arbitrary translation list in the program.  You will need to modify it to suit your needs/colors.  Do you know how to modify lisp programs and run them in AutoCAD?  If you need help with that then let me know.  The program will only work with indexed colors.  If you guys assign true colors or such to any of your layers we will need to modify the program to work with those as well.  I hope this helps some.

 

 

(defun c:changecolors ( / layerList d l cross)
  (setq layerList '((7 15) (11 16) (80 17) (94 18) (50 19) (54 20) (42 21) (65  22))) ;First number is the current color, second is the new color
  (setq d (vla-get-activedocument (vlax-get-acad-object)))
  (vlax-for l (vla-get-layers d)
    (terpri)
    (princ (vla-get-color l))
    (if (setq cross (assoc (vla-get-color l) layerList))
      (vla-put-color l (cadr cross))
      )
    (princ " : ")
    (princ (vla-get-color l))
    (princ " : ")
    (princ (vla-get-name l))
    )
  (vla-regen d acallviewports)
  (alert "Translation complete. ")
  (princ)
  )
(vl-load-com) (princ)

Message 5 of 6
eswartwout
in reply to: p_mcknight

Thanks for the program but there is no real standard list of template colors and template names. The main color that we have issues with is yellow. If the LSP would find any layer with a color of yellow (whatever that index is) and change it to black, that would accomplish 90% of what I am trying to do.

Message 6 of 6
p_mcknight
in reply to: eswartwout

Yellow is index 2 and white/black is index 7.  That said replace

(setq layerList '((7 15) (11 16) (80 17) (94 18) (50 19) (54 20) (42 21) (65  22)))

with just

(setq layerList '((2 7)))

and run the program.  Alternatively, if you want black instead of AutoCADs default white/black you could replace the 7 with 255.

Let me know if this works for you.  Also, if you go in the color index you could create a general list with all of the light colors replacing to 7.  It wouldn't be too hard to change the program to accept a range of colors to replace but I'll leave that to you if you would like to go that route.

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

Post to forums  

Autodesk Design & Make Report

”Boost