Hi,
I'm new to this forum, and LISP in general, so I apologise if this has been asked before, however I couldn't find a definitive answer by searching on here.
I have used this LISP routine which was uploaded to the Autodesk Uni site back in 2009, I can get the routine to plot to PDF, however it seems to save the file to the last manually opened file's directory - i.e I opened a image file and then ran the routine on a previously opened dwg, and the PDF was save to the image file directory - not very useful if you're working in a large organisation!
It therefore only seems to do what I want it to if you open the dwg files directly and then run the routine there and then, it seems to revert back to the last manually opened directory to save the PDF file? I dragged and dropped lots of files and ran the routine, they ended up in My Documents - all very odd and confusing!
What I need to be able to do, is to run the routine, and the PDF will be saved in the directory in which the opened drawing is saved in. This also needs to work if you "drag and drop" the files into AutoCAD and run the routine, I'm sure its just a simple one liner but I haven't managed figure it out.
The LISP routine is below:
The LISP routine is below:
;A0-size Landscape Extents Fit Center Monochrome - using .pc3 file
(defun c:1PPPDF_A0LEFCM_DWG_PDF( / currtab dwgnameonly cdname)
(setq currtab (getvar "ctab"));Gets the current layout tab name
(setq dwgnameonly (getvar "dwgname"));Gets variable value for drawing name which includes the .dwg extenstion.
(setq cdname (substr dwgnameonly 1 (- (strlen dwgnameonly) 4)));Gets drawing name and strips file name extension.
(if (= (getvar "tilemode") 1);Determines if you are in Paperspace or Modelspace
(progn ;This part of program runs if you are in modelspace
(command "-plot" "y" "model" "DWG To PDF.pc3" "ISO expand A0 (841.00 x 1189.00 MM)" "M" "L" "n" "Extents" "fit" "Center" "y" "_wyg_mono.ctb" "y" "As" "n" cdname "y" "y")
);end progn
(progn ;This part of program runs if you are in paperspace
(command "-plot" "y" currtab "DWG To PDF.pc3" "ISO expand A0 (841.00 x 1189.00 MM)" "M" "L" "n" "extents" "fit" "center" "y" "_wyg_mono.ctb" "y" "n" "y" "n" cdname "y" "y")
);end progn
);end if
(princ)
);end defun
Thanks in advance
Tim