michael16tsx Posted August 4, 2010 Posted August 4, 2010 Hello, Im trying to make a button wich if i click it my background in the modelspace changes from white to black. Now i've seen you can do it by using a lisp, but we have ACAD LT 2009 and the lisp option is not included. I know i can use a toolbox, but here at the office they won't buy a special program to get it. Is there any other way to get this done ? with a script or something else ? Thank you! Michael Swertz Quote
Biscuits Posted August 4, 2010 Posted August 4, 2010 (edited) Here's a great routine and macro for creating a button to toggle between black/white background. Credit goes to Miklos Fuccaro Dummy me I just saw you have LT.....maybe someone else can use this though. ^C^C(if c:BG_color (princ)(load "BG_color")) BG_color ;;Background color changer ;;Gary Maze, SMC Corporation of America ;;11/27/02 ;; ;modified by Miklos Fuccaro ;mfuccaro@hotmail.com ;November 2003 ; (defun c:BG_color() (defun wb () ;;white background (setq whitebackground T) (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) ) (defun bb () ;; black background (setq whitebackground nil) _(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 16777215) _) (if whitebackground (bb) (wb)) ) Edited August 4, 2010 by Biscuits oops Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.