Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LISP to Batchplot (Publish) Multiple .dwg Models into One PDF

7 REPLIES 7
Reply
Message 1 of 8
whitt0213
765 Views, 7 Replies

LISP to Batchplot (Publish) Multiple .dwg Models into One PDF

I've been tasked with the objective of creating a LISP which will automatically batchplot (publish) all Models in a set of .dwg in a given folder to a single .pdf. The idea is that we will create a routine which will run this LISP once a week to keep the .pdf, which is used by non-CAD users, up to date.

I am new to LISP but as I've tried to plan this out, I've come up with the idea that I would create a temp .dsd file based on the .dwg filename containing a substring of characters (ex. KER) and load that .dsd into PUBLISH command. Each Model would be passed the same page setup.

Does this sound feasible? Does anyone have any experience doing something similar and can provide some examples?

Labels (2)
7 REPLIES 7
Message 2 of 8
Sea-Haven
in reply to: whitt0213

I got round the single pdf file by using Ghostscript it has the ability to combine multiple pdf into 1 Pdf. We did not use publish rather custom plot lisps. 

 

You could put all the pdf's into a directory then tell Ghostscript to combine, the good news is that there is a VL function for getting files in a directory and secondly you can use lisp to run Ghostscript.

 

If this sounds useful post again.

Message 3 of 8
whitt0213
in reply to: Sea-Haven

I'm not familiar with Ghostscript, but I'm open to learning something new!

Message 4 of 8
scot-65
in reply to: whitt0213

@whitt0213 

 

This method might be a little too much to take in as a newbie, but you have to start somewhere, huh?

 

Look into the registry, specifically this area:

HKEY_CURRENT_USER\SOFTWARE\Autodesk\[[AutoCAD Product here]]\Profiles\[[Profile Here]]\Dialogs\AcPublishDlg

 

If there is no AcPublishDlg entry, command PUBLISH was never started (and ended) on that computer.

 

The keys you will be setting are:

IncludeLayout = 0

IncludeModel = 1

MultiSheetFile = 1

 

and the variable

PUBLISHALLSHEETS = 1

 

All drawings in the directory will need to be loaded in the AutoCAD editor for this to work.

 

Otherwise you will have to use an external scripting-type of program to generate, then bind the PDF's (which is not LISP).

 

The dsd file only works with drawings already loaded into the editor (I think). Therefore you do not need to investigate this route.

 

Hope this helps.

 


Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.


Message 5 of 8
Sea-Haven
in reply to: whitt0213

Have a look at this as example code. You will need to download and install current ghostscript 1st and edit the version in the lisp code.

 

 

Message 6 of 8
maratovich
in reply to: whitt0213

Maybe this will help you - Revers 

There is an automatic folder check.
If a file appears in the folder, a PDF is created or printed.
After this, the file is deleted from the folder, but the PDF remains.

---------------------------------------------------------------------
Software development
Automatic creation layouts and viewport. Batch printing drawings from model.
www.kdmsoft.net
Message 7 of 8
whitt0213
in reply to: scot-65

Hey Scot,

 

Thanks for the reply. Forgive me for my stupidity, but what do you mean by, "All drawings in the directory will need to be loaded in the AutoCAD editor for this to work." What is the AutoCAD editor? 

Message 8 of 8
whitt0213
in reply to: Sea-Haven

Thanks for the example code! I'll take a look into this. 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


Autodesk Design & Make Report