Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Display plot styles to all layouts

6 REPLIES 6
Reply
Message 1 of 7
polverini.1054591
830 Views, 6 Replies

Display plot styles to all layouts

Hello, is there a way to tick the box "display plot styles" to all layouts? I have many files with many layouts each, and to have a control on the actual plot status I would like to do that, but having to do it on every single layout would be painful. Is there a solution for this?

6 REPLIES 6
Message 2 of 7

Probably not. But I have a routine that will do that for me.

 

(vl-load-com)

(defun c:ShowPlotStyleAll ( /  adoc alays)
  (setq acdoc (vla-get-activedocument (vlax-get-acad-object))
	aclays (vla-get-layouts acdoc))
  (vlax-for lay aclays
    (if (eq :vlax-false (vla-get-modeltype lay))
      (vlax-put-property lay 'ShowPlotStyles :vlax-true)))
  (command "_.REGENALL")
  (prompt "\n'Display plot styles' option applid to all layouts.")
  (princ)
  )

 

Message 3 of 7

how to deactivate the above line command

Message 4 of 7
pendean
in reply to: expellius_titus


@expellius_titus wrote:

how to deactivate the above line command


Remove the LISP always works.

Message 5 of 7

Sorry for the old thread bump, but looking for a LISP to undo this.  Basically i'd like to be able to toggle my paper space from what it'll look like when it prints (white background and plotstyles on) to my layer colors and blackbackground (how i work)  I have everything working except when i switch back to the blackbackground, it won't switch the plotstyles back.  I'm a novice with LSP.  I tried just changing false/true, but it didn't work.  The above text in this thread is in the first wb command and works.  It's the second part in the db command where i'm trying to get it to shut them off.

 

(defun c: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 'GraphicsWinLayoutBackgrndColor 16777215)
    _ _ _(vlax-put-property acaddisp 'ModelCrosshairColor 0)
   (setq acdoc (vla-get-activedocument (vlax-get-acad-object))
aclays (vla-get-layouts acdoc))
  (vlax-for lay aclays
    (if (eq :vlax-false (vla-get-modeltype lay))
      (vlax-put-property lay 'ShowPlotStyles :vlax-true)))
  (command "_.REGENALL")
  (prompt "\n'Display plot styles' option applid to all layouts.")
  (princ)
    )
 
(defun c:db () ;; 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 'GraphicsWinLayoutBackgrndColor 0)
  _ (vlax-put-property acaddisp 'ModelCrosshairColor 16777215)
  _)
 (setq acdoc (vla-get-activedocument (vlax-get-acad-object))
aclays (vla-get-layouts acdoc))
  (vlax-for lay aclays
    (if (eq :vlax-true (vla-get-modeltype lay))
      (vlax-put-property lay 'ShowPlotStyles :vlax-false)))
  (command "_.REGENALL")
  (prompt "\n'Display plot styles' option applid to all layouts.")
  (princ)
 
  (if whitebackground (db) (wb))
Message 6 of 7
pendean
in reply to: joe.augusten


@joe.augusten wrote:

Sorry for the old thread bump, but looking for a LISP to undo this...


This LISP, either typed or called from a button on your QAT will turn on/off the feature in the layout you are on just by tapping it, I use that here in my QAT bar when I don't feel like typing 🙂

pendean_0-1719494547996.png

 

; PST.lsp toggles Layout tabs Display Plot Styles settings On or Off
; http://architects-desktop.blogspot.com/2008/01/toggling-plot-style-display-in-layout.html
(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)  
          (prompt "\nThe display of plot styles has been turned off. ")       
         ) ;_ End progn.       
         (progn  
          (vlax-put-property acadLayout 'ShowPlotStyles :vlax-true)  
          (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.

 

 

 

 

 

Message 7 of 7
ВeekeeCZ
in reply to: joe.augusten


@joe.augusten wrote:

Sorry for the old thread bump, but looking for a LISP to undo this.  Basically i'd like to be able to toggle my paper space from what it'll look like when it prints (white background and plotstyles on) to my layer colors and blackbackground (how i work)  I have everything working except when i switch back to the blackbackground, it won't switch the plotstyles back.  I'm a novice with LSP.  I tried just changing false/true, but it didn't work.  The above text in this thread is in the first wb command and works.  It's the second part in the db command where i'm trying to get it to shut them off.

 

(defun c: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 'GraphicsWinLayoutBackgrndColor 16777215)
    _ _ _(vlax-put-property acaddisp 'ModelCrosshairColor 0)
   (setq acdoc (vla-get-activedocument (vlax-get-acad-object))
aclays (vla-get-layouts acdoc))
  (vlax-for lay aclays
    (if (eq :vlax-false (vla-get-modeltype lay))
      (vlax-put-property lay 'ShowPlotStyles :vlax-true)))
  (command "_.REGENALL")
  (prompt "\n'Display plot styles' option applid to all layouts.")
  (princ)
    )
 
(defun c:db () ;; 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 'GraphicsWinLayoutBackgrndColor 0)
  _ (vlax-put-property acaddisp 'ModelCrosshairColor 16777215)
  _)
 (setq acdoc (vla-get-activedocument (vlax-get-acad-object))
aclays (vla-get-layouts acdoc))
  (vlax-for lay aclays
    (if (eq :vlax-true (vla-get-modeltype lay))
      (vlax-put-property lay 'ShowPlotStyles :vlax-false)))
  (command "_.REGENALL")
  (prompt "\n'Display plot styles' option applid to all layouts.")
  (princ)
 
  (if whitebackground (c:db) (c:wb))

 

not too bad.

an extra parent, missing c:

 

(defun c:wb ( / acadobject acadpref acaddisp acdoc aclays) ;;white background
  (setq *whitebackground* T) ; just to mark a global variable
  (setq acadobject (vlax-get-acad-object))
  (setq acadpref (vlax-get-property acadobject 'preferences))
  (setq acaddisp (vlax-get-property acadpref 'display))
  (vlax-put-property acaddisp 'GraphicsWinLayoutBackgrndColor 16777215)
  (vlax-put-property acaddisp 'ModelCrosshairColor 0)
  (setq acdoc (vla-get-activedocument (vlax-get-acad-object))
	aclays (vla-get-layouts acdoc))
  (vlax-for lay aclays
    (vlax-put-property lay 'ShowPlotStyles :vlax-true))
  (command ".REGENALL")
  (prompt "\n'Display plot styles' option applid to all layouts.")
  (princ)
  )

(defun c:db ( / acadobject acadpref acaddisp acdoc aclays) ;; 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 'GraphicsWinLayoutBackgrndColor 0)
  (vlax-put-property acaddisp 'ModelCrosshairColor 16777215)
  
  (setq acdoc (vla-get-activedocument (vlax-get-acad-object))
	aclays (vla-get-layouts acdoc))
  (vlax-for lay aclays
    (vlax-put-property lay 'ShowPlotStyles :vlax-false))
  (command ".REGENALL")
  (prompt "\n'Display plot styles' option turned off to all layouts.")
  (princ)
  )

(defun c:tb ()
  (if *whitebackground* (c:db) (c:wb))
  (princ)
  )

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report