leonucadomi Posted July 22, 2022 Share Posted July 22, 2022 I use this routine to print my plans in pdf quickly... the problem is that sometimes it saves the generated pdf in the folder of my documents I want them to be generated and saved in the folder where the file is located my dwg... (defun C:impdf ( / name rotulo) (setq name (getvar "dwgname")) (setq rotulo (substr name 1 32)) (command "TILEMODE" "0" "" "'_.zoom" "_e" "" "_plot" "y" "Presentación1" "DWG To PDF.pc3" "ANSI B (11.00 x 17.00 Inches)" "m" "L" "N" "E" "F" "C" "Y" "1.ctb" "Y" "N" "N" "N" rotulo "N" "" "N" "Y") (command "_CLOSE" "Y") (princ) );c.defun Quote Link to comment Share on other sites More sharing options...
mhupp Posted July 22, 2022 Share Posted July 22, 2022 (edited) Edited July 22, 2022 by mhupp 2 Quote Link to comment Share on other sites More sharing options...
Steven P Posted July 22, 2022 Share Posted July 22, 2022 You can also work out what to change in your code, If you start the plot command in the command line (_plot), it will give you all the options that your LISP has preselected one after another. Make a note of them as it runs through the plot command and you can change these above to suit your needs. 1 1 Quote Link to comment Share on other sites More sharing options...
leonucadomi Posted July 22, 2022 Author Share Posted July 22, 2022 WHAT I NEED IS FOR YOU TO SAVE THE PDF IN THE SAME FOLDER AS THE DWG WITHOUT BEING ASKED 1 Quote Link to comment Share on other sites More sharing options...
mhupp Posted July 22, 2022 Share Posted July 22, 2022 (edited) No need to yell (defun C:impdf ( / name rotulo) (setq path (getvar 'dwgprefix)) (setq fn (vl-filename-base (getvar 'dwgname))) (setq rotulo (strcat path "\\" fn ".pdf")) Edited July 22, 2022 by mhupp 1 1 Quote Link to comment Share on other sites More sharing options...
Dadgad Posted July 23, 2022 Share Posted July 23, 2022 I am not a member of The Lisperatti, so this may not be of interest to you. Are you familiar with the Automatic Publish functionality of Autocad? As shown in the screenshot. I don't USE it, but I know that it will automagically create a new folder for your PDFs, once setup. As I recall in the same folder as your original dwgs., but configurable. 1 Quote Link to comment Share on other sites More sharing options...
Steven P Posted July 23, 2022 Share Posted July 23, 2022 What I reckon you can do is to read the hints above and work it out now. MHupp has given you a little LISP that creates the PDF filename and path as rotulo, it might need a tiny change to make it work. You can run this from your LISP either copy and paste into it or with (setq rotulo (IMPDF)) and you are good to go 1 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted July 24, 2022 Share Posted July 24, 2022 Create a pdf directory under current dwg location. Part of my plot routines yes does auto. ; check that pdf directory exists (setq dwgpre (strcat (getvar "dwgprefix") "\pdf")) (if (= (vl-file-directory-p dwgpre) nil) (vl-mkdir dwgpre) ) ..................... (setq dwgname (GETVAR "dwgname")) (setq lendwg (strlen dwgname)) (setq dwgname (substr dwgname 1 (- lendwg 4))) ........................................................ (setq pdfname (strcat dwgpre "\\" dwgname "-" (getvar "ctab") ".pdf" )) ; pdf name 1 Quote Link to comment Share on other sites More sharing options...
leonucadomi Posted July 25, 2022 Author Share Posted July 25, 2022 thanks bigal 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.