What is AutoLISP®?
AutoLISP® is a variant of the LISP family of programming languages. It was designed for programming within AutoCAD®, a computer-aided drafting and design (CADD) program developed by Autodesk® Inc. AutoLISP® can be used to create scripts for use in AutoCAD® and any vertical applications that run using the AutoCAD® environment, including AutoCAD® Civil 3D®, AutoCAD® Map 3D, and AutoCAD® Architecture. It is worth noting the inability of AutoCAD LT® to run LISP routines, which is one of the key features that differentiate it from AutoCAD®.
LISP is one of the oldest programming languages known, dating to 1958; the term “LISP” derives from the words “list processor.” XLISP was one variant of LISP and was the basis of the development for AutoLISP®, which made its first appearance in 1986 within AutoCAD® Release 2.18. It was continually modified and enhanced through AutoCAD® Release 13;; when AutoCAD® 2000 was released in 1999, AutoLISP® was replaced with the more powerful Visual LISP®. In the following years, however, Autodesk® halted nearly all development of Visual LISP®, preferring to focus on other programming tools such as ObjectARX®, .NET, and Visual® Basic (VBA). Despite this shift, AutoLISP® remains the most popular way users in 2011 choose to customize or add functionality to AutoCAD®.
Routines created using AutoLISP® typically automate tasks or produce add-on programs for use within AutoCAD®. The programming language is very flexible and can be used to modify nearly any aspect of the AutoCAD® environment or a drawing file. Examples of things that can be produced using AutoLISP® are calculators, programs that edit blocks, and routines that automatically draw content into a file. It is even possible to run a sequence of commands in batch over many files.
AutoLISP® can be programmed from the AutoCAD® command line, but this is rarely done. For all but the most basic of LISP programs, the use of an external text editor is preferred, because it greatly assists in the entry of complicated code. There are literally thousands of ways in which AutoLISP® can be used to input commands or otherwise control AutoCAD®. Usually, the files produced are plain text files saved with an extension of LSP. In case one LISP routine is engineered to contain several programs, the file type can be VLX or FAS.
The LSP files can be loaded within AutoCAD® using the Load command. Once a LISP routine has been loaded, all the user needs to do to execute it is simply type its name on the command line. It also is possible to automatically run one or more LISP routines every time AutoCAD® is launched.
Discuss this Article
Post your comments