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

Setting up attach and launch configurations

  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 2021\acad.exe"
    • (Mac OS) "/Applications/Autodesk/AutoCAD 2021/AutoCAD 2021.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 (Obsolete)

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 2021\\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 2021/AutoCAD 2021.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.