AutoCAD

How To Make Lisp In AutoCAD?

Creating a LISP Program in AutoCAD

To develop a LISP program in AutoCAD, start by accessing the Visual LISP Editor (VLISP). Open AutoCAD and navigate to the “Tools” menu. Select “AutoLISP” and then click on “Visual LISP Editor.” This will launch the VLISP interface, where you can execute LISP commands directly within the console window.

To create a new LISP file, go to the “File” menu and select “New.” This opens a text editor where you can compose your LISP program. Utilize this environment to write, modify, and save complete routines that can streamline your AutoCAD tasks.

Executing a LISP Script in AutoCAD

To run your LISP script, follow these steps:

  1. Start by typing the command AppLoad into the AutoCAD command line. Alternatively, you can navigate to Tools and select “Load Application.”

  2. In the dialog box that appears, locate your saved LISP file, select it, and click the “Load” button to incorporate it into your ongoing drawing session.

  3. Once loaded, you can click “Close” to exit the Appload dialog.

Understanding LISP Routines in AutoCAD

LISP routines are specialized programs created to automate tasks within AutoCAD that are not part of the standard command set. By using these routines, users can enhance productivity by simplifying repetitive tasks. Most manual commands can be automated with LISP to create a more efficient workflow, making them valuable tools for users at all levels.

Starting a LISP Routine

To initiate a LISP routine, type the command CUI in the AutoCAD command line. This opens the Customize User Interface (CUI) dialog. Find the “LISP Files” section under the “Customization in All Files” category. Right-click on this section and select “Load Lisp” from the context menu. Navigate to the location of your LISP file, select it, and it will be added to your list of available routines.

Loading a LISP in AutoCAD 2025

Follow these steps to load a LISP file in AutoCAD 2025:

  1. Execute the command APPLOAD.

  2. Click the “Contents” button under Startup Suite.

  3. Press the “Add” button.

  4. Browse to locate your LISP file, select it, and click the “Open” button.

  5. Once you’ve added all desired LISP routines, click “Close” to exit the dialog.

AutoCAD LT and LISP Support

AutoCAD LT does not support the AutoLISP programming language, which means users cannot run LISP routines or use the APPLOAD command with this version of the software. For those needing LISP capabilities, upgrading to a full version of AutoCAD is necessary.

Creating a LISP File

To create your own LISP file, follow these steps:

  1. Use a text editor, such as Notepad++, and create a new text document.

  2. Save this document with a .lsp file extension. For example, you may write basic alert code such as (alert "This is my first alert message." "DraftSight alert" "INFORMATION").

  3. Save the file with a recognizable name, like ‘startup.lsp’.

Automatically Loading a LISP in AutoCAD

To set up AutoCAD to automatically load a LISP file upon startup, follow these steps:

  1. Launch the CUI command.

  2. Select the main customization file, typically named “acad.cuix”.

  3. Find the “LISP Files” section, right-click, and choose “Load LISP” from the context menu.

  4. Browse to and select the LISP file you wish to add.

  5. Click “Apply” and then “Close” to exit the CUI editor.

Understanding Acaddoc.lsp

The acaddoc.lsp file is designed for loading AutoLISP routines automatically each time a new drawing is created or an existing drawing is opened. This feature can be particularly useful for ensuring specific routines are always available for use.

Locating Acad.lsp

The acad.lsp or acaddoc.lsp files need to be saved in a directory included in your AutoCAD support file search paths. To determine these paths, go to Options and navigate to the Files tab, where you can find the “Support File Search Path” settings.

How AutoCAD is Coded

The original version of AutoCAD was primarily coded in C, with some elements in assembly language. Over time, it has expanded to include C++ and offers extensive integration with various programming interfaces such as AutoLISP, Visual LISP, VBA, .NET, and JavaScript.

What Does LISP Stand For?

LISP stands for “LISt Processing,” reflecting its capabilities for handling and manipulating lists and symbols.

Continued Use of LISP

LISP is still in use, especially within niches of programming and development. While it may not be mainstream, several startups and smaller companies in Europe have successfully utilized LISP over the past two decades.

FAQ

1. Can I edit a LISP file after creating it?
Yes, you can open and modify your LISP file with any text editor that supports plain text formats.

2. Are there sample LISP routines available for download?
Yes, many resources online provide free LISP routines that can be downloaded and tested within AutoCAD.

3. Is there a limit to what LISP can automate in AutoCAD?
While LISP can automate many tasks, some complex operations may require other programming languages or APIs for full functionality.

About the author

Wei Zhang

Wei Zhang

Wei Zhang is a renowned figure in the CAD (Computer-Aided Design) industry in Canada, with over 30 years of experience spanning his native China and Canada. As the founder of a CAD training center, Wei has been instrumental in shaping the skills of hundreds of technicians and engineers in technical drawing and CAD software applications. He is a certified developer with Autodesk, demonstrating his deep expertise and commitment to staying at the forefront of CAD technology. Wei’s passion for education and technology has not only made him a respected educator but also a key player in advancing CAD methodologies in various engineering sectors. His contributions have significantly impacted the way CAD is taught and applied in the professional world, bridging the gap between traditional drafting techniques and modern digital solutions.