View Full Version : open, print, then close
rken.laws
2009-04-17, 04:38 PM
Can anybody help me with a lisp routine? I need to open all the .dwg files in a folder, thaw all layers, change to a tab (which could be one of three names), print, then close. I would like the files to print from most recent to oldest if possible. I can edit a lisp file that is close or has any piece of what I need, I just don't think I need to start from scratch with all the great resources that are on this forum.
d_m_hopper
2009-04-20, 02:21 PM
Can anybody help me with a lisp routine? I need to open all the .dwg files in a folder, thaw all layers, change to a tab (which could be one of three names), print, then close. I would like the files to print from most recent to oldest if possible. I can edit a lisp file that is close or has any piece of what I need, I just don't think I need to start from scratch with all the great resources that are on this forum.
Not that this is much help, since I cannot show you how to do this, but I have the PDF used as refernce (it was modified), at a former employer, we had a routine to open all dwgs in a folder, then perform a zoom extents, purge, then save, then close, then open next drawing in folder.
it used a batch routine, lisp routine, and script file.
irneb
2009-04-20, 04:51 PM
I'd advise doing this through a script instead of lisp. Use the free ScriptPro utility from AutoDesk to run it on multiple DWG's. Basically the script contains any commands you can type at the command prompt. So:-LAYER Thaw *
-PLOT No LayoutTabName
Page Setup Name (could omit this if default, then just leave line blank)
Output Device Name.pc3 (could omit this if default, then just leave line blank)
If the file has (only) one of 3 tab names, then ensure TILEMODE 0 to make sure it's showing paper space before the plot command.
If it has any number of tabs, but you only want to print one (or more) of 3 names, then you could incorporate some LISP using the LAYOUTLIST lisp function, e.g. to print each of A, B and/or C, change the lines from (and including) -PLOT.... to:(foreach layout (layoutlist)
(if (setq tab (car (member layout '("A" "B" "C")))
(command ".-PLOT" "No" tab "PG Setup" "OutputDev.PC3")
)
)Otherwise, have you looked into the Publish command?
lalit_jangid
2009-04-23, 07:16 PM
hi,
while making drawings you can use page setup manager & set the print area, page size, plotter etc & save files then use "publish" instead of plot.
this will help you & it is time saving.
before doing this you nust check that in the option--> Plot --> there a check box shows that background printin option for PLOT & PUBLISH, they must be turned off. so you can give more prints.
i think it may help you.
-LALIT
tcarbone
2009-06-16, 09:46 PM
Maybe this could help you as a starting point. The attached lisp file is one that I created to print directly to one of a few printers we have in our office. You may be able to modify it to print to your specific PC3 files. You need to have the DOSLIB.arx installed (http://www.en.na.mcneel.com/doslib.htm) to run correctly. One thing you should be made aware of though, this lisp routine only prints the default "LAYOUT1".
Hope this helps...
Edit: This lisp routine creates a script file which gets executed at the end of the routine.
domniki
2009-07-09, 12:04 PM
Maybe this could help you as a starting point. The attached lisp file is one that I created to print directly to one of a few printers we have in our office. You may be able to modify it to print to your specific PC3 files. You need to have the DOSLIB.arx installed (http://www.en.na.mcneel.com/doslib.htm) to run correctly. One thing you should be made aware of though, this lisp routine only prints the default "LAYOUT1".
Hope this helps...
Edit: This lisp routine creates a script file which gets executed at the end of the routine.
Thanks for all the scripts and the help :))) I have just discovered this forum and finally I have found some answers!!!
I tried to define a list of printers (similarly to your example) and choose every time the one I wanted to use, but ACAD didn't recognise any of them. I have ended up using Publish, but each time I have to define a different Page Setup, in case i want to use a different printer, or different printing options (paper size, etc). This takes time if I want to plot a batch of files :( I have also tried using the Page Setup Manager for each file in my lisp script which uses the PLOT command, instead of PUBLISH command, but there is no way to close the manager window, which pops up every time.
irneb
2009-07-09, 02:03 PM
As for the various page setups, you don't need to recreate them each time you want to publish. We've got 3 large format printers & 3 A3 size printers, not to mention DWF or PDF.
Simple solution, setup a "template" file with each page setup you could possibly require. Name them so you can easily distinguish later. Then after the Publish dialog opens, select all the pages to have the same setup, click the drop-down at the top-most selected & choose import, browse to that "template" file & finally select which of those setups you want. You could even import them all, so you don't need to browse for each page setup type.
ronsarlo
2009-07-11, 03:00 AM
publish would be my weapon of choice too.
you can make it thaw layers when the drawing opens.
that way, next time you come into the drawing, the layers will be back to their original state.
you can also pick and choose the tabs you want plotted.
domniki
2009-11-12, 06:49 AM
As for the various page setups, you don't need to recreate them each time you want to publish. We've got 3 large format printers & 3 A3 size printers, not to mention DWF or PDF.
Simple solution, setup a "template" file with each page setup you could possibly require. Name them so you can easily distinguish later. Then after the Publish dialog opens, select all the pages to have the same setup, click the drop-down at the top-most selected & choose import, browse to that "template" file & finally select which of those setups you want. You could even import them all, so you don't need to browse for each page setup type.
Thanks!!! I had created the templates, but I didn't know that I could select a batch of files and import for all of them another template. With your suggestion, it is very easy to print using selected templates :)
irneb
2009-11-12, 07:29 AM
Thanks!!! I had created the templates, but I didn't know that I could select a batch of files and import for all of them another template. With your suggestion, it is very easy to print using selected templates :)
You're welcome!
With a bit of pre-planning you could make yourself a lot more efficient through this. I think the reason behind few knowing how to use Publish properly is that we're used to a plot dialog which you change settings at the time of printing. With Publish you have to do those settings somewhere before you start the command. Once you get over that, you actually notice it's a whole lot more efficient (even in the Plot dialog you now simply select the page setup - instead of various setting changes).
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.