Code Red > AutoLISP (Vanilla / Visual)

BatchWORX

(1/7) > >>

TimSpangler:
As promised, here is a Batch Processing utility that I have been working on for a while (several failed attempts).  I have included some documentation to help explain a little bit about how to set it up and how it works.  This is a LISP only processor, it does not rely on scripts or lisp that create scripts, etc.  It utilizes the registry along with some code in the Batchworx.lsp to run when loaded.  I have been using this for about 6 months and it has held up nicely to my testing.  I would now like to get others to test it to exspose the bugs.  I have read just about everything there is to read online about batch processing, alot of what I tried was cumbersome or hard to follow or just plain complicated.  I wanted something that was easy to implement and easy to use.

The Batchworx adds a "load" line to the Acaddoc.lsp file to load the Batchworx.lsp for each dwg.

Code inside the Batchworx.lsp checks for certian parameters when loaded.  If those parameters are met, it then loads/ executes the selected process. If the parameters are not met, the drawing loads normally. (this is checked with every dwg that is opened, this is what allows for the batch processing).

When Batchworx is executed is sets a flag in the registry to T (this turns on Batch Processing. This is one parameter that is checked)
The user will then select a batch process to run (this parameter is set in the registry so that every dwg opened now knows what process to run)
The user then selects the dwg's to process. (they can be  in multiple directories/ locations).
This list of drawings are then opened. As each drawing is opened the parameters tell the drawing which process to load.  That process is loaded and executed. The process then closes the drawing and the next one is opened, etc.
Once the last drawing is opened Batchworx opens its own dwg (Batchworx.dwg it is an empty dwg). This drawing is a trigger to turn off the Batch process and clear the parameters from the registry.

Batchworx also has the ability to run a seperate process once the batch has ended.  This can be used to create a log and open it once completed, it can be used to reset varaibles, map network drives, etc (anything you need it to do).  This cleanup process can be a .vbs, .lsp, .bat, .exe. This can be expaned to include just about anything.  There is more of an explianation in the documentation.

I have included a sample batch file that creates a log file and opens that log upon completion.

I welcome any positive feedback.  The code is still abit "dirty" so keep that in mind.  If anyone has any question feel free to ask.


*NOTICE*
Batchworx adds a line to the acaddoc.lsp as well a creating some registry entries under "HKEY_CURRENT_USER\\Software\\BatchWORX"


[EDIT]  Replaced the attachment with current files.

irneb:
Great work! I was thinking along the same lines, just didn't have the time. BTW, my idea was to save a list of drawings to be opened into a registry folder. The loader would then check if the current DWG is one of them in that folder, if so - then run the script/lsp/etc. and delete that value out of the folder, then close the DWG and open the 1st one in the reg folder.

Was there a reason you didn't go that route and rather used a marker Batchworx.DWG file?

TimSpangler:

--- Quote from: irneb on April 21, 2012, 08:04:54 am ---Great work! I was thinking along the same lines, just didn't have the time. BTW, my idea was to save a list of drawings to be opened into a registry folder. The loader would then check if the current DWG is one of them in that folder, if so - then run the script/lsp/etc. and delete that value out of the folder, then close the DWG and open the 1st one in the reg folder.

Was there a reason you didn't go that route and rather used a marker Batchworx.DWG file?

--- End quote ---

One of my failed attempts was saving the list to the registry.  That could potentially be a large list and I ran into trouble with that approach.  The batch sometimes stopped for no reason.  I think the better option would be to hold the number of dwg's, then as each dwg was processed -1 that number until it was 0.  That is one thing I am getting ready to test.

Did everything work as it was supposed to?  Is there anything that could make it more user friendly?

TimSpangler:
I tried using a counter set in the registry.  It worked for counting but once it was finished the process ended without cleaning up.

After looking at what is happening I realized that the batch closes the last drawing before anything can happen.  I tried changing some things around but I was unable to get it to work.  I believe that if I create a reactor in the first drawing (the calling session) and have that reactor check for that drawing to become active then check the counter I may be able to get it to work without the Batchworx.dwg.  Currently the Batchworx.dwg is the trigger that runs the cleanup then closes.

Not really sure that anyone is following this but if I get something to work I will post it here.

TimSpangler:
Has anyone had any issues/ comments. I am working on this a bit more and am open to comments to make it easier to use, etc.

Thanks

Navigation

[0] Message Index

[#] Next page

Go to full version