Best way to run custom scripts on multiple files
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've seen applications like ScriptPro or AutoScript and I would like to try to write a similar application that can run scripts (as well as lisp scripts) on multiple files in AutoCAD.
What's the best way to approach this problem?
Let's say I write a purge script that I want to run on some files:
PURGE A * N QSAVE
My files:
myFile1.dwg myFile2.dwg myFile3.dwg
Should I write a .NET application that generates a "starter script" that opens all the files and runs the generated purge script?
OPEN "c:/project/myFile1.dwg" SCRIPT "c:/temp/genScript.scr"
CLOSE N OPEN "c:/project/myFile2.dwg" SCRIPT "c:/temp/genScript.scr" CLOSE N
OPEN "c:/project/myFile3.dwg" SCRIPT "c:/temp/genScript.scr"
CLOSE N
and then invoke it by starting an AutoCAD process with the -b parameter:
C:\Program Files\Autodesk\AutoCAD 2018\acad.exe -b C:\temp\starterScript.scr
Are there a more sophisticated way to solve this somehow?
I don't know how this method holds up if you want to run a lisp script in the same fashion for example.
Is it better to write a plugin that runs single lines with the SendStringToExecute command.
Anybody knows how other applications have approached this problem?
Thanks!