To Launch and Attach an Instance of AutoCAD to VS Code for Debugging (AutoLISP/VS Code)

Note: Debugging is not available in AutoCAD LT.
  1. In Visual Studio Code, open and activate an editor window that contains the AutoLISP source code to debug.
  2. On the Activity Bar, click Debug and Run (or click View menu > Debug).


  3. Click the Configurations drop-down list and choose one of the following configurations:
    • AutoLISP Debug: Launch – Launches a new instance of AutoCAD and attaches VS Code to that instance
    • AutoLISP Debug: Attach – Allows you to attach VS Code to an instance of AutoCAD that is already running


  4. Click Start Debugging or press F5.


    A new instance of AutoCAD is started if you choose AutoLISP Debug: Launch from the Configurations list.

  5. If you choose AutoLISP Debug: Attach from the Configurations list, choose acad (or AutoCAD on Mac OS) from the list of running processes.


Whether you start debugging with the AutoLISP Debug: Launch or AutoLISP Debug: Attach configuration, VS Code should now be attached to an instance of the AutoCAD application. Once attached to AutoCAD, you should see the Debug toolbar displayed above the active editor window.



The Debug toolbar contains these tools: