Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

How can we ban yellow color on autocad for good?

behzatyaras
Participant

How can we ban yellow color on autocad for good?

behzatyaras
Participant
Participant

Hi All,

 

As a furniture manufacturer, we are collaborating with a project company on a project. In all the files sent by the project company, the most critical points are always drawn in yellow. It’s not feasible for us to manually open each file and change the yellow-colored objects or layers to another color, as the total number of files is in the thousands. Is there a way to ensure that whenever we open a file, yellow appears as black in the model or layout views? I've tried many methods but haven’t succeeded. If it were up to me, I would ban yellow from AutoCAD entirely! 😄 Does anyone have a solution?

0 Likes
Reply
Accepted solutions (2)
853 Views
27 Replies
Replies (27)

behzatyaras
Participant
Participant

Look the attachment below please. Its not about monitor or lineweight. 

 

Ekran görüntüsü 2024-12-13 194346.png

0 Likes

ВeekeeCZ
Consultant
Consultant

Yes, that is why so many people use a black background - including me.

0 Likes

ec-cad
Advocate
Advocate

Perhaps just put on your Sun Glasses ?

🙂

ECCAD

Bratz2
Collaborator
Collaborator

This is a color many color blind individuals use. I can't see it getting removed for good.

0 Likes

Sea-Haven
Mentor
Mentor

You can set any color you want as background even rgb colors so maybe a light grey would be better than white. Options, Display, Background color

DGCSCAD
Advocate
Advocate
Accepted solution

@behzatyaras wrote:

Thank you for your reply. I tried to use lisp file with the help of chatgpt but still no use..
Here is what i used, maybe somebody else will use it.

(defun c:grayscale ()
(setq allObjects (ssget "X")) ; Tüm nesneleri seç
(if allObjects
(progn
(repeat (sslength allObjects)
(setq obj (vlax-ename->vla-object (ssname allObjects 0)))
(vla-put-TrueColor obj 8421504) ; Gri (RGB 128,128,128)
)
(princ "\nTüm nesneler grayscale olarak ayarlandı.")
)
(princ "\nÇizimde nesne bulunamadı.")
)
(princ)
)


AI still has some gaps to fill in, but it can be a good place to start if one needs a nudge.

 

Try this method. I had a little help with Tharwat's code from here: https://www.cadtutor.net/forum/topic/74449-lisp-routine-to-replace-the-colour-yellow/

 

(defun c:Ban2 ()
(command "SETBYLAYER" "All" "" "Y" "Y")
    (vlax-for layer (vla-get-Layers (vla-get-ActiveDocument (vlax-get-Acad-Object)))
	(if (= 2 (vla-get-Color layer))(vla-put-Color layer 7)))
    (prin1)
)
(vl-load-com)

 

This sets all objects to BYLAYER, then changes all layers with color 2 (yellow) to 7 (black/white).

AutoCad 2018 (full)
Win 11 Pro
0 Likes

pkenewell6347
Enthusiast
Enthusiast

Why not just put a simple routine in your startup lisp file (acaddoc.lsp) like the following. This will change all layers and all objects that are not set to bylayer. You can pick the alternate ACI color by changing the value of "c" in the code. Right now I have it set to orange (20). If you need a truecolor instead - it will take a bit more coding.

(defun BanYellow (/ c e l ss)
   ;; Index color to change to from Yellow
   (setq c 20)
   
   (setq e (tblnext "LAYER" T))
   (While e
      (if (= (cdr (assoc 62 e)) 2)
         (progn
            (setq l (entget (tblobjname "LAYER" (cdr (assoc 2 e)))))
            (entmod (subst (cons 62 c) (assoc 62 l) l))
         )
      )
      (setq e (tblnext "LAYER"))
   )
   (if (setq ss (ssget "X" '((62 . 2))))
      (command "._chprop" ss "" "_C" c "");; You could also use BYLAYER here instead of c
   )
)

;; Run function
(banyellow)

  

0 Likes

kczerwonka
Advocate
Advocate

Yes! ... Thats exactly what I do. It helps to see Yellow and Blue on a White or Black background. It works great!