(defun c:tbg ( / col theme )
    (if tbg:flg
        (progn
            (setq col 16777215 tbg:flg nil theme 0) ; Fondo blanco y tema claro
        )
        (progn
            (setq col 0 tbg:flg t theme 1) ; Fondo negro y tema oscuro
        )
    )
    ;; Cambiar el color de fondo y el color del cursor
    (foreach prp '(graphicswinmodelbackgrndcolor modelcrosshaircolor)
        (vlax-put-property (acdisp) prp (setq col (- 16777215 col)))
    )
    ;; Cambiar el tema de la interfaz
    (setvar 'colortheme theme)
    (princ)
)

(defun acdisp nil
    (eval
        (list 'defun 'acdisp 'nil
            (vla-get-display (vla-get-preferences (vlax-get-acad-object)))
        )
    )
    (acdisp)
)

(vl-load-com) (princ)