Jump to content
bhasonson

Plotting to PDF - multiple layouts

Recommended Posts

bhasonson

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.

Share this post


Link to post
Share on other sites
maratovich

Use the Publish command
If you have all title blocks only in Model - attach an example of your dwg file.

Share this post


Link to post
Share on other sites
bhasonson

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?

 

 

Share this post


Link to post
Share on other sites
BIGAL
Posted (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.

 

image.png.5027af1922739c7cdfe72bd5256b9ff0.png

getvals.lsp mergepdfs.lsp

plotA3Pdfrange.lsp plotA3Pdfrange2.lsp

Edited by BIGAL

Share this post


Link to post
Share on other sites
ronjonp

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.

Share this post


Link to post
Share on other sites
bhasonson

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. 

Share this post


Link to post
Share on other sites
ronjonp
Posted (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?

 

image.png.53e89df74f675cb9a5c0f758a26db262.png

Edited by ronjonp

Share this post


Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...