Losinski Posted June 30, 2016 Share Posted June 30, 2016 (edited) Hi all, I have researched a fair bit and have found solutions to this issue, but I just can't seem to get it to work. I'm writing a LISP that includes plotting a drawing to a PDF. The location of the plot will depend on the drawing and therefore will change each time the LISP is executed. I can't, however, figure out how to change the destination. See below for what I was using to change the location of the plot: ___________________________________________ (defun c:test123 () (command "tilemode" "0") (command "filedia" "0") (setenv "PlotToFilePath" "C:\\Users\\slosinski\\Desktop") (command "-PLOT" "Y" "LAYOUT" "ACADE - DWG TO PDF.PC3" "ISO FULL BLEED A1 (594.00 X 841.00 MM)" "M" "L" "N" "E" "1" "C" "Y" "" "Y" "N" "N" "N" "FILENAMETEST" "N" "Y") (princ) ) (princ) ___________________________________________ This should simply plot to whatever location I have specified, correct? After running the LISP, (getenv "PlotToFilePath") will return the correct path. I can change it manually in the settings- still doesn't work. The PDF seems to plot to wherever it has last. Any ideas? Regards, Losinski P.S. I tried to wrap the code in code tags, but that isn't working for me either. But that's a separate issue... Edited June 30, 2016 by SLW210 Added Code Tags Quote Link to comment Share on other sites More sharing options...
rlx Posted June 30, 2016 Share Posted June 30, 2016 (edited) Hi Losinski, Nowhere in your code see you actually making the filename. (setenv "PlotToFilePath" "C:\\Users\\slosinski\\Desktop") -> (setq PlotToFilePath "C:\\Users\\slosinski\\Desktop\\") (setq PlotFilename (strcat PlotToFilePath "myfilename")) gr. Rlx ps. https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2016/ENU/AutoCAD-AutoLISP/files/GUID-0C2E8222-62A8-4529-8A8A-58AAB2A5F23B-htm.html (setenv "MaxArray" "10000") "10000" Note that changes to settings might not take effect until the next time AutoCAD is started. Edited June 30, 2016 by rlx Quote Link to comment Share on other sites More sharing options...
SLW210 Posted June 30, 2016 Share Posted June 30, 2016 (edited) Just type them in [NOPARSE] CODE GOES HERE [/NOPARSE] if the # isn't working, I fixed it for you. Edited July 1, 2016 by SLW210 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted June 30, 2016 Share Posted June 30, 2016 We plot to same location as dwg and attach layout name to each PDFs search here BIGAL plot PDFs typed on my iPad Quote Link to comment Share on other sites More sharing options...
rlx Posted July 1, 2016 Share Posted July 1, 2016 Where I work we too plot to same folder as the dwg but that's not always possible depending on the status of the drawing , as built or checked out. So I made an app and placed it in the startup of acad.lsp and that by default uses the drawing folder , if not possible tries a user dependable document control folder or otherwise you can set your own folder , by default c:/temp. Usually works pretty well... so far anywayz... gr.Rlx Quote Link to comment Share on other sites More sharing options...
jonathann3891 Posted July 1, 2016 Share Posted July 1, 2016 I have a lisp I created that may do what you want. It saves the PDF in the same folder the drawing is located (defun PDF (/ fnm) (if (setq fnm (getfiled "Specify Save Location" "" "pdf" 1)) (progn (command "tilemode" "0") (command "-plot" "y" "" "Dwg To PDF.pc3" "ANSI expand D (34.00 x 22.00 Inches)" "I" "L" "N" "E" "1:1" "C" "Y" "CMS_d_black.ctb" "Y" "N" "N" "N" fnm "N" "Y") ) ) ) Quote Link to comment Share on other sites More sharing options...
Losinski Posted July 4, 2016 Author Share Posted July 4, 2016 Thanks for all of the replies. I'll dig into this shortly and see how these solutions work for me. Quote Link to comment Share on other sites More sharing options...
Losinski Posted July 5, 2016 Author Share Posted July 5, 2016 Problem solved for what I need right now- thanks again everyone. 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.