vitruvius Posted February 7, 2017 Share Posted February 7, 2017 hello, I am currently able to use "dwg to pdf" in a script file to adjust layers in a drawing, etc, and automatically print to pdf where the pdf file name (the dwg file name I am plotting from) and location (same folder that dwg files are in) are set by default. I am also able to specify a custom path and file name. However, I would like to know if I can specify the path and then allow the pdf name to be the default name, which would be the name of the dwg file. I have not been able to do this in a script. Ultimately, I would like to use this script in ScriptPro so that I can direct pdfs to a custom folder, while using the default file name, for a group of drawings. thx /v Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 8, 2017 Share Posted February 8, 2017 You can script plotting pdfs very simply by using a lisp called from thescript this way all the hard stuff is done in the lisp. Open dwg1 (load "plotallpdf") close n I have the following Plot a range of layout tabs and Make a pdf for each layout but combine also all into 1 pdf. You need to download Ghostscript for the combine pdf part. plotA3Pdfrange2.lsp GETVALS.lsp Quote Link to comment Share on other sites More sharing options...
vitruvius Posted February 8, 2017 Author Share Posted February 8, 2017 Thx BIGALL, but this is too complicated to implement for me. Anything simpler you can recommend? Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 9, 2017 Share Posted February 9, 2017 The idea is that your script is very simple and the lisp does all the work rather than the script. open dwg1 (load "myplottopdf") close n open dwg2 (load "myplottopdf") close n Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 9, 2017 Share Posted February 9, 2017 Here is a simpler lisp that will plot all layout tabs. You need to change the plot window values the -6,-6 and 807,560 the 1=2 is for a A3 sheet as our title block is a A1 sheet. ; plot layouts to b& w printer (PROMPT ".....PRINTING DRAWING TO laser printer....") (setvar "cmddia" 0) (setvar "filedia" 0) (setq plotabs nil) (SETVAR "PDMODE" 0) (setq dwgname (GETVAR "dwgname")) (setq lendwg (strlen dwgname)) (setq dwgname (substr dwgname 1 (- lendwg 4))) (setq doc (vla-get-activedocument (vlax-get-acad-object))) (vlax-for lay (vla-get-Layouts doc) (setq plotabs (cons (vla-get-name lay) plotabs)) ) (setq plottablist (acad_strlsort plotabs)) (setq len (length plottablist)) (setq x 0) (repeat len (setq name (nth x plottablist)) (princ name) (if (/= name "Model") (progn (setq pdfname (strcat "\\" dwgname "-" (getvar "ctab") ".pdf" )) (COMMAND "-PLOT" "Y" "" "dwg to Pdf" "Iso full bleed A3 (420.00 x 297.00 MM)" "m" "LANDSCAPE" "N" "W" "-6,-6" "807,560" "1=2" "C" "y" "Designlasercolour.ctb" "Y" "n" "n" "n" pdfName "N" "y" ) ) (setq x (+ x 1)) ) (setvar "cmddia" 1) (setvar "filedia" 1) (setq plottablist nil) (princ) 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.