VB.net layouts to pdf (saveAsPdf)

VB.net layouts to pdf (saveAsPdf)

Anonymous
Not applicable
1,322 Views
2 Replies
Message 1 of 3

VB.net layouts to pdf (saveAsPdf)

Anonymous
Not applicable

Hello,

 

I'm trying to create a dll in vb.net (visual studio) that allows me to export a specific (user selected) layout from the current drawing to a pdf file. I've searched the internet over and over but I cannot find a "simple" solution. I've found numerous solutions that publish pdfs but the plotting/publishing takes a long time and the code is very long and time consuming.

 

Since autocad has the fast-and-easy "SaveAsPdf" option, i would think this is the most effective way of publishing pdf's from layouts. Since a lot of designers here at my company will use this dll, time consumption is vital.

 

Summarized question : Is there code available to save a layout to a pdf using the "SaveAsPdf" in autocad.

 

Thanks in advance!

Peter

 

 

0 Likes
1,323 Views
2 Replies
Replies (2)
Message 2 of 3

Jonathan3891
Advisor
Advisor

I dont have vb installed on my machine at work, so I havent dabbled in it for Autocad.

 

But I do have this that is fast. It ask you for a save location, but defaults to the location of the drawing. It also saves the PDF the name of the drawing.

 

If you find this helpful, feel free to edit to fit your needs.

 

(defun C:PDF (/ fnm)
 
(if (setq fnm (getfiled "Specify Save Location" "" "pdf" 1))
 (progn

(command "tilemode" "0")
(command "-plot" "y" "" "Dwg To PDF.pc3" "ANSI expand D (34.00 x 22.00 Inches)" "I" "L" "N" "E" "1:1" "C" "Y" "CMS_d_black.ctb" "Y" "N" "N" "N" fnm "N" "Y")
)
  

Jonathan Norton
Blog | Linkedin
0 Likes