Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Toggle model screen color 2

Status
Not open for further replies.

smcadman

Mechanical
Nov 6, 2002
1,589
I used to have a routine that toggled the model screen color from black to white. It was written in VLISP, but I cannot find it anymore. I used it for saving rendered or hidden images with a white background, then I would toggle the screen back to black. Does anyone have this routine or one similar to it?

Flores
 
Replies continue below

Recommended for you

Found this at the bottom of: ***********************************************
;;Background color changer
;;Gary Maze, SMC Corporation of America
;;11/27/02
;;
;;acadobject is the ActiveX component of the AutoCad instance
;;acadpref is the preferences property of acadobject
;;acaddisp is the display propertis of acadpref
;;the background color is the windows color number calculated by the following formula;
;;(65536*blue)+(256*green)+red, where blue, green and red can be 0 (off) to 255 (all the way on)
;;
;;Whiteback makes a whitebackground with a black crosshair
;;
(defun c:whiteback ()
(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)
)
;;
;;Blackback makes a black background and a green crosshair (my personal fave-rave)
;;
(defun c:blackback (/ acadobject acadpref acaddisp)
_(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 65280)
_)

The user just wanted to change his background color to white, but I thought it might be nice to add a restore function as well.
*********************************************
Several other programming efforts at changing colors there too.
 
Thanks Starry, that worked great! I changed the following part in the "blackback" routine:
Code:
_ (vlax-put-property acaddisp 'modelcrosshaircolor 65280)
to read:
Code:
_ (vlax-put-property acaddisp 'modelcrosshaircolor 16777215)

so that I would have a white crosshair with a black screen instead of a green crosshair.

Flores
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor