Compiling AutoLISP Files (AutoLISP/VS Code)

AutoLISP source (LSP) files can be compiled into FAS and VLX files before being deployed or distributed to protect and optimize the statements contained within them.

Note: The ability to compile a LSP file is supported in AutoCAD for Windows only; not available in AutoCAD LT for Windows. VLX files can be loaded on Windows only.

Each time you load AutoLISP source code, that code is translated into instructions the computer understands (executable code).

The advantage of having source code translated each time it is loaded, is that it can be changed and immediately used. This is useful for quickly testing new code and for debugging code.

Once you are sure your program is working correctly, translating AutoLISP source code each time it loads is time-consuming. AutoCAD provides a compiler that generates executable machine code files from your source code files. These executable files are known as FAS files. Because executable files only contain machine-readable code, the source code you spent weeks or months developing remains hidden even if you deploy or distribute your program to thousands of users. Strings and symbol names are encrypted when compiled.

AutoCAD also provides features for packaging complex AutoLISP applications into a Visual LISP executable (VLX) file also known as an application module. VLX files can include additional resources files, such as TXT and DCL files, and compiled AutoLISP code. Using VLX files, you can further control your application's operating environment by exposing only those functions you choose to expose, and by maintaining a wall between your program's variables and the variables users can interact with in AutoCAD.

There are several ways to access and use the AutoLISP compiler. The method you choose to compile your files depends on the number of files you are compiling, and if you want to compile multiple source code files into a single application file. You can compile:

Application Modules

AutoCAD provides the ability to create a single, stand-alone executable module for an application.

This module can incorporate multiple compiled and source code files, and can include DCL, DVB, and other files that your application may need. Executable Visual LISP modules are known as an application module, and are stored in files with a .vlx extension.

The Make Application Wizard guides you through the application building process in AutoCAD. The result of this process is an application make (PRV) file, which has a .prv extension. The PRV file contains all the instructions AutoCAD needs to build the Visual LISP executable (VLX) file.

If you change just a small piece of your application's source code, you can have AutoCAD rebuild your VLX file while compiling only the updated files.

AutoCAD rebuilds the application based on the information contained in the PRV file, and automatically compiles any application source code files if: