Jump to content

Recommended Posts

Posted

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>:
    
          ""
  )

Posted

Have you looked into the PLOTSTAMP option?

Posted (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 by BIGAL
XLAPP

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...