Balthor Posted September 25, 2014 Share Posted September 25, 2014 Hi, I'm trying to run the same script in many files. I can do it with a batch BUT it is necessary to close the Autocad before opening the next file. Is there a way to just close the drawing, leaving the AutoCad open, and open the next drawing and running the script? Thanks in advance Quote Link to comment Share on other sites More sharing options...
dbroada Posted September 25, 2014 Share Posted September 25, 2014 post what you are running and somebody will examine it for you. all my batch scripts open a drawing, run the commands and QSAVE the drawing making it ready for opening the next drawing or I open a drawing and run the script. Quote Link to comment Share on other sites More sharing options...
Balthor Posted September 25, 2014 Author Share Posted September 25, 2014 FOR %%f in (c:\CAD_scripts\change_frame\dwg\*.dwg) do START /WAIT C:\"Program Files"\"Autodesk"\"AutoCAD LT 2013"\acad.exe /nologo /b "c:\CAD_scripts\change_frame\moldura.scr" %%f This is my batch, it open Autocad, run script ( that closes Autocad) and repeat.... If I don't close the Autocad, the batch wont work Quote Link to comment Share on other sites More sharing options...
BIGAL Posted September 26, 2014 Share Posted September 26, 2014 Something like this open autocad then script only 1 session of autocad you can open and close drawings as many times as you like. Open dwg1 (load "lisp or script") Open dwg2 (load "lisp or script") What does moldura.scr do this will have an effect on the script continuing can you post. Quote Link to comment Share on other sites More sharing options...
Balthor Posted September 26, 2014 Author Share Posted September 26, 2014 The moldura.scr it's a script that uses attedit to change some block attributes, nothing complex. Open dwg1 (load "lisp or script")Open dwg2 (load "lisp or script") How would you do that in a batch? Is it possible to use Lisp to do the same thing ( open a file, run a script, close it, open another file and repeat)? Quote Link to comment Share on other sites More sharing options...
dbroada Posted September 26, 2014 Share Posted September 26, 2014 If you really have LT, LISP won't help you. I used to use DOS & EXCEL to create my scripts which would end up looking something like this... open "p:P4GB003432-00-SK-0001-01.dwg" plot ....(lots of commands) open y "p:P4GB003432-00-SK-0001-02.dwg" plot ....(lots of commands) open y "p:P4GB003432-00-SK-0001-03.dwg" plot ....(lots of commands) qnew y so that the script contained all the commands I needed to (in this case) plot a batch of files. Do a search on Lee Mac's site. I am sure he has a batch builder routine which I think might run on LT. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted September 28, 2014 Share Posted September 28, 2014 Sorry missed the LT I would second Dbroada use excel to make a list go to start CMD old DOS command screen appears taking Dbroada example above p: cd \mydesign\project52 dir *.dwg >dwglst.txt /b ............ this make a list of your dwgs open in excel Another way is to use WORD you can find the end of line using search replace you can add stuff at start or end of lines the end of line is ^p dwg1 dwg2 dwg3 do replace ^p with open ^p you now have open dwg1 open dwg2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.