;Set/list "display plot styles" for all layouts
;2025, www.cadforum.cz
(vl-load-com)
(defun c:PlotStyleAll ( / on? adoc alayouts lay)
  (setq acdoc (vla-get-activedocument (vlax-get-acad-object))
        alayouts (vla-get-layouts acdoc))
  (initget "On oFf List")
  (setq on? (getkword "\nDisplay plot style in all layouts [On/oFf/List]: "))
  (vlax-for lay alayouts
   (if (eq :vlax-false (vla-get-modeltype lay));not Model
    (cond
     ((= on? "On")  (vlax-put-property lay 'ShowPlotStyles :vlax-true))
     ((= on? "oFf") (vlax-put-property lay 'ShowPlotStyles :vlax-false))
     ((= on? "List")(princ (vla-get-name lay))
                    (princ (if (eq :vlax-true (vla-get-ShowPlotStyles lay)) "=ON | " "=off | ")))
     (T (princ))
    );cond
   );if
  );for
  (if (/= on? "List")(vla-regen acdoc acallviewports))
  (prompt (strcat "\nDisplay plot styles now " on? " for all layouts."))
  (princ)
)