The AutoCAD program ships with a utility called the
AutoLISP Debug Adapter which allows VS Code and AutoCAD to communicate with each other.
Communication between VS Code and AutoCAD is established when either of the AutoLISP debug configurations are used. These debug configurations can be defined by following the steps in
To Setup the AutoCAD AutoLISP Extension for Debug.
When an instance of AutoCAD is launched or attached to using one of the debug configurations you can:
- Add breakpoints and interrupt the execution of an AutoLISP program to evaluate its current state
- Evaluate selected expressions
- Load an AutoLISP source (LSP) file into AutoCAD
- Watch local and global variables during the execution of an AutoLISP program
- Inspect the call stack of an AutoLISP program
- Execute AutoLISP functions and AutoCAD commands in the Debug Console
Supported VS Code Debug Features
The following is a list of debug features that are supported by the AutoCAD AutoLISP Extension:
- View the call stack, including switching the stack frame
- Evaluate variables in the Watch window
- Inspect the current value of a variable when the mouse cursor is positioned it in the editor window
- See function parameters in the Variable window
- Add, remove, and disable breakpoints
- Step into, step out, and step over expressions
- Run to cursor
- Run-time error and syntax checking
- View the value of the last executed expression via the
*LAST-VALUE* variable
VS Code Debug Features Not Supported
The following is a list of debug features that are not supported by the AutoCAD AutoLISP Extension:
- Pause
- Conditional and data breakpoints
- Set variables
- Log points
- Memory and assemble codes