With the release of AutoCAD 2013, there is a new feature that is called the “Core Console.” This Core Console is a stripped down version of of AutoCAD that includes no buttons or user interface other than what looks like a cryptic command line.
After launching the Core Console it looks a lot like the windows command line…
Notice the size of the Core Console. It weighs in at only 27kb on my computer. compare that to the acad.exe which loads when you open the normal AutoCAD interface and you can see why this Core Console can be your new best friend when it comes to batch processing files.
So if you need to run batch routines on files, the Core Console is meant to be quick and capable of running AutoCAD script files (.scr), LISP routines, .NET (dot net) dlls and other programming routines. (I am only familiar with script files and LISP so that is where I will focus my attention).
As I mentioned above, the Core Console is limited in what it can do. And luckily Kean Walmsley has already done the hard part and found out what commands the Core Console will recognize found [here] and Kean has also put together a nifty .txt file that contains the available commands as well found [here]. Thanks for putting that together Kean!!
If you have launched the Core Console as shown above go ahead and close it. You can see that it is a bit cryptic in that it isn’t obvious as to how to even use it even though they give an example of the syntax… It took me a while to get it to run for me and like the name of the post, I want to get you up and running with it as well.
For this post we will learn how to run the Core Console 2 ways. 1) by running ScriptPro 2.0 and 2) by running it by itself through a windows .bat (batch) file. Both ways we will use the same AutoCAD script file that prints the layout tab named “Layout1″ to a PDF file.
If you would like to follow along with this example – Create a folder on your C: drive and name it “Test”. Place some drawings that contain a layout tab called “Layout1″ and also place a copy of the below AutoCAd script file called “Plot2PDF.scr” in the C:\Test folder.
Link to script “Plot2PDF.scr” > https://docs.google.com/file/d/0B_y9I236zHwOYm00NllzbVRsQ2s/edit?usp=sharing
Using ScriptPro 2.0
ScriptPro 2.0 is free and can be downloaded from the following [THIS] link. The old version of ScriptPro does not let you set the Core Console to run the batch. The old version automatically uses the full-blown acad.exe file.
Once you have it installed go ahead and launch ScriptPro 2.0
There should be a desktop icon that was installed or you can navigate to it by:
Start > All Programs > Autodesk > ScriptPro.exe (shown below)
The only trick to using ScriptPro and the Core console is setting ScriptPro to use the correct .exe file.
Once ScriptPro is open,
- Click “Settings”
- Browse – navigate to C:\Program Files\Autodesk\AutoCAD 2013\accoreconsole.exe Select the .exe file.
- Click OK
Now that the Core Console is set, you can build a list of files and select a script as normal.
To select files:
Click “Add From Folder” button and then browse to a folder from the list and then click OK.
One great thing about ScriptPro is that you can build a list
To select a script file that will be run on each of the files:
- Click “Browse” in the “Script file” section
- Browse to the location of the script file
- Select the script
- Click “Open”
Now that the files are listed and the script file is set the batch process can use the Core Console to process the files.
To process the files that have a check mark next to them press the button “Checked” (shown below)
To use a batch file (.bat) use the following and adjust accordingly for your needs.
If you copy the following line into a Notepad file and save it with the extension .bat it will become a batch file.
But before you run it, it would be nice to know what it is doing so below is a simple explanation of what the .bat file does:
Here is the content of the batch file:
FOR %%f IN (“c:\Test\*.dwg”) DO “C:\Program Files\Autodesk\AutoCAD 2013\accoreconsole.exe” /i “%%f” /s “c:\Test\Plot2PDF.scr” /l en-US
Make sure to copy it as it is shown in the picture -meaning in one line. I was not able to get it to run when the content was on multiple lines. It only worked for me when it was all in one line. (but then again, I am a novice at these batch routines….)
The result of this is the following: it created PDFs of Layout1 of each of the drawings and placed the PDFs in the same folder as the drawings.