Multi Layouts to one PDF

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
So I created this program with some help from many on this site. It does exactly what I want. Gets Layout Tabs names, checks to see if "Sheet1" is there, if so created several PDFs for each layout tab, if layout tab is not named "sheet1" it creates one PDF for Layout1 tab. The group requesting this has come back to me and was wondering if the routine can print all layout tabs with "Sheet" to one PDF with several pages instead of several PDFs.
I saw a few other post but they seem to be in a different direction, Any help would be much appreciated.
For this to work the layout tabs need to be Sheet1, Sheet2, Sheet3, etc..
(defun c:massplot ()
;Gets layout name
(Setq laynm (vla-get-name (vla-get-ActiveLayout(vla-get-ActiveDocument(vlax-get-acad-object)))))
(if
(or
;checks to see if layout name is the word sheet1
(= laynm "Sheet1")
);or
;Multiplot
(progn
(foreach lay (layoutlist)
(setvar 'CTab lay)
(COMMAND "-PLOT" "Y" "" "DWG To PDF.pc3" "ANSI B (11.00 x 17.00 Inches)" "Inches" "Landscape" "No" "Extents" "Fit" "Center" "Yes" "monochrome.ctb" "Y" "N" "N" "N" "" "N" "y")
)
;returns to sheet1
(command "layout" "set" "Sheet1")
)
;Single plot
(command "-plot" "Y" "" "DWG To PDF.pc3" "ANSI B (11.00 x 17.00 Inches)" "Inches" "Landscape" "No" "Extents" "Fit" "Center" "Yes" "monochrome.ctb" "Y" "N" "N" "N" "" "N" "y")
);if
(princ)
);End
AutoCAD Mechanical 2015