Results 1 to 8 of 8

Thread: Change / Switch Background colour?

  1. #1
    Member
    Join Date
    2000-12
    Posts
    14

    Lightbulb Change / Switch Background colour?

    I want to make a macro or a custom button to change the background from black to white and white to black. I work in black but need to go to white for screen captures and then back to black to work. A button/macro would save considerable time. Any help woul be appreciated.

    Seppy

  2. #2
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,227

    Default Re: Change / Switch Background colour?

    Quote Originally Posted by joe.szanyi
    I want to make a macro or a custom button to change the background from black to white and white to black. I work in black but need to go to white for screen captures and then back to black to work. A button/macro would save considerable time. Any help woul be appreciated.

    Seppy
    Hi Seppy
    Here is an example from ActiveX and VBA Reference Help file

    Code:
    Sub Example_GraphicsWinModelBackgrndColor()
        ' This example returns the current setting of
        ' GraphicsWinModelBackgrndColor. It then changes the value, and finally
        ' it resets the value back to the original setting.
        
        Dim preferences As AcadPreferences
        Dim currGraphicsWinModelBackgrndColor As OLE_COLOR
        
        Set preferences = ThisDrawing.Application.preferences
        
        ' Retrieve the current GraphicsWinModelBackgrndColor value
        currGraphicsWinModelBackgrndColor = preferences.Display.GraphicsWinModelBackgrndColor
        MsgBox "The current value for GraphicsWinModelBackgrndColor is " _
                & preferences.Display.GraphicsWinModelBackgrndColor, vbInformation, "GraphicsWinModelBackgrndColor Example"
        
        ' Change the value for GraphicsWinModelBackgrndColor
        preferences.Display.GraphicsWinModelBackgrndColor = 16
        MsgBox "The new value for GraphicsWinModelBackgrndColor is " _
                & preferences.Display.GraphicsWinModelBackgrndColor, vbInformation, "GraphicsWinModelBackgrndColor Example"
        
        ' Reset GraphicsWinModelBackgrndColor to its original value
        preferences.Display.GraphicsWinModelBackgrndColor = currGraphicsWinModelBackgrndColor
        MsgBox "The GraphicsWinModelBackgrndColor value is reset to " _
                & preferences.Display.GraphicsWinModelBackgrndColor, vbInformation, "GraphicsWinModelBackgrndColor Example"
    End Sub
    You need take a look at GraphicsWinLayoutBackgrndColor property
    in this Help file also

    Hth

    ~'J'~
    "The whole problem with the world is that fools and fanatics are always
    so certain of themselves, and wiser people so full of doubts."
    Bertrand Russell

  3. #3
    Member
    Join Date
    2000-12
    Posts
    14

    Default Re: Change / Switch Background colour?

    Thanks Fixo,

    How do I find the help file that you reference? I pasted this example into the VBA editor and nothing happened when I ran it (the message boxes came up but that was about it). I played with different colours and numbers but nothing happened. If I can find the help file where you got this example from I believe I could work my way through it.

    Seppy

  4. #4
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,227

    Default Re: Change / Switch Background colour?

    Quote Originally Posted by joe.szanyi
    Thanks Fixo,

    How do I find the help file that you reference? I pasted this example into the VBA editor and nothing happened when I ran it (the message boxes came up but that was about it). I played with different colours and numbers but nothing happened. If I can find the help file where you got this example from I believe I could work my way through it.

    Seppy
    Open module with this code,
    say select GraphicsWinModelBackgrndColor word
    then press F1 and you will be on this Help file page
    I've tested this example in A2005 only, works fine for me
    This one changed screen color from white to black
    and otherwise

    ~'J'~
    "The whole problem with the world is that fools and fanatics are always
    so certain of themselves, and wiser people so full of doubts."
    Bertrand Russell

  5. #5
    Member
    Join Date
    2000-12
    Posts
    14

    Default Re: Change / Switch Background colour?

    That's all that I needed! Thanks for the quick answers! People like you make this forum awsome!

    Seppy

  6. #6
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    6,854

    Default Re: Change / Switch Background colour?

    The following AutoLISP code snippets will do this. You could put them on two separate buttons on a toolbar.

    Code:
    ;White Background
    (COMMAND "VBASTMT" "ThisDrawing.Application.Preferences.Display.GraphicsWinModelBackgrndColor = 16777215")
    Code:
    ;Black Background
    (COMMAND "VBASTMT" "ThisDrawing.Application.Preferences.Display.GraphicsWinModelBackgrndColor = 0")
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  7. #7
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,227

    Default Re: Change / Switch Background colour?

    Quote Originally Posted by joe.szanyi
    That's all that I needed! Thanks for the quick answers! People like you make this forum awsome!

    Seppy
    C'mon
    No flowers please
    I am no so smart as you means
    Happy computing
    Cheers


    ~'J'~
    "The whole problem with the world is that fools and fanatics are always
    so certain of themselves, and wiser people so full of doubts."
    Bertrand Russell

  8. #8
    I could stop if I wanted to
    Join Date
    2006-05
    Posts
    260

    Default Re: Change / Switch Background colour?

    Quote Originally Posted by joe.szanyi
    I work in black but need to go to white for screen captures and then back to black to work. A button/macro would save considerable time. Any help woul be appreciated.

    Seppy
    Hi Seppy,

    If you capture in WMF format, you can have a look at these two system variables also.

    WMFBKGND
    WMFFOREGND

    Regards,
    Abdul Huck

Similar Threads

  1. Phase Override Background Cut Colour
    By d.stairmand in forum Revit Architecture - General
    Replies: 0
    Last Post: 2010-04-12, 02:46 AM
  2. Background colour
    By wernerfontein in forum AutoCAD General
    Replies: 5
    Last Post: 2009-10-06, 03:41 PM
  3. Change all Objects of one colour to another colour
    By tburke in forum AutoCAD General
    Replies: 11
    Last Post: 2006-10-17, 02:55 PM
  4. Text background masking, make default and change its colour
    By nick.107433 in forum AutoCAD General
    Replies: 3
    Last Post: 2006-03-02, 11:11 AM
  5. background colour in elevation
    By Max Lloyd in forum Revit Architecture - General
    Replies: 2
    Last Post: 2005-07-11, 03:02 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
  •