@john.uhden wrote:
It's possible. I wrote a couple of AutoLisp routines for Philadelphia Gas Works to open every drawing in a directory tree (13,000+), perform 23 tasks, and save and close each with zero errors. You just need MDI turned on and everything can be done from one PC running one session of AutoCAD. It needed a specific acaddoc.lsp to load and perform the tasks.
With some work, I could redact it for others to modify to their needs.
Of course it is. I just posted a piece of code to do just that 😛
The need for acaddoc probably lies in the variables and/or lisp routines. You lose them each time. You need to reload them with each dwg opened.
For easy transfer of variables I usually use .ini files. They have many advantages, although one could argue its slower.
Wrote me a much bigger version of the above code. With a script generator & file selection tool allowing for anything to be done with any amount of DWG's/DXF's. It doesn't directly call the fileopen function, but uses a separate script to check each file for read-only, being open, in use on a network etc. it will allow the user to either skip such files (prompted or automatically) or even a retry. All skipped files can be logged, so you know what drawings to check again.
One of the mayor uses I once had for it is plotting. Back when the batch plot was still just to cry about & setting revisions & manage standards (setting all defaults, overwriting any manual changes) and/or to mame drawings. (bursting all blocks and stuff, to prevent our Chinese clients from reading the drawings back into an automated system (like Elcad and/or Electrical Designer) - as extra 'protection'.
Anything you can do with 1 drawing, can be done to a selection of drawings.
Back in 2004-2007 (when I first wrote & used the lisp routines) the only way to do it, was with DOSlib.
I noticed at least some functions are now available with ACET (like reading & writing .ini files, list directories etc.)
Need to check on that, to see if I can rewrite it to use ACET instead of DOSlib, but if I still need DOSlib for at least 1 function, it's kinda useless to force the need for ACET as well. (currently you don't need them installed for my scripts to work, but its probably more widespread nowadays)
Last weekend I already finished rewriting my script generator, to be more "general purpose" & completely stand-alone.
In addition I made a few changes to my MOpen script, to work with the new generator (& new ini file)
All I need to work on is my File selection tool. Which goes way beyond just selecting a directory and add all files in it.
Maybe I will add my plotscript as an example, although its pretty much obsolete these days (and only works with modelspace, as it was all we used back then.)
Allthough it's capable of adding "the current drawing", I know of no way to add ALL open drawings. (& to switch between them and process them in a similar way as single DWG's, without opening/closing them is a different story. An impossible one, afaik (as lisp is loaded & running on the current drawing only, instead of being independant))
If there's a way to retrieve a list of all opened DWG's, there's a possibility. Otherwise ...