Learn the basics of AutoCAD and More!

Lesson 5.15 – Packaging and Sharing AutoLISP Routines

πŸ“¦ Lesson 5.15 – Packaging and Sharing AutoLISP Routines

Learn how to compile your LISP routines into distributable files and manage them effectively across a team.


πŸ“š What You’ll Learn

By the end of this lesson, you’ll be able to:

  • Compile your AutoLISP code into secure, distributable .FAS files
  • Understand the pros and cons of .LSP, .FAS, and .VLX formats
  • Share and manage your code with coworkers using best practices
  • Set up a centralized folder system for team access

🧠 Why It Matters

When you’re distributing AutoLISP tools to coworkers or clients, you want to protect your code, ensure consistency, and avoid accidental edits. Compiled files and proper version control help maintain a stable and professional environment.

πŸ› οΈ Tools You’ll Use

Tool / FilePurpose
AutoCAD VLIDEThe Visual LISP Editor used to write and compile code
.FAS fileA compiled and secure version of .LSP code
APPLOADCommand to load AutoLISP files manually
acad.lsp, startup.lspLoad shared tools automatically
Shared foldersHost tools for version control and teamwork

🧭 Lesson Structure

1️⃣ Why Compile Code?

FormatEditable?Secured?When to Use
.lspYesNoDuring development and testing
.fasNoYesWhen distributing to users
.vlxNoYesWhen bundling multiple routines

βœ… Use .fas to hide source code and improve load performance.

2️⃣ How to Compile a .LSP into .FAS

  1. Open your .lsp file in AutoCAD’s Visual LISP Editor (VLIDE)
  2. Go to: Tools β†’ Make Application...
  3. Choose .FAS or .VLX
  4. Save the compiled file in your shared tools directory
  5. Load it using APPLOAD or a startup script
(load "tools/my_tool.fas")

🧠 Compiled files must be recompiled if you edit the original .lsp.

3️⃣ Setting Up a Shared Folder for Teams

Structure your shared LISP directory like this:

/CAD-TOOLS/
β”œβ”€β”€ compiled/
β”‚ β”œβ”€β”€ titleblock.fas
β”‚ β”œβ”€β”€ layer_creator.fas
β”œβ”€β”€ source/
β”‚ β”œβ”€β”€ titleblock.lsp
β”‚ β”œβ”€β”€ layer_creator.lsp
β”œβ”€β”€ loaders/
β”‚ └── startup.lsp
  • Grant read-only access to compiled folder
  • Keep .lsp files in source for version control (e.g., Git)
  • Centralize startup.lsp to load routines consistently

4️⃣ Maintain Version Control

Include version headers in your .lsp files:

;;; titleblock.lsp
;;; Version: 1.2.3
;;; Date: 2025-05-29
;;; Description: Auto-inserts and fills title block attributes.

Use a changelog or Git commit messages to track changes across the team.

βœ… Lesson Checklist

TaskCompleted
Compiled at least one .lsp file into a .fas☐
Set up a shared folder with proper file permissions☐
Created or updated a central startup.lsp loader☐
Added version headers and documentation to code☐

πŸ“Œ Quick Tips

TipWhy It Helps
Keep a changelog in each fileHelps teams track and audit code changes
Use .fas for non-editable production codeProtects logic from tampering
Backup source and compiled folders separatelyPrevents accidental overwrites
Load from a network path when collaboratingEnsures everyone is using the same version

🧩 Real-World Applications

ScenarioWhat You ShareWhy It Works
CAD team at a firmCompiled tools via startup scriptGuarantees consistent tool access
Training environment.FAS routines without source codePrevents learners from editing core logic
Client distributionBranded .FAS package with installerProtects IP and creates a professional feel

πŸ“ Files and Resources

File / ResourceDescription
titleblock.lspSource file for title block routine
titleblock.fasCompiled version for production
startup_loader.lspLoads compiled tools from shared directory
lisp_distribution_guide.docxPrintable checklist and tips for sharing code

πŸ“– Review Table

TermDescriptionExample
.fasCompiled LISP filetitleblock.fas
VLIDEVisual LISP EditorUse to compile .lsp files
APPLOADCommand to load external applicationsLoad .fas via dialog or command line
startup.lspScript to run at AutoCAD startup(load "compiled/layer_creator.fas")