See the top rated post in this thread. Click here

Results 1 to 6 of 6

Thread: Background color switching

  1. #1
    Certifiable AUGI Addict robert.1.hall72202's Avatar
    Join Date
    2004-07
    Location
    Detroit Michigan
    Posts
    2,508
    Login to Give a bone
    2

    Default Background color switching

    I have recently found a need to use a background color changing routine again.

    A simple cut/copy/paste does not require changing the background from
    black to white. However, a jpgout requires the change.

    I thought I would share my favorite routine:

    Code:
     (defun C:BCOLOR ()
      (cond
    	((= (getvar "TileMode") 0)  ;Check Space, Exit if not in ModelSpace
    	 (prompt
    	   "\n***Command only works in ModelSpace, TileMode = 1***"
    	 )
    	)
    	((= (getenv "Background") "16777215")
    	 ;ModelSpace Background colour = White
    	 (setenv "Background" "0")  ;Set ModelSpace Background colour = Black
    	 (setenv "XhairPickboxEtc" "16777215")
    	 ;Set ModelSpace Crosshair colour = White
    	 (setvar "TileMode" 0)  ;Force Display to update
    	 (setvar "TileMode" 1)
    	 (prompt "\n***ModelSpace Background colour set to Black***")
    	)
    	((= (getenv "Background") "0") ;ModelSpace Background colour = Black
    	 (setenv "Background" "16777215") ;Set ModelSpace Background colour = White
    	 (setenv "XhairPickboxEtc" "0") ;Set ModelSpace Crosshair colour = Black
    	 (setvar "TileMode" 0)  ;Force Display to update
    	 (setvar "TileMode" 1)
    	 (prompt "\n***ModelSpace Background colour set to White***")
    	)
    	(T	 ;Exit if ModelSpace Background colour /= Black or White
    	 (prompt "\n***ModelSpace Background colour not altered***")
    	)
      )
      (princ)
    )

  2. #2
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,805
    Login to Give a bone
    0

    Exclamation Re: Background color switching

    Another version can be found here...

    http://rkmcswain.blogspot.com/2007/0...ackground.html
    R.K. McSwain | CAD Panacea |

  3. #3
    Certifiable AUGI Addict robert.1.hall72202's Avatar
    Join Date
    2004-07
    Location
    Detroit Michigan
    Posts
    2,508
    Login to Give a bone
    0

    Default Re: Background color switching

    Nice. That routine is certainly different. Does the trick!

  4. #4
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,805
    Login to Give a bone
    0

    Exclamation Re: Background color switching

    Quote Originally Posted by Robert.Hall
    Nice. That routine is certainly different. Does the trick!
    I typically work with black BG, but I will switch to white when taking screen captures.
    Also, it's handy to be able to toggle from black to white during a seminar or demonstration.

    Much quicker than going through the GUI.
    R.K. McSwain | CAD Panacea |

  5. #5
    AUGI Addict Mr Cory's Avatar
    Join Date
    2007-01
    Location
    Under a Rock over there
    Posts
    1,006
    Login to Give a bone
    0

    Default Re: Background color switching

    Quote Originally Posted by Robert.Hall
    I have recently found a need to use a background color changing routine again.

    A simple cut/copy/paste does not require changing the background from
    black to white. However, a jpgout requires the change.

    I thought I would share my favorite routine:

    Code:
    (defun C:BCOLOR ()
    (cond
    	((= (getvar "TileMode") 0) ;Check Space, Exit if not in ModelSpace
    	 (prompt
    	 "\n***Command only works in ModelSpace, TileMode = 1***"
    	 )
    	)
    	((= (getenv "Background") "16777215")
    	 ;ModelSpace Background colour = White
    	 (setenv "Background" "0") ;Set ModelSpace Background colour = Black
    	 (setenv "XhairPickboxEtc" "16777215")
    	 ;Set ModelSpace Crosshair colour = White
    	 (setvar "TileMode" 0) ;Force Display to update
    	 (setvar "TileMode" 1)
    	 (prompt "\n***ModelSpace Background colour set to Black***")
    	)
    	((= (getenv "Background") "0") ;ModelSpace Background colour = Black
    	 (setenv "Background" "16777215") ;Set ModelSpace Background colour = White
    	 (setenv "XhairPickboxEtc" "0") ;Set ModelSpace Crosshair colour = Black
    	 (setvar "TileMode" 0) ;Force Display to update
    	 (setvar "TileMode" 1)
    	 (prompt "\n***ModelSpace Background colour set to White***")
    	)
    	(T	 ;Exit if ModelSpace Background colour /= Black or White
    	 (prompt "\n***ModelSpace Background colour not altered***")
    	)
    )
    (princ)
    )
    Hay is there anyway to stop this lisp setting the tracking vector to black? Took me ages to figure out what had happened lol

  6. #6
    Active Member
    Join Date
    2007-03
    Posts
    57
    Login to Give a bone
    0

    Default Re: Background color switching

    Original posted here
    http://www.autocad.ru/cgi-bin/f1/board.cgi?t=8288Cp
    Attached Files Attached Files

Similar Threads

  1. Changing Background Color
    By sinanbakir in forum Revit Structure - General
    Replies: 4
    Last Post: 2010-11-12, 04:42 PM
  2. Background color
    By MikeJarosz in forum Revit Architecture - General
    Replies: 8
    Last Post: 2010-11-04, 01:44 PM
  3. Why would MS background change color?
    By kleenhippie in forum CAD Management - General
    Replies: 1
    Last Post: 2008-01-25, 03:06 PM
  4. Background color
    By york in forum AutoCAD Customization
    Replies: 7
    Last Post: 2008-01-03, 09:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •