GregGleason Posted October 23, 2018 Posted October 23, 2018 This code used to work fine for plotting to a .pdf: (defun c:SendToPDFefa() (vl-load-com) (if (setq filename (getfiled "Save File Location" "" "pdf" 1)) (progn (command "-plot" "yes" "" "DWG To PDF.pc3" "ANSI expand B (11.00 x 17.00 Inches)" "inches" "landscape" "yes" "Extents" "fit" "center" "yes" "acad.ctb" "yes" "a" filename "no" "yes") ) ) ) Now it fails with this output: Command: SENDTOPDFEFA Unknown command "P:\randomfolderstructure\ACADFILENAME.PDF". Press F1 for help. Unknown command "NO". Press F1 for help. Unknown command "YES". Press F1 for help. nil I know IT had been adjusting printers when this happened, but i don't know if that is coincidental. I have two questions: How does the code need to be adjusted What could have caused the code to fail Greg Quote
rlx Posted October 24, 2018 Posted October 24, 2018 I think things go bad after .... "yes" "acad.ctb" "yes" "a" -> what's up with the "a"? This is the prompt after 'Scale lineweigths with plot scale? (Yes / No). Best way to check is to park the defun for a moment and do every step of your routine one line at the time by typing it in yourself. That way you see for yourself when the code fails. Other things I usually check : number of prompts for model and paper space are different. Folder you are saving your pdf can be readonly , well , here @ my own work anyway. Quote
GregGleason Posted October 24, 2018 Author Posted October 24, 2018 Thanks rlx, that was helpful. I think it's almost there but I need a bit more help. I revised the code as follows: (defun c:zzz() (vl-load-com) (if (setq filename (getfiled "Save File Location" "" "pdf" 1)) (progn (command "-plot" "yes" "" "DWG To PDF.pc3" "ANSI expand B (11.00 x 17.00 Inches)" "inches" "landscape" "No" "Layout" "1:1" "0.00,0.00" "yes" "acad.ctb" "yes" "no" "no" "no" filename "n" "y") ) ) ) This will at least plot, but it is shifted off to the right (see "2018-141-PI-SK-001.Lisp.pdf"). However, when I plot it manually it comes out correct (see "2018-141-PI-SK-001.Manual.pdf"). See the plot settings used. How do I adjust to code to get it fixed? Greg 2018-141-PI-SK-001.Lisp.pdf 2018-141-PI-SK-001.Manual.pdf Quote
rlx Posted October 24, 2018 Posted October 24, 2018 not entirely sure, believe it has to do with margins that have to match exactly. https://knowledge.autodesk.com/support/autocad/troubleshooting/caas/sfdcarticles/sfdcarticles/Plotting-to-PDF-shifts-the-layout-to-the-lower-left-in-AutoCAD.html I usualy plot extents with fit unless I have to deal with multiple borders where I use plot with window, Did read a post somewhere and the advise was not to use Dwg to PDF but to plot using adobe driver but that only works if you have this installed. You could play with a negative x-origin or use a slightly smaller scale like something 1:0.99. Doubt if anyone would even notice. Small difference would not matter much for the plot itself but it can make a big difference for getting autocad to use the proper margins as suggested in the link above. Quote
Roy_043 Posted October 25, 2018 Posted October 25, 2018 The dialog and the Lisp code show different page sizes: "ANSI full bleed B (11.00 x 17.00 Inches)" "ANSI expand B (11.00 x 17.00 Inches)" Quote
rlx Posted October 25, 2018 Posted October 25, 2018 53 minutes ago, Roy_043 said: The dialog and the Lisp code show different page sizes: "ANSI full bleed B (11.00 x 17.00 Inches)" "ANSI expand B (11.00 x 17.00 Inches)" @ eagle eyed Roy.... totally overlooked this. My first reaction would have been to use the full bleed size but when I saw OP was using this in his dialog and said he used exactly the same settings overlook this... so be aware roy_043 sees everything Quote
BIGAL Posted October 25, 2018 Posted October 25, 2018 Rather than find the original posts this may be useful uses a window rather than a layout. Plots a range of layouts. Maratovich has a real nice plot just about anything routine worth having a look at also. plotA3Pdfrange2.lsp GETVALS3.lsp Quote
maratovich Posted October 25, 2018 Posted October 25, 2018 GregGleason Attach an example of your file with the title block. Quote
GregGleason Posted October 26, 2018 Author Posted October 26, 2018 On 10/25/2018 at 2:51 AM, rlx said: @ eagle eyed Roy.... totally overlooked this. My first reaction would have been to use the full bleed size but when I saw OP was using this in his dialog and said he used exactly the same settings overlook this... so be aware roy_043 sees everything On 10/25/2018 at 1:52 AM, Roy_043 said: The dialog and the Lisp code show different page sizes: "ANSI full bleed B (11.00 x 17.00 Inches)" "ANSI expand B (11.00 x 17.00 Inches)" That was it! I just ran a test and it came in like I wanted. You guys are the best! Greg 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.