A batch file runs outside autocad from the operating system command line once you start the loop the batch file opens a session of autocad and it expects you to close it as well, hence why quit works and not close.
The easier way is to stay inside autocad and use a script to loop through the drawings and yes use close not quit. We have done for 100+ drawings no problems.
A couple of extra real help full tips after you create your dir *.dwg >mydwgs.txt file use WORD to edit it, remove the junk till you get just filenames only use "hold alt key" and use mouse for vertical selection then delete, an unknown fact is that you can find/replace the end of line with something new uselly my script commands.
eg
mydwg1.dwg
mydwg2.dwg etc
find replace g^p with g zoom e domylisp^p
ie
mydwg1.dwg zoom e domylisp
mydwg2.dwg zoom e domylisp
also add blank line at top ^preplace ^oopen (space after n)
open mydwg1.dwg zoom e domylisp
open mydwg2.dwg zoom e domylisp
delete blank line
save as a script
Hope this helps. it only takes a couple of minutes to edit the dwg txt file. You are correct that I would like to run this outside of autocad well as I stated before I have it open Autocad but as you say with the batch file it runs externally and in the program it quits and then restarts with the next drawing in the folder.I posted the code in this thread, maybe it would be helpful if I commented it as to what I was attempting to do?and bid al thanks for your help here but I guess I got a lil lost as to what you were explaining with your script file. is it a portion of the final blitz package? pretty much what I was trying to say but I prefer to construct my script using excel
just one note, if you use dir *.dwg > mydwgs.txt /b you will NOT get any of the junk, just the filenames. I write all my scripts in notepad?what are the benefits in doing it in excel?..ssearching google now... I would agree with BigAl on this one - is it mandatory that you run the script from outside of AutoCAD?
Why not just create a script file and run it from within ACAD?
You could even use a LISP to write the script for you No its not mandatory at all I guess I was just playing around with what I knew the most.Basically what I want to do is be able to process multiple drawings by purging them to minimize file size before transmittal or even just to reduce the file size.The way that I have it it opens autocad, opens the drawing , runs the script to purge and then the lisp to save it with the same name in an "updated" folder.The problem is that it opens autocad for every drawing in the folder performs the task shuts down and goes on to the next.I am more than interested in doing a lisp for this and I am eager to learn.
页:
1
[2]