Set my Pagesetup "error"

Set my Pagesetup "error"

Automohan
Advocate Advocate
485 Views
1 Reply
Message 1 of 2

Set my Pagesetup "error"

Automohan
Advocate
Advocate

My pagesetup name = pdf.m-2021

not working !

; pdf.m-2021 - the Page Setup Name
; all - a flag, T for all nil for current layout
(defun SetNamePageSetupAllLayouts (pdf.m-2021 all / lst)
   (or adoc (setq adoc (vla-get-ActiveDocument (vlax-get-acad-object))))
   (if (vl-position
          pdf.m-2021
          (vlax-for pltcfg (vla-get-plotconfigurations adoc)
             (setq lst (cons (vlax-get pltcfg 'pdf.m-2021) lst))
          )
       )
      (progn
         (vlax-for layt (vla-get-Layouts adoc)
            (if (/= (vla-get-name layt) "Model")
               (if all
                  (vla-copyfrom layt (vla-item (vla-get-PlotConfigurations adoc) pdf.m-2021))
                  (if (= (vla-get-name layt) (getvar 'ctab))
                     (vla-copyfrom layt (vla-item (vla-get-PlotConfigurations adoc) pdf.m-2021))
                  )
               )
            )
         )
         (vla-Regen adoc acActiveViewport)
      )
   )
)
; to change to MyPagesetup all layouts
(defun c:demo nil
   (SetNamePageSetupAllLayouts "pdf.m-2021" T)
   (princ)
)

; to change to MyPagesetup just the active layout
(defun c:demo1 nil
   (SetNamePageSetupAllLayouts "pdf.m-2021" nil)
   (princ)
)

 

"Save Energy"
Did you find this reply helpful? If so please use the Accept as Solution
0 Likes
486 Views
1 Reply
Reply (1)
Message 2 of 2

Automohan
Advocate
Advocate

Remove this Thread !

"Save Energy"
Did you find this reply helpful? If so please use the Accept as Solution
0 Likes