AutoCAD Core Console
AutoCAD Core Console is a version of AutoCAD without a graphical user interface and is based on the AutoCAD "core" (accore.dll). This version of AutoCAD is a powerful tool that allows a developer to batch process multiple drawings and automate repetitive tasks that don't require user interaction, such as providing input in dialog boxes, specifying values at user prompts, and selecting objects.
Despite the minimalist design, Core Console supports the full range of AutoCAD application programming interfaces (APIs). This allows developers to load and use AutoLISP programs, .NET assemblies, as well as ObjectARX applications. As you develop custom applications and scripts, keep in mind the limitations of Core Console and implement robust error handling and reporting.
How to Use AutoCAD Core Console
To run the AutoCAD Core Console, navigate to the AutoCAD installation directory on your workstation and locate the accoreconsole.exe file. Once the file has been located, in Windows, open the Command Prompt window and enter the the full path to accoreconsole.exe at the command-line prompt.
By default, accoreconsole.exe can be found in the folder: <drive>:\Program Files\Autodesk\AutoCAD <release>
The command-line prompt usage of the Core Console is as follows:
AcCoreConsole.exe [/i <input dwg>] /s <script> [/product <product>] [/l <language>] [/isolate <userid> <userDataFolder>] [/readonly] [/p[rofile] <profile>] [/loadmodule <module>]
Here's an example of how to launch Core Console based on the English version of AutoCAD and open a drawing file named Floor Plan.dwg before the execution of a script file named cleanup.scr:
accoreconsole.exe /i "Floor Plan.dwg" /s "cleanup.scr" /product ACAD /l en-US
Here's another example that launches Core Console based on the French version of the Civil 3D toolset:
accoreconsole.exe /product C3D /l fr-FR
The following table lists the command-line switches that Core Console supports:
Switch | Description |
---|---|
/i |
Specifies the drawing (DWG) file to open. |
/s |
Specifies the script file to execute after the drawing file has been opened. |
/product |
Specifies the product name to use when AutoCAD and specialized toolsets are installed. For example, 'ACAD' uses AutoCAD and not a specialized toolset, if one is installed. |
/l |
Sets the product language. For example, 'en-US' sets the language to English. |
/readonly |
Indicates the drawing (DWG) file specified by the /i switch should be opened as read-only. |
/p |
Specifies the profile name to use when starting Core Console. |
Which Commands Are Supported?
Core Console supports many, but not all commands available in AutoCAD. Any command that displays a dialog box or palette will not be available, you will need to use the equavilent command-line version of that command, if one is available. For example, the PROPERTIES command displays the Properties palette, but you can edit the common properties of an object using the CHPROP and CHANGE commands. Similarly, instead of using the LAYER command, use the -LAYER command instead to create and manage layers in the current drawing.
The following table contains a subset of the commands Core Console does not support:
-ACTSTOP | ADJUST | NEW | QVLAYOUTCLOSE |
-ACTUSERMESSAGE | CLASSICLAYER | OBJECTSCALE | RECOVERALL |
-DGNATTACH | CLASSICXREF | PAN | RIBBON |
-DGNBIND | CLOSE | PASTEASHYPERLINK | RIBBONCLOSE |
-NAVSMOTION | CUI | PASTECLIP | RTPAN |
-PDFATTACH | CUIEXPORT | PDFATTACH | RTZOOM |
-QVDRAWING | CUIIMPORT | PROPERTIES | SCALELISTEDIT |
-QVLAYOUT | DGNATTACH | PROPERTIESCLOSE | ULAYERS |
ACTBASEPOINT | LAYER | QCCLOSE | VTOPTIONS |
ACTMANAGER | MLEDIT | QUICKCALC | |
ACTRECORD | MLSTYLE | QUICKCUI | |
ACTSTOP | NAVSMOTION | QVDRAWING | |
ACTUSERINPUT | NAVSMOTIONCLOSE | QVDRAWINGCLOSE | |
ACTUSERMESSAGE | NAVSWHEEL | QVLAYOUT |
API Limitations
The following sections discuss limitations with the AutoCAD APIs available for use with Core Console.
ActiveX API
The AutoCAD ActiveX API isn't available for use with AutoLISP or any other programming language that supports ActiveX/COM.
ObjectARX Applications with CRX File Extension
ObjectARX applications commonly have a file extension of ARX. ObjectARX applications that are developed for use with AutoCAD "core" are known as Console Runtime Extension or CRX files.
Managed .NET and ObjectARX UI Libraries
Applications built using the Managed .NET and ObjectARX libraries must not use classes and functions, or reference library files that access the AutoCAD user interface (UI).
Examples of this are:
- AcMgd.dll should not be referenced by a Managed .NET application, doing so could result in the Core Console crashing
- MFC and WPF dialog boxes and UI are not accessible
For information on which librariy files can safely be referenced for ObjectARX applications, see ObjectARX and ObjectDBX Libraries Reference.
Handling and Logging Errors
As a developer, you must handle unexpected errors in your custom programs and scripts being loaded into and used within Core Console, similar to how you might handle them in AutoCAD. Consider a way to log progress and potential points of failure to help identify where something might have gone wrong during execution of a custom program or script. For a script, which commonly executes a series of commands with defined options and values, you could consider utilizing AutoLISP to write messages to a log file to be reviewed if an error occurs.
Loading Custom Programs and Trusted Locations
Custom programs that you want to load into Core Console must be located in a trusted location. If your custom programs are not listed in a trusted location, Core Console will fail to load the files. Here is an example of trying to load an AutoLISP program file named dwg-cleanup-utilities.lsp that is not in a trusted location:
Command: (load "C:/AutoCAD/Custom/LISP Files/dwg-cleanup-utilities.lsp")
; error: File load canceled: C:/AutoCAD/Custom/LISP Files/dwg-cleanup-utilities.lsp
To specify a trusted location, do the following:
- Start AutoCAD.
- Open the Options dialog box (OPTIONS command).
- In the Options dialog box, Files tab, select the Support File Search Path node.
- Click Add and then click Browse.
- In the Browse for Folder dialog box, browse to and select the folder that contains your custom program files. Click Open.
- Next, select the Trusted Locations node.
- Click Add and then click Browse.
- In the Browse for Folder dialog box, browse to and select the folder that contains your custom program files. Click Open.
- Click OK to save the changes.
- Close and restart Core Console to apply the changes.
/p
command-line switch to specify which user profile is current when Core Console is launched, rather than the most recently used user profile in AutoCAD.