AutoLISP has been around for a long time. But it is still a great tool to create programs inside of AutoCAD. The latest release of AutoCAD 2021 has made a couple of improvements to the AutoLISP and DCL environments. We take this as a commitment from Autodesk this oldie is still a goodie.
AutoLISP Improvements
Improvements have been made to AutoLISP and DCL. These improvements include:
- Cross-platform development with Microsoft Visual Studio (VS) Code
- Unicode support
- DCL is now supported on Windows and Mac
New Commands
MAKELISPAPP – Compiles one or more AutoLISP (LSP) source files into an application (VLX) file that can be distributed to users and protect your code.
Changed Commands
VLISP – Displays the AutoLISP development environment.
New System Variables
LISPSYS – Controls the default AutoLISP development environment started with the VLISP command.AutoLISP Extension for Microsoft Visual Studio (VS) Code
A new AutoLISP extension was released for use with VS Code that allows you to edit and debug AutoLISP source (LSP) files with AutoCAD.
Using the AutoLISP extension, you can:
- Create and modify LSP files using features such as Autocomplete and Code Snippets
- Format all or selected code statements in a LSP file
- Add watches and breakpoints while debugging a LSP file
- Execute AutoLISP code statements and AutoCAD commands in the Debug Console
For information on getting started with VS Code and the AutoCAD AutoLISP Extension, see Getting Started with Visual Studio Code.AutoLISP Unicode Support
AutoLISP in AutoCAD 2020-based and earlier products didn’t fully support Unicode characters. Many functions related to working with strings only supported the multibyte character set (MBCS) which caused problems with functions that relied on knowing the length of a character or that returned the length of several characters in a string. You can learn more about the functions that were updated to support Unicode characters in the New and Changed AutoLISP Functions Reference (AutoLISP) topic.