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?
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.
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.
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.
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.
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?
Can't find what you're looking for? Ask the community or share your knowledge.