Hello All,
I'm new to AutoCAD, LISP, and this forum. I'm hoping someone out there can help me out.
I'm trying to write multiple DWG's to PDF using DWG to PDF.PC3. I would like it to autosave and not prompt me to save each PDF. I can have up to 150+ PDF's.
I have done a lot of searching on this forum and others and have come up with a start. Here is what I have so far that does not work. Any ideas on how to fix? Any help would be much appreciated.
(setvar "cmdecho" 1)
(Command "-plot")
(Command "yes")
(Command "")
(Command "DWG TO PDF.PC3")
(Command "ARCH D (36.00 x 24.00 Inches)")
(Command "Inches")
(Command "Landscape")
(Command "yes")
(Command "Extents")
(Command "1:1")
(Command ".113427,.113168")
(Command "yes")
(Command "OMS.ctb")
(Command "yes")
(Command "no")
(Command "no")
(Command "Yes")
(Command "No")
(Command "no")
(Command "yes")
(ade_errclear)
(setvar "cmdecho" 1)
(setvar "filedia" 1)
(princ)
)
Solved! Go to Solution.
Solved by hmsilva. Go to Solution.
I hate to bring a old post back up but I am stuck. I can not get the LISP to remove the .DWG before the .PDF. It always comes out as Test.DWG.PDF.
Any help would be great.
(defun c:plotPdfPreTar(/ FileName) (setq FileName(strcat (getvar 'DWGPREFIX) (substr (setq dwg (getvar 'DWGNAME)) 1 (- (strlen dwg) 4)) ".pdf")) (command "_plot" "n" "" "" "" (strcat "C:\\CADD\\" FileName) "" "y") )
Use the Publish command.
If your print is not set then use this : Revers - Automatic batch printing
Give us an example of your file, then we can give an exact answer.
Hello @hmsilva
I was able to use your code to get PDF made without an user input. Thanks!
As I'm going through this and refining my lisp, I keep adding to it and making it more user friendly and gaining more knowledge each step. If you don't mind, or someone else, could you describe what's going on in yours section.
The first section of code is what I had. The second is yours. I replaced my code with yours and it worked great. I understand the order of mine but not yours. From what I understood the "1" at the end of my code has be last for it to work. However on yours, ".pdf" is last.
I'm going basing the order it must be by this info from Autodesk
(setq sav (getfiled "Save as" (strcat (getvar "dwgprefix")(vl-filename-base (getvar 'dwgname))) "pdf" 1))
(setq file (strcat (getvar 'DWGPREFIX) (substr (setq dwg (getvar 'DWGNAME)) 1 (- (strlen dwg) 4)) ".pdf"))
Thanks!
Can you extend your command -with this FmtStr? Tha magic Trick is (car (list ****
if (nam)
{ command("-PLOT",
car(list("y","\nDetailed plot configuration? [Yes/No] <No>:")),
car(list("" ,"\nEnter a layout name or [?] <Layout1>:")),
car(list(kScreenDevice,"Enter an output device name or [?] <None>: ")),
car(list("A4","\nEnter paper size or [?] <A3>:")),
car(list("m","\nEnter paper units [inches/Millimeters] <Inches>: m")),
car(list("l","\nEnter drawing orientation [Portrait/Landscape] <Landscape>:")),
car(list("no","\nPlot upside down? [Yes/No] <No>:")),
car(list(""e","\nEnter plot area [Display/Extents/Limits/View/Window] <Layout>: e)),
car(list("f","\nEnter plot scale (Plotted Millimeters=Drawing Units) or [Fit] <1:1>: f")),
car(list("0,0","\nEnter plot offset (x,y) or [Center] <0.00,0.00>:)),
car(list("yes","\nPlot with plot styles? [Yes/No] <Yes>:")),
car(list(pstyle,"\nEnter plot style table name or [?] (enter . for none) <>: ")),
car(list("yes","\nPlot with lineweights? [Yes/No] <Yes>:")),
car(list("","\nScale lineweights with plot scale? [Yes/No] <No>:")),
car(list("","\nPlot paper space first? [Yes/No] <No>:")),
car(list("","\nHide paperspace objects? [Yes/No] <No>:")),
car(list("","\nWrite the plot to a file [Yes/No] <N>:")),
car(list("","Save changes to page setup [Yes/No]? <N>")),
car(list("y","\nProceed with plot [Yes/No] <Y>:")));
};
Why ?
Plot pdfrange just enter start layout number last lastout number watch the pdf get made.
I have a couple of plot pdf so why ask questions take the mistakes out of the end users hands they just want press button and it comes out
AutoCAD LT and Quick Plot
Can't find what you're looking for? Ask the community or share your knowledge.