(Defun C:PTL
(/ PLO_LAYOUTS PLO_CNTR PLO_CNTR2 PLO_LIST PLO_LAYOUTTAB)
(vl-load-com)
(setvar"FILEDIA"0)
(setvar"CMDDIA"0)
(setq PLO_LAYOUTS (vla-get-layouts
(vla-get-activedocument(vlax-get-acad-object)))
PLO_CNTR 0 PLO_CNTR2 0)
(repeat(vla-get-count PLO_LAYOUTS)
(setq PLO_LIST (cons(setq PLO_CNTR (1+ PLO_CNTR)) PLO_LIST)))
(vlax-for PLO_LAYOUT PLO_LAYOUTS
(setq PLO_LIST (subst(vla-get-name PLO_LAYOUT)
(vla-get-taborder PLO_LAYOUT)PLO_LIST)))
(setq PLO_LIST (reverse PLO_LIST))

(while(/= PLO_CNTR2 (1- PLO_CNTR))
(setq PLO_LAYOUTTAB (nth PLO_CNTR2 PLO_LIST))
(setq file (strcat "C:\Publish-PLT-PDF\\" (vl-filename-base (getvar 'DwgName)) "-" PLO_LAYOUTTAB))
(command "-PLOT" "n" PLO_LAYOUTTAB "" "" "" file "" "")
(setq PLO_CNTR2 (1+ PLO_CNTR2)))
(setvar"FILEDIA"1)
(setvar"CMDDIA"1)
(princ))
(c:ptl)

Advertisements