아래는 오토캐드의 배경색을 검정색과 흰색으로 켬끔하는 두가지 리습입니다.

리맥 대단합니다.

 

출처 : http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-routine-for-changing-color-of-background-in-model-space/td-p/4724669

 

 

(defun c:tbg()
  (defun wb () ;;white background
    (setq whitebackground T)
    (setq acadobject (vlax-get-acad-object))
    (setq acadpref (vlax-get-property acadobject 'preferences))
    (setq acaddisp (vlax-get-property acadpref 'display))
    (vlax-put-property acaddisp 'GraphicsWinmodelBackgrndColor 16777215)
    (vlax-put-property acaddisp 'ModelCrosshairColor 0)
  )

  (defun bbb () ;; black background
    (setq whitebackground nil)
    (setq acadobject (vlax-get-acad-object))
    (setq acadpref (vlax-get-property acadobject 'preferences))
    (setq acaddisp (vlax-get-property acadpref 'display))
    (vlax-put-property acaddisp 'GraphicsWinmodelBackgrndColor 0)
    (vlax-put-property acaddisp 'ModelCrosshairColor 16777215)
  )

  (if whitebackground (bbb) (wb))
)



-------------------------------------------------------

 (defun c:tbg ( / col )
    (if tbg:flg
        (setq col 16777215 tbg:flg nil)
        (setq col 0        tbg:flg  t )
    )
    (foreach prp '(graphicswinmodelbackgrndcolor modelcrosshaircolor)
        (vlax-put-property (acdisp) prp (setq col (- 16777215 col)))
    )
    (princ)
)
(defun acdisp nil
    (eval
        (list 'defun 'acdisp 'nil
            (vla-get-display (vla-get-preferences (vlax-get-acad-object)))
        )
    )
    (acdisp)
)
(vl-load-com) (princ)