Message 1 of 5

Not applicable
05-09-2019
04:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
The below code can toggle mode space background from white to black and vice versa. But not working in paper space
(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)
(defun c:TB8 ()
(vl-load-com)
(setq disp (vla-get-display (vla-get-preferences (vlax-get-acad-object))))
(setq drafting (vla-get-drafting (vla-get-preferences (vlax-get-acad-object))))
(vla-put-GraphicsWinModelBackgrndColor disp 5987163)
(vla-put-GraphicsWinLayoutBackgrndColor disp 5987163)
(vla-put-LayoutCrosshairColor disp 16777215)
(vla-put-ModelCrosshairColor disp 16777215)
(vla-put-AutoTrackingVecColor disp 16777215)
(vla-put-AutoSnapMarkerColor drafting 2)
(princ)
)
Requesting you to please update the code.
Solved! Go to Solution.