naren Posted March 14, 2017 Posted March 14, 2017 hi guys, I have found a desired lisp routine to convert DWG TO PDF after long googling and made little changes to suit my requirement. Here problem is this routine converts each DWG at a time but I have to convert around 100 dwgs to pdf. somebody can help me to convert this routine to proceed as batch converter:(. Quote
naren Posted March 14, 2017 Author Posted March 14, 2017 sorry forgot routine (defun c:A3_BIGENCOLOUR_PDF (/) (setvar "cmdecho" 0) (setq cur_plottransparencyoverride (getvar "PLOTTRANSPARENCYOVERRIDE")) (setvar "PLOTTRANSPARENCYOVERRIDE" 2) (setq cur_space (getvar "ctab")) ( (command "zoom" "Extents") (setq filename (getfiled "Enter PDF file name" "" "pdf" 1)) ;;;https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/plot-pdf-lisp/td-p/3060536 (command "-plot" ; Start plot command "yes" ; Detailed plot configuration? (getvar "ctab") ; Get a layout name "DWG To PDF.pc3" ; Enter an output device name GEBRUIK DUBBEL \\ VIR UNC PARTHS "ISO full bleed A3 (420.00 x 297.00 MM)" ; Enter paper size "Millimeters" ; Enter paper units "Landscape" ; Enter drawing orientation "No" ; Plot upside down? "window" ; Enter plot area "1:1" ; Enter plot scale "Center" ; Enter plot offset (x,y) "Yes" ; Plot with plot styles? "prop.ctb" ; Enter plot style table name or "No" ; Plot with lineweights? "No" ; Scale lineweights with plot scale? "No" ; Plot paper space first? "No" ; Hide paperspace objects? filename ;;; "No" ; Write the plot to a file "Yes" ; Save changes to page setup "Yes" ; Proceed with plot )) (setvar "cmdecho" 1) (setvar "PLOTTRANSPARENCYOVERRIDE" cur_plottransparencyoverride) (princ) (princ) ) Quote
SunnyTurtle Posted March 14, 2017 Posted March 14, 2017 I know this is not exactly what you are looking for but have you looked into PUBLISH https://knowledge.autodesk.com/support/autocad/troubleshooting/caas/sfdcarticles/sfdcarticles/How-to-publish-multiple-drawings-into-PDF-in-AutoCAD.html Quote
naren Posted March 14, 2017 Author Posted March 14, 2017 sunny, I know publishing but instead of publish I want to use routine. Quote
SLW210 Posted March 14, 2017 Posted March 14, 2017 Please read the Code Posting Guidelines and edit your Code to be included in Code Tags.[NOPARSE] Your Code Here[/NOPARSE] = Your Code Here Quote
tombu Posted March 14, 2017 Posted March 14, 2017 I have Page Setups for both PDF or Plotter in every Layout for all my Templates. When needed I'll toggle Page Setups for all layouts at between PDF and Plotter with a lisp routine. To plot a single layout I have a macro in my Ribbon ^C^C-Plot;No;;;;No;No;Yes that sends it to the plotter with one click. With a structured approach AutoCAD is easy. Are you seriously still picking window corners every time you plot? Quote
OMEGA-ThundeR Posted March 14, 2017 Posted March 14, 2017 sunny,I know publishing but instead of publish I want to use routine. I don't see any better way then using PUBLISH for this. Since you want the drawings to plot to PDF. PUBLISH is perfect for that (has an checkbox to override the plotter set in the layout) Quote
Guest Posted March 14, 2017 Posted March 14, 2017 Hi i use this lisp ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; Layouts To PDF ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun C:laytopdf ( / cmd ) (setq cmd (getvar 'cmdecho)) (setvar 'cmdecho 0) (foreach Layout (layoutlist) (command "_.-PLOT" "No" ; Detailed plot configuration? [Yes/No] <No>: No Layout ; Enter a layout name or [?] <Layout1>: "" ; Enter a page setup name "DWG To PDF.pc3" ; Enter an output device name or [?] <DWG To PDF.pc3>: (strcat (getvar "DWGPREFIX") Layout ".pdf") ; Directory to save "No" ; save changes to page setup? "YES" ; proceed with plot? ); command ); foreach (vla-put-StyleSheet(vla-get-ActiveLayout (vla-get-ActiveDocument (vlax-get-acad-object))) "monochrome.stb" ) (setvar 'cmdecho cmd) (princ) ); defun C:test Quote
tombu Posted March 14, 2017 Posted March 14, 2017 Hi i use this lisp → Layouts To PDF I like that, it's simple! Quote
Grrr Posted March 14, 2017 Posted March 14, 2017 Hi i use this lisp The formatting looked familiar 1 Quote
SunnyTurtle Posted March 14, 2017 Posted March 14, 2017 I don't see any better way then using PUBLISH for this. Since you want the drawings to plot to PDF. PUBLISH is perfect for that (has an checkbox to override the plotter set in the layout) There are reasons for wanting to do this as as lisp. For example if you have a very particular set of setting for plotting and you would like users just to press one button speeding up the printing process and reducing miss prints Quote
BIGAL Posted March 15, 2017 Posted March 15, 2017 If you want to do a 100 dwgs and each drawing has multiple layouts not a problem also, you only have to look at the lisp code and what function is being called to run it, then use a script open dwg1 (load "myplot")(c:laytopdf) close n open dwg2 (load "myplot")(c:laytopdf) close n A better way is to auto load the plot routine then it does not need to be loaded each time. The other extra I do is plot a pdf for each layout but at the end combine all of them into 1 using Ghostscript. Like others here I use a hard coded area setting that suits our dwg's. Quote
BIGAL Posted March 15, 2017 Posted March 15, 2017 Like the books "Plotting for dummy's" press the icon button marked "PDF" Quote
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.