open file , run command and close

open file , run command and close

E.S.7.9
Advocate Advocate
10,192 Views
2 Replies
Message 1 of 3

open file , run command and close

E.S.7.9
Advocate
Advocate

hi ,

 

i have approximately 100 dwg files in my folder , and i have to purge and audit all of those files  , is there any easy way or lisp for open files / run commands which i want / save & close file / open next dwg and the same procces for until finish all files ...

 

thank you for your help

0 Likes
Accepted solutions (2)
10,193 Views
2 Replies
Replies (2)
Message 2 of 3

hmsilva
Mentor
Mentor
Accepted solution

I would suggest a script (.scr) file, and Autodesk's Scriptpro to process all dwg's.

 

EDIT: attached is a Sample.scr.txt, remove the .txt, using Scriptpro, your script don't nead to call the close command, the program will close the dwg and open the next one.

 

Henrique

EESignature

0 Likes
Message 3 of 3

Ajilal.Vijayan
Advisor
Advisor
Accepted solution

Also if you are using Acad 2013 or later version use accoreconsole.exe to run the script file.

 

To use accoreconsole, you need to create a *.bat file with the below line.

FOR %%f IN ("C:\dwgfiles\folder\*.dwg") DO "C:\Program Files\Autodesk\AutoCAD 2014\accoreconsole.exe" /i "%%f" /s "C:\myscript.scr" /l en-US

 

Edit the paths(highlighted in blue) as per your requirements.

  1. C:\dwgfiles\folder\ - This will be the path where your drawings are saved for batch processing.
  2. C:\Program Files\Autodesk\AutoCAD 2014\accoreconsole.exe - acccoreconsole.exe, file location in acad program files folder.
  3. C:\myscript.scr - the script needs to run on the files in step 1 (Use the script file which Henrique suggested)

Save the *.bat file anywhere you like, and double click on this bat file will start accoreconsole to process the drawings.