AutoLISP with VS Code
Sunday, January 25, 2026· updated on Wednesday, April 15, 2026To 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:

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

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:

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.
Another major advantage: VS Code offers multi-file search and replace (Ctrl + Shift + H). This is extremely useful when you need to rename a variable or function used throughout your project. In VLIDE, you have to open each file one by one and perform the replacement manually.
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, in VLIDE, you use the File → Make Application menu which launches a wizard. At Autodesk, they thought of this, as they added a command to AutoCAD named MAKELISPAPP which launches the same wizard from VS Code, without going through VLIDE.
Whether you go through one or the other, the wizard (Make Application) lets you define the files and options used to build a VLX application, and generates a .PRV file that contains the entire configuration of your application. From there, you can:
- Edit the configuration of your application using the Properties option, which lets you reopen and modify the .PRV file.
- Rebuild the VLX using the corresponding option, without having to go through all the wizard steps again.
Note: do not confuse .PRV and .PRJ files. The .PRJ file is the project definition file, used both by VLIDE and by the VS Code extension: it contains the location and names of all source files that make up the project, as well as certain parameters and rules for generating the final FAS files. The .PRV file, on the other hand, describes the build configuration of a VLX application; it is generated by the Make Application wizard, whether you launch it from VLIDE (File → Make Application) or from VS Code via MAKELISPAPP.
Working with multiple source files
Unlike VLIDE, the VS Code extension unfortunately does not provide a mechanism to load all files of a project in a single operation. If your application is made up of multiple files, a good practice is therefore to create a bootstrap file that loads all your files.
The list of source files of your application is maintained in a .PRJ file (via VLIDE's project explorer or the VS Code extension). This file looks like:
(VLISP-PROJECT-LIST
:name
MyApplication
:own-list
("utils" "commands" "dialogs")
...
)
Files are listed in the :own-list section, without their .lsp extension. So we can write a loader that reads the .prj to extract the files to load:
;; loader.lsp — loads files listed in the .prj
(defun load-from-prj ( prjFile / base file line content start endPosition
listString position nameStart nameEnd name )
(setq base (vl-filename-directory prjFile))
(setq file (open prjFile "r"))
(setq content "")
(while (setq line (read-line file))
(setq content (strcat content line " "))
)
(close file)
(setq start (vl-string-search ":own-list" content))
(if start
(progn
(setq start (vl-string-search ":own-list" (strcase content T)))
(setq endPosition (vl-string-search ")" content start))
(setq listString (substr content (+ start 2) (- endPosition start 1)))
(setq position 0)
(while (setq nameStart (vl-string-search "\"" listString position))
(setq nameEnd (vl-string-search "\"" listString (1+ nameStart)))
(setq name (substr listString (+ nameStart 2) (- nameEnd nameStart 1)))
(load (strcat base "\\" name ".lsp"))
(setq position (1+ nameEnd))
)
)
)
(princ "\nApplication loaded.")
(princ)
)
(load-from-prj "D:/Projects/MyApplication/MyApplication.prj")
For the function to locate the .prj file, you have two options:
- Hardcoded absolute path: as in the example above, you specify the full path to the .prj file.
- Use
findfile: if you add the directory containing the .prj to AutoCAD's search path (Options → Files → Support File Search Path), you can simply write(load-from-prj (findfile "MyApplication.prj")).
The advantage of this approach is that you have a single source of truth: the .prj file. When you add or remove a file in the project explorer, the loader picks it up automatically. Every time you want to test your application, just start debugging on this file to reload all the code.
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.
Need an AutoCAD (AutoLISP, ObjectARX, .NET, VBA) development? Contact me for a free quote.