Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Layout tab background color variable?

  1. #1
    Member
    Join Date
    2008-08
    Posts
    20
    Login to Give a bone
    0

    Default Layout tab background color variable?

    Is there a system variable for layout tab background color? I have a lisp that switches the show plot styles and lwt on and off, but I want to change the background from black to white as well. I've had trouble finding it.

    thank,
    Josh

  2. #2
    I could stop if I wanted to
    Join Date
    2005-09
    Location
    Canada
    Posts
    214
    Login to Give a bone
    0

    Default Re: Layout tab background color variable?

    r u looking for the BACKGROUNDPLOT variable ?

    or maybe this can help..

    Code:
    (setq AcadPreference (vlax-get-property (vlax-get-acad-object) 'preferences))
    (setq AcadPreferenceDisplay (vlax-get-property AcadPreference 'display))
    (vlax-put-property AcadPreferenceDisplay 'GraphicsWinmodelBackgrndColor 1244);; <- put your color here..
    (vlax-release-object AcadPreference)
    (vlax-release-object AcadPreferenceDisplay)

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

    Exclamation Re: Layout tab background color variable?

    Quote Originally Posted by ss_66ss396 View Post
    Is there a system variable for layout tab background color? I have a lisp that switches the show plot styles and lwt on and off, but I want to change the background from black to white as well. I've had trouble finding it.

    thank,
    Josh
    There is no system variable, but you can change it with lisp. Here is some code that will toggle the MS and PS background color from white to black, and back to white.

    http://cadpanacea.com/node/50
    R.K. McSwain | CAD Panacea |

  4. #4
    Member
    Join Date
    2008-08
    Posts
    20
    Login to Give a bone
    0

    Default Re: Layout tab background color variable?

    That changed the background in the model space. Its the paper space background I want to change. I changed some of your code.

    GraphicsWinmodelBackgrndColor 255);; <- put your color here..

    GraphicsWinlayoutBackgrndColor 255);; <- put your color here..

    This now changes the layout tab, but 255 itself is red. I can't seem to enter the 3 combination color or a white. Black is easy as it is 0. white is 255, 255, 255. When I enter that in, it says there are too many actual parameters.

    Any ideas on how to get "white"?

    thanks, I think we are almost there.

    Josh

  5. #5
    Member
    Join Date
    2008-08
    Posts
    20
    Login to Give a bone
    0

    Default Re: Layout tab background color variable?

    rkmswain-that works beautifully to change the background. now if I can just insert it into the lisp that I have or find what works for white. Here is what I have currently: (Forgive me I don't know how to get it into a code box.) Btw, this changes the show plot styles variable to show or not show, turns on and off the lineweight display, and hopefully will change the background.

    Code:
    (defun C:PST (    ; No arguments.
           /
           acadDocument  ; Holds reference to the active AutoCAD drawing object.
           acadLayout  ; Holds reference to the active Layout object.
           acadObject  ; Holds reference to the AutoCAD object.
           showPStyles  ; Holds current status of PlotStyle display on the active Layout.
          ) ;_ End arguments & local variables.
      (cond     ; Cond A
        ((= (getvar "TILEMODE") 1)  ; Model tab is active, abort command.
          (alert
     (strcat
       "C:PST is meant for use on a Layout tab, not on the Model tab."
       "\nPlease change to a Layout tab and try again."
     ) ;_ End strcat.
          ) ;_ End alert.
        ) ;_ End condition A1.
        (T     ; Condition A2.
         (vl-load-com)   ; Load "vl" functions, if not already loaded.
         (setq
           acadObject     (vlax-get-acad-object)
           acadDocument   (vlax-get-property acadObject 'ActiveDocument)
           acadLayout     (vlax-get-property acadDocument 'ActiveLayout)
           showPStyles    (vlax-get-property acadLayout 'ShowPlotStyles)
         ) ;_ End setq.
         (if (= showPStyles :vlax-true)
           (progn
      (vlax-put-property acadLayout 'ShowPlotStyles :vlax-false)
      (setvar "lwdisplay" 0)
    (setq AcadPreference (vlax-get-property (vlax-get-acad-object) 'preferences))
    (setq AcadPreferenceDisplay (vlax-get-property AcadPreference 'display))
    (vlax-put-property AcadPreferenceDisplay 'GraphicsWinlayoutBackgrndColor 0);; <- put your color here..
    (vlax-release-object AcadPreference)
    (vlax-release-object AcadPreferenceDisplay)
      (prompt "\nThe display of plot styles has been turned off. ")
           ) ;_ End progn.
           (progn
      (vlax-put-property acadLayout 'ShowPlotStyles :vlax-true)
      (setvar "lwdisplay" 1)
    (setq AcadPreference (vlax-get-property (vlax-get-acad-object) 'preferences))
    (setq AcadPreferenceDisplay (vlax-get-property AcadPreference 'display))
    (vlax-put-property AcadPreferenceDisplay 'GraphicsWinlayoutBackgrndColor 16777215);; <- put your color here..
    (vlax-release-object AcadPreference)
    (vlax-release-object AcadPreferenceDisplay)
      (prompt "\nThe display of plot styles has been turned on. ")
           );_ End progn.
         ) ;_ End if.
         (vlax-release-object acadLayout)
         (vlax-release-object acadDocument)
         (vlax-release-object acadObject)
         (command "_.REGENALL")  ; Regenerate the screen graphics.
        ) ;_ End condition A2.
      ) ;_ End cond A.
      (prin1)
    ) ;_ End C:PST.
    Last edited by Opie; 2008-12-29 at 02:19 PM. Reason: [code] tags added, see Moderator Note

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

    Default Re: Layout tab background color variable?

    Quote Originally Posted by ss_66ss396 View Post
    Black is easy as it is 0. white is 255, 255, 255. When I enter that in, it says there are too many actual parameters.

    Any ideas on how to get "white"?
    White is 16777215. This is not a RGB, but rather hex converted to decimal (FFFFFF=16777215)
    R.K. McSwain | CAD Panacea |

  7. #7
    Member
    Join Date
    2008-08
    Posts
    20
    Login to Give a bone
    0

    Default Re: Layout tab background color variable?

    It works! I copied it in from your earlier post, but I must not have loaded it correctly. I attached the lisp if anyone is interested in it. Thanks for all of your help in getting this working!

    Josh
    Attached Files Attached Files
    Last edited by ss_66ss396; 2008-12-24 at 06:50 PM. Reason: credit to all

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

    Default Re: Layout tab background color variable?

    Quote Originally Posted by ss_66ss396 View Post
    (Forgive me I don't know how to get it into a code box.)
    Just surround your code with these tags, like this:


    [code]
    (defun c:foo ()
    (blah blah blah)
    )
    [/code]
    R.K. McSwain | CAD Panacea |

  9. #9
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,419
    Login to Give a bone
    0

    Default Re: Layout tab background color variable?

    If you don't want to type the code tags, click on the "Go Advanced" button and use the # buttton.
    C:> ED WORKING....


    LinkedIn

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

    Default Re: Layout tab background color variable?

    Quote Originally Posted by Ed Jobe View Post
    If you don't want to type the code tags, click on the "Go Advanced" button and use the # buttton.
    Unless you are using the "Basic Editor", then there are no buttons...
    R.K. McSwain | CAD Panacea |

Page 1 of 2 12 LastLast

Similar Threads

  1. 2014: Layout background Colors
    By jonathanschade in forum AutoCAD General
    Replies: 1
    Last Post: 2015-09-09, 04:07 PM
  2. layout name field/variable
    By Maurice.148748 in forum AutoCAD General
    Replies: 2
    Last Post: 2010-11-24, 02:29 PM
  3. Change Background Color for outside layout
    By Capt. Computer Crasher in forum AutoCAD General
    Replies: 2
    Last Post: 2009-11-17, 09:48 PM
  4. Replies: 7
    Last Post: 2006-05-09, 03:46 PM
  5. Is there a variable for the name of the layout?
    By GreyHippo in forum AutoCAD General
    Replies: 1
    Last Post: 2005-08-17, 06:36 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
  •