sadhu Posted April 21, 2011 Posted April 21, 2011 I'm trying to print a layout to pdf - with path and file name. Where and how do I add the file name and path in the following code? Is there a better way to do it ? All help is appreciated. (setq dwgsname (getvar 'dwgname)) (setq dwgsnamelen (strlen dwgsname)) (setq dwgsname (substr dwgsname 1 (- dwgsnamelen 4))) (setq fname (Strcat (getvar 'dwgprefix) "montaggio \\" dwgsname)) (setq filename (strcat fname "_" (getstring "File Name.. ?"))) (command "-plot" "y" ;Detailed plot configuration? "MONTAGGIO" ;Enter a layout name or [?] <Model> "DWG To PDF.pc3" ;"PDFill PDF&Image Writer" ;Enter an output device name or [?] "ISO A4 (297.00 x 210.00 MM)" ; ;Enter paper size or [?] "A4" "Millimeters" ;Enter paper units [inches/Millimeters] "LANDSCAPE" ;Enter drawing orientation [Portrait/Landscape] "no" ;Plot upside down? [Yes/No] "LAYOUT" ;Enter plot area [Display/Extents/Limits/View/Window] "Fit" ;Enter plot scale (Plotted Millimeters=Drawing Units) or [Fit] <Fit> "1,1" ;;; Enter plot offset (x,y) <0.00,0.00>: "yes" ;Plot with plot styles? "monochrome.ctb" ;Enter plot style table name "yes" ;Plot with lineweights? [Yes/No] "NO" ;Scale lineweights with plot scale? [Yes/No] <No>: "NO" ;;;Plot paper space first? [Yes/No] <No>: "NO" ;;;Hide paperspace objects? [Yes/No] <No>: (filename) "" ;;;Write the plot to a file [Yes/No] <N>: Y "" ;;; Save changes to page setup [Yes/No]? <N> ;"YES" ;;;Proceed with plot [Yes/No] <Y>: "" ) Quote
BIGAL Posted April 25, 2011 Posted April 25, 2011 (edited) I am pretty sure you will find the problem is that you transfer control from Autocad to the PDf software and it no longer recognises a command from Autocad that would be the file name, I had the same problem. There may be a way to similar to excell linking to pass a variable file name to the other process by jumping into the other process this would require a contiuous loop till it recognised that the other process was waiting. Help please would appreciate an answer the autoplot works well but must manually enter pdf names. There are`other posts here also about this problem. Hi Lee Mac took this from next post (if (setq XLApp (vlax-get-or-create-object "Excel.Application")) and its obvious to me need something like this for PDF. In my case Cutepdf Edited April 25, 2011 by BIGAL XLAPP 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.