AutoLISP Compilation Architecture¶
The three-tier compilation pipeline from editable source to distributable binary, including the .fas intermediate format and .vlx application bundle.
Note
This document is reverse-engineered from the src/TB11-01x32/ and src/PB11-00x32/ source trees, their Visual/ subdirectories, and the Visual LISP IDE project files (CSV.PRJ, CSV.MKP). It describes the original build architecture used for ConstructiVision v11.
The Three File Formats¶
.lsp — AutoLISP Source (Editable)¶
Property |
Value |
|---|---|
Format |
Plain text (LISP S-expressions) |
Editable |
Yes — any text editor |
IP Protection |
None — fully readable |
Loaded via |
|
Location |
|
The raw source code. Each .lsp file typically defines one or more defun functions. ConstructiVision v11 has ~126 .lsp files comprising the full application.
Example:
;; panel.lsp — defines the panel drawing engine
(defun panel ()
;; ... draw concrete panels in AutoCAD
)
When to use: Development and alpha testing. Source files are edited in VS Code, committed to git, and deployed directly to alpha test VMs via nightly git pull. The test build (TB11-01x32) runs from raw .lsp files loaded individually by csv.lsp. No compilation step is needed during the alpha R&D cycle.
.fas — Compiled AutoLISP (Intermediate)¶
Property |
Value |
|---|---|
Format |
Visual LISP bytecode (binary) |
Editable |
No — compiled intermediate |
IP Protection |
Partial — not trivially readable, but not encrypted |
Created via |
|
Location |
|
The missing middle tier in most ConstructiVision documentation. FAS files are individually-compiled bytecode modules — one .fas for every .lsp source file. They are the intermediate artifacts in the build pipeline.
How they’re created:
;; Single-file compilation in AutoCAD command line or VLIDE Console
(vlisp-compile 'st "C:/Program Files/ConstructiVision/panel.lsp")
;; Output: panel.fas (same directory, or :FAS-DIRECTORY from project)
;; Compilation modes:
;; 'st = Standard (smallest, optimized) — used for production
;; 'lsm = List assembly (includes debug symbols)
;; 'lsa = List assembly with original source embedded
Evidence in the repo:
The Visual/ subdirectory in both TB11-01x32 and PB11-00x32 contains one .fas file for every .lsp module — over 80 .fas files:
Visual/
├── BP_DLG.FAS ← compiled from bp_dlg.lsp
├── BPAUTO.FAS ← compiled from bpauto.lsp
├── BRACE.FAS ← compiled from brace.lsp
├── CSV.FAS ← compiled from csv.lsp
├── PANEL.FAS ← compiled from panel.lsp
├── ... (80+ more)
Each .fas also has a corresponding .xdv (cross-reference/debug) file:
Visual/BPAUTO.XDV:
;;; for C:/PROGRAM FILES/AUTOCAD R14/CONSTRUCTIVISION/VISUAL/BPAUTO.FAS
The project file (CSV.PRJ) specifies where FAS files are output:
:FAS-DIRECTORY "C:/Program Files/ACAD2000/Csv/tmp"
:TMP-DIRECTORY "C:/Program Files/ACAD2000/Csv/tmp"
When to use: FAS files are rarely used alone. They exist as build intermediates. However, they can be distributed and loaded individually via (load "panel.fas") — this provides moderate IP protection without the overhead of a full VLX bundle.
.vlx — Visual LISP eXecutable (Distributable)¶
Property |
Value |
|---|---|
Format |
Encrypted binary bundle (contains FAS + DCL + resources) |
Editable |
No — opaque, protected binary |
IP Protection |
Strong — encrypted bytecode, no free decompiler exists |
Created via |
“Make Application” wizard in VLIDE, or |
Loaded via |
|
Location |
|
The production distribution format. A single .vlx file bundles:
All compiled FAS modules (~85+ modules)
All DCL dialog files (~26+
.dclfiles)Auto-initialization functions (entry points)
Optional: Separate namespace, ActiveX support, protection flags
When to use: Public release, customer distribution, Autodesk App Store submission. This is the only format that provides meaningful IP/code protection.
Development Workflow — VS Code to Alpha VMs¶
All source editing happens in VS Code on the development machine using the AutoCAD AutoLISP Extension. This provides syntax highlighting, bracket matching, and IntelliSense for .lsp and .dcl files. The workflow is:
DEVELOPMENT MACHINE ALPHA TEST VMs (108, 201, 202)
┌─────────────────────────┐ ┌──────────────────────────────┐
│ VS Code + AutoLISP Ext │ │ AutoCAD 2000 │
│ │ │ │
│ Edit .lsp / .dcl files │ │ csv.lsp loads each .lsp │
│ in src/TB11-01x32/ │──git push──│ individually (source mode) │
│ │ │ │
│ Commit & push to main │ git pull │ Nightly scheduled task │
│ │──(22:00)──→│ pulls latest source │
│ │ │ │
│ │ │ Junction: C:\Program Files\ │
│ │ │ ConstructiVision → repo │
└─────────────────────────┘ └──────────────────────────────┘
Alpha Testing Cycle (Source Mode)¶
Edit
.lsp/.dclfiles in VS Code (src/TB11-01x32/)Commit changes to
mainbranchDeploy automatically — VMs pull at 22:00 nightly (or manual
git-pull.bat)Test on VMs — AutoCAD loads raw
.lspsource viacsv.lspIterate — no compilation step needed; edit → push → test
This is the active workflow during R&D and alpha testing. Alpha testers (Tai on VM 201, Dat on VM 202) run directly from source code. The git sparse checkout ensures VMs only receive src/TB11-01x32/.
Tip
No compilation is needed during alpha. Edit in VS Code, push, and the VMs pick up changes automatically. The source-mode fallback in csv.lsp handles everything.
Why VS Code, Not VLIDE¶
The Visual LISP IDE (VLIDE) inside AutoCAD is used only for compilation (FAS/VLX builds). Day-to-day editing uses VS Code because:
Modern editor features (multi-cursor, search/replace, git integration)
AutoLISP Extension provides syntax highlighting and bracket matching
Files are in a git repo — full version control and diff history
Can edit from any machine, not just one with AutoCAD installed
Side-by-side comparison of legacy (
PB11-00x32) vs test (TB11-01x32) builds
The Compilation Pipeline (Beta/Production Only)¶
Compilation only happens when transitioning from alpha to beta or preparing a production release. The pipeline is:
SOURCE INTERMEDIATE DISTRIBUTABLE
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ csv.lsp │──compile──│ CSV.FAS │──bundle───│ │
│ panel.lsp │──compile──│ PANEL.FAS │──bundle───│ CSV.VLX │
│ enable.lsp │──compile──│ ENABLE.FAS │──bundle───│ (single │
│ ... │──compile──│ ... │──bundle───│ file) │
│ (126 files)│ │ (126 .fas) │ │ │
├─────────────┤ └─────────────┘ │ │
│ wall_dlg.dcl│────────────────────────────embed───│ │
│ panel.dcl │────────────────────────────embed───│ │
│ ... │────────────────────────────embed───│ │
│ (44 .dcl) │ └─────────────┘
└─────────────┘
Step 1: Source → FAS (Compilation)¶
Each .lsp is compiled to .fas bytecode. This can be done:
Individually via
(vlisp-compile 'st "file.lsp")Batch via a project file or the
compile-all.lspscriptAutomatically by the VLIDE Make Application wizard
Step 2: FAS + DCL → VLX (Bundling)¶
The Make Application process (driven by CSV.MKP) takes all .fas files plus .dcl resource files and packages them into a single .vlx:
;; From CSV.MKP — the actual build script:
;; 1. Generate the target FAS-file list
(setq -&&-fas-filenames
(make-package-fas-list
-&&-init-file
-&&-source-list))
;; 2. Bind FAS & DCL files into executable
(make-package+
-&&-executable-names ; → "CSV.ARX" / "CSV.VLX"
-&&-fas-filenames ; → all compiled .fas modules
-&&-xdf-list ; → cross-reference data (nil)
-&&-dcl-list ; → all .dcl dialog files
-&&-target-init-functions ; → auto-init entry points
)
How csv.lsp Detects the Runtime Mode¶
The loader (csv.lsp) detects whether it’s running from VLX or raw source:
;; Check if VLX is loaded (appears in the ARX list)
(set 'ok nil)
(foreach a (arx)
(if (or (wcmatch a "*vlide*") (wcmatch a "*csv*"))
(set 'ok "t")))
(if ok
;; VLX mode: functions already compiled, just expose them
(progn
(vl-acad-defun 'panel)
(vl-acad-defun 'drawpan)
;; ... 85+ vl-acad-defun calls
)
;; Source mode: load each .lsp individually
(if (not panatt)
(foreach a csvlst (load a))))
VLX mode: Functions are already compiled inside the VLX.
vl-acad-defunpromotes them from the VLX’s separate namespace to the global AutoCAD command namespace.Source mode: Falls back to
(load "modulename")for each of the ~85 modules incsvlst.
The Project Files¶
Two project files drive the build process:
CSV.PRJ — Visual LISP Project Definition¶
Field |
Purpose |
|---|---|
|
Project identifier |
|
All ~109 |
|
Output directory for compiled |
|
Scratch space during compilation |
|
Compilation mode (standard = optimized) |
|
Enable safe mode checks |
|
Target language context |
Location: src/TB11-01x32/csv.prj (AutoCAD 2000 era) and src/TB11-01x32/Visual/CSV.PRJ (R14 era)
The R14 Visual/CSV.PRJ lists 109 source modules — more than the 85 in csvlst, because it includes modules that were later refactored or merged (e.g., basedim, bolt, dreng, drread, editbx, elevmrkr, engexp, engimp, makepan, native, etc.).
CSV.MKP — Make Application Script¶
The actual build recipe. Contains:
Source list — Every
.lspand.dclfile to includeExecutable target — Output
.vlx(and companion.arx)Init functions — Which functions auto-initialize on load
Build instructions — Compile, bundle, and bind steps
Location: src/TB11-01x32/Visual/CSV.MKP
Warning
The CSV.MKP still references R14-era paths (C:/PROGRAM FILES/AUTOCAD R14/CONSTRUCTIVISION/VISUAL/). These must be updated to current paths before recompilation. See Recompilation for Beta / Production Deployment below.
Supporting Files¶
.xdv — Cross-Reference/Debug Files¶
Each compiled module generates a .xdv file containing debug metadata:
;;; Cross-reference data
;;; for C:/PROGRAM FILES/AUTOCAD R14/CONSTRUCTIVISION/VISUAL/PANEL.FAS
Not needed for distribution — development artifact only.
.arx — ObjectARX Extension¶
CSV.ARX is a compiled C++/ObjectARX module that provides the Visual LISP runtime bridge. It is generated alongside the VLX during the Make Application process.
Helper Batch Files¶
csv.lsp creates two batch files at runtime in the AutoCAD directory:
cv.bat— Creates nested directory structures for new projectscvplst.bat— Generates panel listing files (pnllist.txt)
Recompilation for Beta / Production Deployment¶
Compilation is the gate between alpha (source) and beta (protected binary). Do not compile during the alpha R&D cycle — work with raw .lsp source on the VMs. Compile only when:
Alpha testing is complete and code is stable
Transitioning to beta testers who should not see source code
Preparing a production release or App Store submission
Prerequisites¶
Component |
Minimum Version |
Purpose |
|---|---|---|
VS Code + AutoLISP Extension |
Latest |
Source editing and git workflow |
AutoCAD |
2000 (R15.0) |
Visual LISP IDE — compilation only |
Source files |
|
All editable source modules |
DCL files |
|
All dialog definitions |
Warning
Compilation must be done inside AutoCAD’s Visual LISP IDE (VLIDE). There is no standalone compiler. You need a running AutoCAD instance on one of the VMs.
Step-by-Step: Compile for Beta Release¶
1. Freeze Source in VS Code¶
Ensure all changes in src/TB11-01x32/ are committed and pushed. Tag the release:
git tag -a v11.0.1-beta1 -m "Beta 1 release candidate"
git push origin v11.0.1-beta1
All prior editing happens in VS Code with the AutoLISP extension. The source should be fully tested in alpha (source mode) before proceeding to compile.
2. Open the Visual LISP IDE¶
;; At AutoCAD command prompt:
VLIDE
3. Open or Create the Project¶
;; In VLIDE:
File → Open Project → navigate to csv.prj
;; Or: Project → New Project → add all .lsp files
4. Update Project Paths (First Time Only)¶
The existing CSV.PRJ and CSV.MKP contain hardcoded R14-era paths. Update to current:
Old (R14):
C:/PROGRAM FILES/AUTOCAD R14/CONSTRUCTIVISION/VISUAL/
Old (2000):
C:/Program Files/ACAD2000/Csv/
Current (TB11 on VMs):
C:/Program Files/ConstructiVision/
5. Compile All Sources to FAS¶
;; In VLIDE:
Project → Build Project (compiles all .lsp → .fas)
Or individually:
(vlisp-compile 'st "C:/Program Files/ConstructiVision/panel.lsp")
6. Build the VLX Application¶
;; In VLIDE:
File → Make Application → Existing Application Wizard
→ Select csv.mkp (or use New Application Wizard)
→ Verify all source files are listed
→ Options:
☑ Separate Namespace
☑ ActiveX Support
☑ Protected (encrypts bytecode for distribution)
→ Build
Output: CSV.VLX in the specified output directory.
7. Test the Compiled VLX¶
;; In a fresh AutoCAD session:
(load "CSV.VLX")
(c:CSV)
;; Verify all menu paths, dialogs, and functions work
8. Deploy¶
Copy the new CSV.VLX to the distribution package. Only these files are needed for end users:
File |
Purpose |
|---|---|
|
Compiled application (all code + dialogs) |
|
Menu loader (loads VLX and sets up menus) |
|
AutoCAD menu definitions |
|
Help file |
|
User manual |
Block/template files |
|
Tip
End users do not need any .lsp, .fas, .dcl, or .prj files when distributing via VLX. Everything is bundled inside CSV.VLX.
Autodesk App Store Distribution¶
The Autodesk App Store (apps.autodesk.com) accepts AutoCAD plugins in .bundle format, which can contain a VLX.
.bundle Format¶
A .bundle is a folder structure with a manifest:
ConstructiVision.bundle/
├── PackageContents.xml ← Manifest (required)
├── Contents/
│ ├── CSV.VLX ← Your compiled application
│ ├── csvmenu.lsp ← Menu loader
│ ├── csv.mnu ← Menu file
│ ├── csv.hlp ← Help file
│ └── Resources/ ← Blocks, templates, etc.
PackageContents.xml Example¶
<?xml version="1.0" encoding="utf-8"?>
<ApplicationPackage
SchemaVersion="1.0"
AppVersion="11.0.1.32"
AutodeskProduct="AutoCAD"
Name="ConstructiVision"
Description="Concrete construction estimating and panel book generation"
ProductType="Application"
ProductCode="{GUID-HERE}"
UpgradeCode="{GUID-HERE}"
>
<CompanyDetails
Name="ConstructiVision Inc."
Url="https://constructivision.com"
Email="support@constructivision.com"
/>
<RuntimeRequirements
OS="Win32|Win64"
Platform="AutoCAD"
SeriesMin="R15.0"
SeriesMax="R24.0"
/>
<Components Description="Main Application">
<RuntimeRequirements OS="Win32" Platform="AutoCAD" />
<ComponentEntry
AppName="ConstructiVision"
Version="11.0.1.32"
ModuleName="./Contents/csvmenu.lsp"
AppDescription="ConstructiVision Concrete Estimating"
LoadOnAutoCADStartup="True"
/>
</Components>
</ApplicationPackage>
App Store Submission Requirements¶
Requirement |
Status |
Notes |
|---|---|---|
|
Needed |
Create |
|
Needed |
Defines load behavior and compatibility |
VLX compiled for target AutoCAD versions |
Needed |
R15.0 (2000) minimum; test up through current |
Autodesk Publisher account |
Needed |
Sign up at apps.autodesk.com/publisher |
App icon and screenshots |
Needed |
Marketing assets for store listing |
Testing on supported AutoCAD versions |
Needed |
Autodesk reviews submissions |
Code signing (recommended) |
Optional |
Authenticode for |
Note
AutoCAD 2000 limitation: The App Store and .bundle format were introduced in AutoCAD 2013 (R19.0). For older AutoCAD versions (2000–2012), distribution must use traditional installers (MSI/WiX) or manual deployment. The .bundle format provides automatic loading — AutoCAD scans a known folder (%PROGRAMDATA%\Autodesk\ApplicationPlugins\) for .bundle packages at startup.
Compatibility Strategy¶
For maximum market reach:
AutoCAD 2000–2012 (legacy): Distribute via WiX MSI installer + manual Startup Suite configuration
AutoCAD 2013+ (modern): Distribute via
.bundleformat + optional App Store listingBoth: The same
CSV.VLXworks in all versions — only the packaging/delivery method differs
Warning
VLX compiled in AutoCAD 2000 may need recompilation for newer AutoCAD versions if using version-specific features. Test on each target platform. The Visual LISP bytecode format has remained largely stable, but namespace handling changed in R18+.
Quick Reference: Alpha vs. Beta vs. Production¶
Aspect |
Alpha (Source) |
Beta (VLX) |
Production (VLX + Installer) |
|---|---|---|---|
Editing tool |
VS Code + AutoLISP Ext |
N/A (frozen) |
N/A (frozen) |
Files deployed |
All |
|
|
Deployment method |
Git pull (nightly) |
Manual VLX copy |
WiX MSI or App Store |
Editable on VM |
Yes (but edit in VS Code) |
No |
No |
IP Protected |
No — full source visible |
Yes (encrypted bytecode) |
Yes (encrypted bytecode) |
Load speed |
Slower (interprets each file) |
Faster (pre-compiled) |
Faster (pre-compiled) |
Debugging |
Full — can |
Limited |
None |
File count on VM |
~170 files |
~5 files |
~5 files + installer |
Used by |
Developer, internal alpha (Tai, Dat) |
External beta testers |
Customers, App Store |
Source location |
|
Compiled from TB11 |
Compiled from TB11 |
Compilation needed |
No |
Yes (VLIDE) |
Yes (VLIDE) |