TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: MP on April 26, 2020, 12:47:04 PM
-
In a recent LinkedIn post Sam Lucida discussed the creation of light and dark profiles to make it easy for him to switch between his working (dark mode) and documenting (light mode) environments. It's a great idea but I also thought it should be easy to toggle via a system variable, and it is:
(setvar 'colortheme (abs (1- (getvar 'colortheme))))
If you prefer a command simply:
(defun c:mode ( )
(princ
(strcat "\n"
(nth (setvar 'colortheme (abs (1- (getvar 'colortheme)))) '("Dark" "Light"))
" mode active."
)
)
(princ)
)
Cheers.
-
I guess you could also use (- 1 (getvar 'colortheme)) to avoid wearing out your abs. :lol:
-
Very nice MP, I love the way it seem.
-
Can I play?
You could also use (boole 6 (getvar 'colortheme) 1) to avoid wearing out your...math?
-
Nice
I would have called it Mood in lieu of Mode
In a recent LinkedIn post Sam Lucida discussed the creation of light and dark profiles to make it easy for him to switch between his working (dark mode) and documenting (light mode) environments. It's a great idea but I also thought it should be easy to toggle via a system variable, and it is:
(setvar 'colortheme (abs (1- (getvar 'colortheme))))
If you prefer a command simply:
(defun c:mode ( )
(princ
(strcat "\n"
(nth (setvar 'colortheme (abs (1- (getvar 'colortheme)))) '("Dark" "Light"))
" mode active."
)
)
(princ)
)
Cheers.
-
I would have called it Mood in lieu of Mode
(boole 6 (getvar 'colortheme) 1)
Very nice MP, I love the way it seem.
(- 1 (getvar 'colortheme))
(http://saneteachers.files.wordpress.com/2015/12/1508162_471028019730233_202295764181390168_n.png)
And ...
(defun c:Mood ( )
;; M.Puckett, 2020 (inspired by Sam Lucido).
(princ
(strcat "\n"
(nth
(setvar 'colortheme (~ (- (getvar 'colortheme) 2)))
'("Dark" "Light")
)
" mode active."
)
)
(princ)
)
-
Oh, you beat me to the BNOT. :)
-
Oh, you beat me to the BNOT. :)
as well as:
(rem 3 (+ 2 (getvar 'colortheme)))
(logand 1 (1+ (getvar 'colortheme)))
:-P
-
Along those lines.
When asked to customize the colors for the company.
(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 65986) ;;Model space background
(vlax-put-property acaddisp 'GraphicsWinLayoutBackgrndColor 63434) ;;command area
(vlax-put-property acaddisp 'ModelCrosshairColor 865785);; crosshairs
(vlax-put-property acaddisp 'TextWinBackgrndColor 3687) ;;command area
-
Add CUI macro
Set Display Name to: $(if,$(=,0,$(getvar,colortheme)),!.)Dark Mode
Set Macro: ^P(ai_onoff "colortheme") ^P
-
Add CUI macro ...
Along those lines ...
{like}
-
Gents, thanks for your solutions. Just adding to the collection,
(setvar 'colortheme (1+ (- (getvar 'colortheme))))
(setvar 'colortheme (lsh 1 (- (getvar 'colortheme))))
(setvar 'colortheme (nth (getvar 'colortheme) '(1 0)))
(setvar 'colortheme (fix (distance '(1 0 0) (list (getvar 'colortheme) 0 0))))