Jump to content

pdf filename automation - known solutions?


Matt_Just

Recommended Posts

Hi all ... Not new to v/lisp, but new to this great forum.

I'm looking to automate title block revision, pdf generation and transmittals via lisp (which will probably be later converted to VB).

 

My question is:

Is it possible to create pdf's via script that will assign filenames [which I will extract from the drawings] ?

 

from what I have managed to ascertain this is achievable.

1) by a 3rd party pdf application (which I'm not against, but I would just prefer an all-in-one custom solution to save on portability/deployment issues)

2) by editing a registry entry (not keen on this, hopefully avoidable) to be passed to the pdf driver.

 

If someone suggests using publisher, I have limitations using it - particularly in regard to assigning the file name exactly as I want it, and without a dialog.

Have had no luck using the DWG to PDF.pc3 supplied by AutoDesk either.

Link to comment
Share on other sites

Have had no luck using the DWG to PDF.pc3 supplied by AutoDesk either.

Unfortunately if you have this as a requirement - there's no way to have it as an all-in-one solution (at least not from lisp, perhaps from VB, more probably from VB.Net or even more probably C#). From Lisp it doesn't seem to be able to send control signals to a 3rd-party print driver. And unlike the Dwg2Pdf driver, using the command-line option of the plot command to save to file - saves the PLT file with the raw data that would have been sent to the PDF driver (not the converted-to-PDF data, as in after the driver's finished).

 

You could buy some of these conversion tools. Just google DWG to PDF, there are several available. I simply run the normal publish and let it use the default filename. Then I use a batch file renamer (e.g. http://www.sherrodcomputers.com/products_filerenamer.cfm) to rename the whole folder of PDFs. But that's probably because my DWG filename & tabnames are designed to make life easier this way.

 

Another alternative way might be to plot to EPS files instead. I think ACad has a built-in PostScript driver already. Then you could run a converter from there (perhaps GhostScript) to change the file into a PDF. You could even automate it from lisp through the startapp function. Though you still require the 3rd party converter - though this time it's a command-line tool instead of a printer driver.

Link to comment
Share on other sites

my boss has just asked me to look into using something other than DWG to PDF.pc3 as his plots don't look good on the screen (I suspect his graphics card) and when I saw this post I thought it mught give me a clue.

 

This isn't really a help to you as I am saying I can only create a PDF file and supply my plot name using the built in .pc3 driver! I run a script built around the -plot command and can supply the file name. All other pdf plotters I have tried fire up the dialogue box and won't take my scripted file name.

 

In what way is the built in one not working for you?

 

for the record, my script looks like this...

SDI
1
open
"p:\Design_Office\E106\HSM85595 (M5)\M5\HSM85595-13-WD-0002-01.dwg"
plot
y
Model
DWG to PDF.pc3
ISO A3 (420.00 x 297.00 MM)
m
l
n
e
F
C
y
STL Mono.ctb
y
AS
"p:\Design_Office\E106\HSM85595 (M5)\M5\HSM85595-13-WD-0002-01.dwg.PDF"
n
y
qnew
Y

 

I know this isn't LISP or VB but you might get a clue from it.

Link to comment
Share on other sites

Here's what I do: ( Full version of Adobe Acrobat required. )

 

PLOT selected views / layouts / windows via AUTOLISP to post script .PS files:

(command "_.PLOT" ....

 

The ACAD post script drivers accept plot file name and has been fairly consistent over the years.

 

At the same time I make a master post scrpt file that contains the plot files names in the odrer that I need in Acrobat Distiller format:

 

VC-31.PS


/prun { /mysave save def
       dup = flush
       RunFile
       clear cleardictstack
       mysave restore
} def
(C:/ACAD/VC310002.PS) prun
(C:/ACAD/VC310012.PS) prun
(C:/ACAD/VC310022.PS) prun
(C:/ACAD/VC310032.PS) prun
(C:/ACAD/VC310042.PS) prun

 

Then create a bat file that make the final pdf in Ddistiller

 

C:\Progra~1\Adobe\Acroba~1.0\Distillr\acrodist.exe /jfdi.joboptions c:/acad/VC-31.ps

 

The bat file always has the same name and I have a desktop shortcut that calls that bat file.

 

The plot parameter vary a litlle from release to release, but I use this same scenario from Win98SE thru Win 7 64 bit. R12 thru R2004

 

The older ACAD releases had a sysvar "PLOTID" which made life a lot easier. From 2000 on acad plotting vacuums IMO. -David

Link to comment
Share on other sites

Hey, thanks for the input... much appreciated

 

Thanks dBroada... I overlooked the obvious step of filedia=0 & -plot use with the DWG_TO_PDF.pc3 (but I don't feel too bad... so did my predecessor :)

thought the dialog box was via the pdf driver as per the 3rd party we use.

The pdf's generated are just fine quality wise even with TTF's.

 

I will also try the e/ps suggestion thanks irneb & David

I can throw .ps files at the pdf driver to use the default name then track and rename them on the fly if the 1st way doesn't work out.

 

----- Matt -----

 

Eagles may soar... but weasels don't get sucked into jet engines...

Link to comment
Share on other sites

Maybe this will help for cutepdf and puts pdf into current working directory using also layout name. http://www.cadtutor.net/forum/showthread.php?69132-Printing-LISP-Help...&highlight=Printing-LISP this is an example there are a few different versions of this here.

 

Re Automate title block do you want an example in VBA or Vlisp ?

 

Re Transmittals more info please.

Link to comment
Share on other sites

Hi BigAl - thanks, I got a chance to read that this morning

 

This is what I have in the works

features are :

 

Selection - essentially a viewer (which is why this may need to be VB coded)

that allows multiple selections from multiple directories.

 

Auto Revision of title blocks using 1st, incremental or approved type

 

Autoprinting batch sets - to local printer/pdf or even file etransmit generation (pdf's autonamed to titleblock contents)

 

Auto Transmittals - we have document reciepting that's a bit old-skool (just excel sheets, no db's)

 

I've nearly done the dcl's and coding for the printing & transmittal generation, but don't have a full generic revision function for variable revision increments as yet.

 

Revisions.jpg

 

Printing.jpg

Link to comment
Share on other sites

Hi BigAl - thanks, I got a chance to read that this morning

 

This is what I have in the works

features are :

 

Selection - essentially a viewer (which is why this may need to be VB coded)

that allows multiple selections from multiple directories.

 

Auto Revision of title blocks using 1st, incremental or approved type

 

Autoprinting batch sets - to local printer/pdf or even file etransmit generation (pdf's autonamed to titleblock contents)

 

Auto Transmittals - we have document reciepting that's a bit old-skool (just excel sheets, no db's)

 

I've nearly done the dcl's and coding for the printing & transmittal generation, but don't have a full generic revision function for variable revision increments as yet.

 

[ATTACH=CONFIG]36463[/ATTACH]

 

[ATTACH=CONFIG]36467[/ATTACH]

 

 

:o:o:o this is really nice!!!

you guys are a real geniuses!

Link to comment
Share on other sites

Picking files you can use Findfile in lisp etc it allows you to open the windows file manager dialog theres also a DOSLIB function, this is a big task the dialouge looks good, theres lots of examples about Autocad-Excel linking, the auto revision of the title blocks is pretty easy I will post links for here need to find them VBA and lisp.

 

http://www.cadtutor.net/forum/showthread.php?63006-Title-block-attributes

Edited by BIGAL
VBA example
Link to comment
Share on other sites

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...