Export to PDF working differently in acaddoc.lsp

Export to PDF working differently in acaddoc.lsp

Anonymous
Not applicable
605 Views
3 Replies
Message 1 of 4

Export to PDF working differently in acaddoc.lsp

Anonymous
Not applicable

Hi,

 

I'm creating a system to export 100s of drawings to PDF, via an acaddoc.lsp file which calls the "export" command, then using another app to open all the dwgs in sequence, thereby executing the contents of acaddoc.lsp on each.

 

The following script works fine if I open the dwg and run it from vlide, but if I run it from acaddoc.lsp it doesn't work.

I get the "plot complete" window, and it says "Errors and warnings found" but when I open the "click to view plot and publish details" I get told

"There are no plot or publish details to view."
 

 

Any ideas why this might be failing, or how I go about finding what those mystery errors are, or if there is a better way to go about the whole thing?

 

Thanks!

 

 

(vl-load-com)
(defun export_to_pdf ()
    (setq target_destination "C:\\Users\\Andrew\\Desktop\\Test PDF out\\Test.pdf")
    (vla-put-StyleSheet
      (vla-get-ActiveLayout
        (vla-get-ActiveDocument (vlax-get-acad-object))
       )
       ""
      )
    (princ target_destination)
    (command "-export" "P" "C" "N" target_destination)
  (princ "should have exported")
  )
(export_to_pdf)

 

0 Likes
606 Views
3 Replies
Replies (3)
Message 2 of 4

wispoxy
Advisor
Advisor
Currently reviewing / testing
0 Likes
Message 3 of 4

Anonymous
Not applicable

Any luck on your end, do you see the same result?

0 Likes
Message 4 of 4

wispoxy
Advisor
Advisor

I'm at a beginner level with LISP, playing around with your code. Surprised no one else jumped into this thread.

 

Not advanced enough to promise a solution with LISP, but I am interested in trying.

0 Likes