Jump to content

Changing background modelspace without using options-> display -> colors


Recommended Posts

Posted

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

Posted (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 by Biscuits
oops

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...