In this Article...
AutoCAD Script is a simple and great way to run a batch of commands automatically. You can see how Paul uses the script to automate plotting. You can share a script to help your colleague creating the AutoCAD classic interface.
Now, what if you need to run a script on several files automatically? For example, you want to change all object properties to ByLayer with SETBYLAYER command. You want to change properties in a hundred files or so.
You can use ScriptPro to run a script file for multiple files at once, without you need to open the files first. You can download and install ScriptPro from Autodesk website here.
Using ScriptPro
After you install ScriptPro, you can run it from Windows Start Menu> All Programs> Autodesk> ScriptPro. The interface is simple.
- The list. You can save and load a list from this panel.
- Drawing Files. You can add drawings to the file list from this panel.
- Run panel. You can run checked files, selected, or failed files by using the buttons.
- Settings button.
- The script file that you want to run for files in the list.
- The files that will be processed.
After you add the files and select the script file, you can run the script. If AutoCAD is not opened, ScriptPro will open AutoCAD. It will open the file, run the script, then close the file.
If you have multiple flavors or versions on your computer, check it in the settings. Make sure it will use the version that you want to use.
A few things to remember
- Test the script first. Make sure it runs well before you use it with ScriptPro.
- ScriptPro only runs the script and close the file. It doesn’t save the changes automatically. Add QSAVE at the end of the script to save the changes.
- You can use a script to run AutoLISP routine. If you want to run a complex process, this will be very helpful. However, you need to make sure the program is loaded before you run the script. You can load it using Startup Suite.
The example below will run SETBYLAYER command for all objects and save the file.
SETBYLAYER ALL YES YES QSAVE
If you are not familiar with the script, you can learn how to create it by reading Learn how to write command scripts for AutoCAD and automate your plotting.
Everything is processing the way it should but my scripts are not saving & I have qsave at the end. I don’t know if I’m using the program wrong or what. Trying to see where the problem is. Any help would be appreciated. Thanks
I’m using DraftSight. Can I use ScriptPro to run a script file for multiple files ?
Hi David,
I’ve never used DraftSight.I apologize if I can’t confirm this.
Edwin:
You almost got to the ripest fruit… in addition to `If you have multiple flavors…’ it should be mentioned that you can also use your version(s) associated accoreconsole.exe as a `version’. The AutoCAD core console opens in a `non-graphical’ window, similar to the command prompt. There are several `graphical’ operations that you can’t do with the accoreconsole, but plotting isn’t one of them. We often batch plot several hundred drawings at a time. The accoreconsole doesn’t `re-draw’ each file it processes – it merely plots from the drawing database without displaying it on the screen. So it’s fast. Ultra-fast. A script to plot by opening each of 100 drawings takes hours… but the same script used to plot using accoreconsole.exe takes minutes. Accoreconsole.exe has been right next to your acad.exe for years.
Thank you very much, Garry!
That’s a very helpful information. I will take a look and write something about it. Or do you want to write an article for CADnotes?
HI Edwin
just read your article on “Run a script on multiple DWG with ScriptPro”. We are not allowed to install programs at my work. Is there a portable version available?
Thanks
Gennaro Palmieri
Gennaro,
Unfortunately there’s no portable version of ScriptPro. At least not that I’m aware of.