To Setup the AutoCAD AutoLISP Extension for Debug (AutoLISP/VS Code)

Note: Debugging is not available in AutoCAD LT.

How you configure the AutoLISP Extension for debug depends on which version you are using. The following steps explain how to identify which version of the extension you are using:

  1. In Visual Studio Code, click File menu > Preferences > Extensions.
  2. In the Extensions view, clear any text from the Search box.
  3. Under the INSTALLED section, locate AutoCAD AutoLISP Extension in the list.

    The version number of the extension will be next to its name.

Setting up attach and launch configurations (Version 1.3.2 and Later)

  1. In Visual Studio Code, click File menu > Preferences > Settings.
  2. On the User tab, expand Extensions and click AutoCAD AutoLISP Configuration.

  3. In the Debug: Attach Process text box, enter one of the following values in bold:
    • (Windows) acad
    • (Mac OS) AutoCAD
    Note: The process name is case sensitive, so acad or AutoCAD isn’t the same as ACAD or autocad.
  4. In the Debug: Launch Program text box, enter the absolute path to the AutoCAD executable.

    The absolute path varies based on the release and platform on which AutoCAD was installed.

    • (Windows) "C:\Program Files\Autodesk\AutoCAD 2024\acad.exe"
    • (Mac OS) "/Applications/Autodesk/AutoCAD 2024/AutoCAD 2024.app/Contents/MacOS/AutoCAD"
  5. Optionally, in the Debug: Launch Parameter text box, specify any command line switches during the launch of the AutoCAD application.

Setting up attach and launch configurations per folder (Version 1.3.2 and Earlier)

Note: A folder must be opened before debug configurations can be added, and debug configurations should not be added to a workspace but to a folder only. See To Open a Folder for steps on opening a folder.
  1. In Visual Studio Code, on the Activity Bar, click Debug and then click Create a launch.json File (or click Debug menu > Open Configurations).


  2. On the Configurations menu, choose AutoLISP Debug: Attach.


    A new file named launch.json that contains the AutoLISP Debug: Attach configuration should now be open in the current editor window.

  3. In the editor window, lower-right corner, click Add Configuration and then choose AutoLISP Debug: Launch from the list that is displayed.
  4. In the launch.json editor window, make the following changes (example edits show in bold) based on your installed OS.
    1. Path attribute of the AutoLISP Debug: Launch configuration needs to be updated to the absolute path to the AutoCAD executable.
    2. Process attribute of the AutoLISP Debug: Attach configuration should be updated to the process name of the AutoCAD application.
      Note: The process name is case sensitive, so acad or AutoCAD isn’t the same as ACAD or autocad.
    3. Optionally, the Params attribute of the AutoLISP Debug: Launch configuration can be updated to specify any command line switches to use when the AutoCAD application is launched.
    launch.json file on Windows
    {
        "configurations":
        [
            {
                "type": "launchlisp",
                "request": "launch",
                "name": "Autolisp Debug: Launch",
                "attributes": {
                    "path": "C:\\Program Files\\Autodesk\\AutoCAD 2024\\acad.exe",
                    "params": ""
                }
            },
            {
                "type": "attachlisp",
                "request": "attach",
                "name": "Autolisp Debug: Attach",
                "attributes": {
                    "process": "acad"
                }
            }
        ]
    }
    launch.json file on Mac OS
    {
        "configurations":
        [
            {
                "type": "launchlisp",
                "request": "launch",
                "name": "Autolisp Debug: Launch",
                "attributes": {
                    "path": "/Applications/Autodesk/AutoCAD 2024/AutoCAD 2024.app/Contents/MacOS/AutoCAD",
                    "params": ""
                }
            },
            {
                "type": "attachlisp",
                "request": "attach",
                "name": "Autolisp Debug: Attach",
                "attributes": {
                    "process": "AutoCAD"
                }
            }
        ]
    }
  5. Click File menu > Save to save the changes to the launch.json file.