×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Toggle model screen color
2

Toggle model screen color

Toggle model screen color

(OP)
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

RE: Toggle model screen color

Found this at the bottom of: http://www.vbdesign.net/expresso/archive/topic/840.html
***********************************************
;;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.

RE: Toggle model screen color

(OP)
Thanks Starry, that worked great!  I changed the following part in the "blackback" routine:
_ (vlax-put-property acaddisp 'modelcrosshaircolor 65280)
to read:
_ (vlax-put-property acaddisp 'modelcrosshaircolor 16777215)

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

Flores

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources