bhasonson Posted June 18, 2019 Share Posted June 18, 2019 I'm looking for a one-click way to export to PDF file with multiple layouts(in one pdf), with the same name, in the same location as the DWG, that also overwrites any existing PDF files. I have been using this code below to but it only prints 1 layout at a time. Can anyone help me with this task? Thank you! (defun c:moprint ( / cm ) (setq cm (getvar 'CMDECHO)) (setvar 'CMDECHO 0) (command "_.-plot" "_y" (if (= 1 (getvar 'TILEMODE)) "Model" (getvar 'CTAB)) "AutoCAD PDF (High Quality Print).pc3" "ARCH D (24.00 x 36.00 Inches)" "_M" "_L" "_N" "_E" "_F" "_C" "_Y" "monochrome.ctb" "_Y" ) (if (= 1 (getvar 'TILEMODE)) (command "_A") (command "_N" "_Y") ) (command "_N" (strcat (getvar 'DWGPREFIX) (vl-filename-base (getvar 'DWGNAME))) "_Y" "_Y") (setvar 'CMDECHO cm) (princ) ) (vl-load-com) (princ) BS. I don't know who wrote this code but its not mine. Quote Link to comment Share on other sites More sharing options...
maratovich Posted June 18, 2019 Share Posted June 18, 2019 Use the Publish command If you have all title blocks only in Model - attach an example of your dwg file. Quote Link to comment Share on other sites More sharing options...
bhasonson Posted June 18, 2019 Author Share Posted June 18, 2019 I just want to print ALL layout pages and not model space. I'm not very good with code at all. Would replacing "-plot" with "-publish" work? Quote Link to comment Share on other sites More sharing options...
dlanorh Posted June 18, 2019 Share Posted June 18, 2019 Look Here ==> https://www.cadtutor.net/forum/topic/62294-plot-all-layouts-with-one-command/ And Here ==> https://forums.autodesk.com/t5/autocad-forum/printing-all-layouts-at-once-to-a-single-pdf-using-a-button/td-p/5840208 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted June 19, 2019 Share Posted June 19, 2019 (edited) This is an old one plot pdf range of layouts. It has a couple of extras you will need to look at the code carefully it saves the pdfs to a directory under the dwg location, it makes a single pdf for each layout, it is based on 1 title block size can be changed the last step takes advantage of ghostsrcipt to join the pdfs back into 1 pdf. You will need to download ghostscript to do the merge bit. post a dwg with a title block just need a layout with say extents limits and can change code for you. getvals.lsp mergepdfs.lsp plotA3Pdfrange.lsp plotA3Pdfrange2.lsp Edited June 19, 2019 by BIGAL Quote Link to comment Share on other sites More sharing options...
ronjonp Posted June 19, 2019 Share Posted June 19, 2019 As mentioned above, look into Publish and or sheet set manager. Code has not been needed to print multiple tabs to a single PDF in over a decade. Quote Link to comment Share on other sites More sharing options...
bhasonson Posted June 21, 2019 Author Share Posted June 21, 2019 I've been using publish and I have looked into sheet set manager. The main problem with this is saving in the same file directory as the CAD. I have 19 different drivers that I have to access constantly and print cads off of it. Its really time consuming going through publish because I have to go through so many folders and sometimes end up in the wrong folder. Quote Link to comment Share on other sites More sharing options...
maratovich Posted June 21, 2019 Share Posted June 21, 2019 Maybe this will help you: Revers - Automatic batch printing Attach an example of your dwg file, we will give recommendations. Quote Link to comment Share on other sites More sharing options...
ronjonp Posted June 21, 2019 Share Posted June 21, 2019 (edited) 12 hours ago, bhasonson said: I've been using publish and I have looked into sheet set manager. The main problem with this is saving in the same file directory as the CAD. I have 19 different drivers that I have to access constantly and print cads off of it. Its really time consuming going through publish because I have to go through so many folders and sometimes end up in the wrong folder. If you setup a sheet set, you can define the save path for the PDF and even the name of the file. You might also look into running THIS code to help with setting the current directory. What do you mean when you say you have 19 different drivers? Edited June 21, 2019 by ronjonp Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.