Message 1 of 2
Background color changing option via color book

Not applicable
05-31-2020
01:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Dear Experts,
Below is the code for AutoCAD background color change option.
Requirement is to add an option to select the colour from color book. (User wants to select the color from color book dialogue box)
Thanks in advance to all.
(defun c:tbg (/ col)
(if tbg:flg
(setq col 16777215
tbg:flg nil
)
(setq col 0
tbg:flg t
)
)
(foreach prp '(graphicswinmodelbackgrndcolor
modelcrosshaircolor
graphicswinlayoutbackgrndcolor
layoutcrosshaircolor
)
(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)