AutoLISP with VS Code

Sunday, January 25, 2026

To develop AutoLISP macros, VLIDE (Visual Lisp IDE) is traditionally used. But since AutoCAD 2021, Autodesk offers an alternative: VS Code with the AutoCAD AutoLISP Extension.

Installing Microsoft Visual Studio Code and the AutoCAD AutoLISP Extension

When you type VLISP on the command line for the first time with a freshly installed version of AutoCAD, the following screen is displayed:

First run of VLIDE

If you choose the first option and Visual Studio Code is not installed, you will see the following screen:

Installing VS Code

The Download link will take you to the Visual Studio page. Be careful here, Visual Studio is different from Visual Studio Code. It is a complete development environment, while Visual Studio Code is a code editor. Visual Studio is not at all suitable for AutoLISP development, you need Visual Studio Code. You can download it for free here.

Choose the installation for the current user for Windows x64.

The next step is installing the AutoCAD AutoLISP Extension. Just click the Install button and follow the instructions.

Restart VLISP, you should switch to VS Code and the following message should appear:

First run of VS Code

Writing AutoLISP Code with VS Code

Press Ctrl + N to create a new file. Press Ctrl + K, release Ctrl and press M to choose the AutoLISP language.

Type the following code:

(defun c:hello ()
  (princ "Hello, World!")
  (princ)
)

Running AutoLISP Code

Press Ctrl + F5 to run the code. VS Code will prompt you to save your file with a .lsp extension.

Switch to AutoCAD and type the name of the command you just created (HELLO). Hello, World! should appear in AutoCAD's text window.

Debugging AutoLISP Code

The extension includes a debugger. You can set a breakpoint on a line of code with F9. When you run your HELLO command again, the debugger will activate, VS Code will come to the foreground, and you will be able to inspect variables, the call stack, etc.

You can even use VS Code's integrated console to execute AutoLISP commands.

Advantages over VLIDE

You have a much more modern code editor that allows you to use AI. VS Code offers many features such as multiple cursors, Git integration, refactoring (symbol renaming for example) that make you more productive.

Limitations

To compile to fas, there is no button that lets you do it in one click, you must use vlisp-compile:

(vlisp-compile 'st "my_program.lsp")

Well, it's not very complicated, so it's not a big deal.

To create a VLX, normally in VLIDE, you need to use the wizard that lets you create an application. At Autodesk, they thought of this, as they added a command to AutoCAD named MAKELISPAPP to launch this wizard without going through VLIDE.

And if you prefer the command line, you can generate the .VLX with vlisp-compile:

(vlisp-compile 'make "C:\\my_application_directory\\")

But you will need to create the .prv file first using the wizard.

Switching back to VLIDE

If you can't get used to the environment, you can switch to VLIDE by modifying the LISPSYS system variable. Set it to 0 and restart AutoCAD.

To return to VS Code, set it to 1.

Conclusion

I know it's not easy to change your habits, but you have everything to gain by switching to VS Code for developing your AutoLISP programs.

If you want more information on the subject, consult the official AutoCAD documentation here.


Helping hand Need an AutoCAD (AutoLISP, ObjectARX, .NET, VBA) development? Contact me for a free quote.