Family | Lisp |
---|---|
Designed by | David Betz |
Developers | Autodesk, Basis Software |
First appeared | January 1986 |
Stable release | 13 / February 1995 |
Typing discipline | dynamic |
Scope | dynamic |
Platform | IA-32 |
OS | Linux |
Dialects | |
Vital-LISP, Visual LISP | |
Influenced by | |
Lisp, XLISP |
AutoLISP is a dialect of the programming language Lisp built specifically for use with the full version of AutoCAD and its derivatives, which include AutoCAD Civil 3D , AutoCAD Map 3D , AutoCAD Architecture and AutoCAD Mechanical . [1] Neither the application programming interface (API) nor the interpreter to execute AutoLISP code is included in the AutoCAD LT product line (up to Release 2023, AutoCAD LT 2024 includes AutoLISP). [2] A subset of AutoLISP functions is included in the browser-based AutoCAD web app.
AutoLISP is a small, dynamically scoped, dynamically typed Lisp language dialect with garbage collection, immutable list structure, and settable symbols, lacking in such regular Lisp features as macro system, records definition facilities, arrays, functions with variable number of arguments or let bindings. Aside from the core language, most of the primitive functions are for geometry, accessing AutoCAD's internal DWG database, or manipulation of graphical entities in AutoCAD. The properties of these graphical entities are revealed to AutoLISP as association lists in which values are paired with AutoCAD group codes that indicate properties such as definitional points, radii, colors, layers, linetypes, etc. AutoCAD loads AutoLISP code from .LSP files. [3]
AutoLISP code can interact with the user through AutoCAD's graphical editor by use of primitive functions that allow the user to pick points, choose objects on screen, and input numbers and other data. AutoLisp also has a built-in graphical user interface (GUI) mini- or domain-specific language (DSL), the Dialog Control Language, for creating modal dialog boxes with automated layout, within AutoCAD. [3]
AutoLISP was derived from an early version of XLISP, which was created by David Betz. [4] The language was introduced in AutoCAD Version 2.18 in January 1986, and continued to be enhanced in successive releases up to release 13 in February 1995. After that, its development was neglected by Autodesk in favor of more fashionable development environments like Visual Basic for Applications (VBA), .NET Framework, and ObjectARX. However, it has remained AutoCAD's main user customizing language.
Vital-LISP, a considerably enhanced version of AutoLISP including an integrated development environment (IDE), debugger, compiler, and ActiveX support, was developed and sold by third-party developer Basis Software. Vital LISP was a superset of the existing AutoLISP language that added VBA-like access to the AutoCAD object model, reactors (event handling for AutoCAD objects), general ActiveX support, and some other general Lisp functions. Autodesk purchased this, renamed it Visual LISP, and briefly sold it as an add-on to AutoCAD release 14 released in May 1997. It was incorporated into AutoCAD 2000 released in March 1999, as a replacement for AutoLISP. Since then, Autodesk has ceased major enhancements to Visual LISP and focused more effort on VBA and .NET, and C++. As of January 31,2014 [update] , Autodesk ended support for VBA versions before 7.1, as part of a long-term process of changing from VBA to .NET for user customizing. [5] [6]
AutoLISP has such a strong following that other computer-aided design (CAD) application vendors add it to their products. Bricscad, IntelliCAD, DraftSight and others have AutoLISP functionality, so that AutoLISP users can consider using them as an alternative to AutoCAD. Most development involving AutoLISP since AutoCAD 2000 is performed within Visual LISP since the original AutoLISP engine was replaced with the Visual LISP engine. There are thousands of utilities and applications that have been developed using AutoLISP or Visual LISP (distributed as LSP, FAS and VLX files). [7] [8]
1958 | 1960 | 1965 | 1970 | 1975 | 1980 | 1985 | 1990 | 1995 | 2000 | 2005 | 2010 | 2015 | 2020 | ||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
LISP 1, 1.5, LISP 2(abandoned) | |||||||||||||||
Maclisp | |||||||||||||||
Interlisp | |||||||||||||||
MDL | |||||||||||||||
Lisp Machine Lisp | |||||||||||||||
Scheme | R5RS | R6RS | R7RS small | ||||||||||||
NIL | |||||||||||||||
ZIL (Zork Implementation Language) | |||||||||||||||
Franz Lisp | |||||||||||||||
Common Lisp | ANSI standard | ||||||||||||||
Le Lisp | |||||||||||||||
MIT Scheme | |||||||||||||||
XLISP | |||||||||||||||
T | |||||||||||||||
Chez Scheme | |||||||||||||||
Emacs Lisp | |||||||||||||||
AutoLISP | |||||||||||||||
PicoLisp | |||||||||||||||
Gambit | |||||||||||||||
EuLisp | |||||||||||||||
ISLISP | |||||||||||||||
OpenLisp | |||||||||||||||
PLT Scheme | Racket | ||||||||||||||
newLISP | |||||||||||||||
GNU Guile | |||||||||||||||
Visual LISP | |||||||||||||||
Clojure | |||||||||||||||
Arc | |||||||||||||||
LFE | |||||||||||||||
Hy | |||||||||||||||
Chialisp |
A simple Hello world program in AutoLISP would be:
(defunhello()(princ"\nHello World!")(princ))
Note the final line inside the function definition: when evaluated with no arguments, the princ
function returns a null symbol, which is not displayed by the AutoCAD command-line interface. As the AutoCAD command line functions as a read–eval–print loop (REPL), this would normally print "Hello World!" to the command line, followed immediately by the return value of the call to princ
. Therefore, without the final call to the princ
function, the result of this would be:
Hello World!"\nHello World!"
The prin1
function may also be used to achieve the same result.
A more complex example is:
(defunc:pointlabel(/pnt)(if(setqpnt(getpoint"\nSpecify point: "))(progn(entmake(list'(0."POINT")(cons10(transpnt10))))(entmake(list'(0."TEXT")(cons10(trans(cons(+(carpnt)0.6)(cdrpnt))10))(cons40(getvar'textsize))(cons1(strcat"X:"(rtos(carpnt))" Y:"(rtos(cadrpnt))))))))(princ))
The above code defines a new function which generates an AutoCAD point object at a given point, with a one-line text object displaying the X and Y coordinates beside it. The name of the function includes a special prefix 'c:', which causes AutoCAD to recognize the function as a regular command. The user, upon typing 'pointlabel' at the AutoCAD command line, would be prompted to pick a point, either by typing the X and Y coordinates, or clicking a location in the drawing. The function would then place a marker at that point, and create a one-line text object next to it, containing the X and Y coordinates of the point expressed relative to the active User Coordinate System (UCS). The function requires no parameters, and contains one local variable ('pnt').
The above example could also be written using built-in AutoCAD commands to achieve the same result, however this approach is susceptible to changes to the command prompts between AutoCAD releases.
AutoCAD is a 2D and 3D computer-aided design (CAD) software application developed by Autodesk. It was first released in December 1982 for the CP/M and IBM PC platforms as a desktop app running on microcomputers with internal graphics controllers. Initially a DOS application, subsequent versions were later released for other platforms including Classic Mac OS (1992), Microsoft Windows (1993) and macOS (2010), iOS (2010), and Android (2011).
AutoCAD DXF is a CAD data file format developed by Autodesk for enabling data interoperability between AutoCAD and other programs.
Common Lisp (CL) is a dialect of the Lisp programming language, published in American National Standards Institute (ANSI) standard document ANSI INCITS 226-1994 (S2018). The Common Lisp HyperSpec, a hyperlinked HTML version, has been derived from the ANSI Common Lisp standard.
Lisp is a family of programming languages with a long history and a distinctive, fully parenthesized prefix notation. Originally specified in the late 1950s, it is the second-oldest high-level programming language still in common use, after Fortran. Lisp has changed since its early days, and many dialects have existed over its history. Today, the best-known general-purpose Lisp dialects are Common Lisp, Scheme, Racket, and Clojure.
Microsoft Access is a database management system (DBMS) from Microsoft that combines the relational Access Database Engine (ACE) with a graphical user interface and software-development tools. It is a member of the Microsoft 365 suite of applications, included in the Professional and higher editions or sold separately.
Rebol is a cross-platform data exchange language and a multi-paradigm dynamic programming language designed by Carl Sassenrath for network communications and distributed computing. It introduces the concept of dialecting: small, optimized, domain-specific languages for code and data, which is also the most notable property of the language according to its designer Carl Sassenrath:
Although it can be used for programming, writing functions, and performing processes, its greatest strength is the ability to easily create domain-specific languages or dialects
VBScript is a deprecated programming language for scripting on Microsoft Windows using Component Object Model (COM) based on classic Visual Basic and Active Scripting.
Visual Basic for Applications (VBA) is an implementation of Microsoft's event-driven programming language Visual Basic 6.0 built into most desktop Microsoft Office applications. Although based on pre-.NET Visual Basic, which is no longer supported or updated by Microsoft, the VBA implementation in Office continues to be updated to support new Office features. VBA is used for professional and end-user development due to its perceived ease-of-use, Office's vast installed userbase, and extensive legacy in business.
Genera is a commercial operating system and integrated development environment for Lisp machines created by Symbolics. It is essentially a fork of an earlier operating system originating on the Massachusetts Institute of Technology (MIT) AI Lab's Lisp machines which Symbolics had used in common with Lisp Machines, Inc. (LMI), and Texas Instruments (TI). Genera was also sold by Symbolics as Open Genera, which runs Genera on computers based on a Digital Equipment Corporation (DEC) Alpha processor using Tru64 UNIX. In 2021 a new version was released as Portable Genera which runs on Tru64 UNIX on Alpha, Linux on x86-64 and Arm64 Linux, and macOS on x86-64 and Arm64. It is released and licensed as proprietary software.
In some programming languages, eval
, short for the English evaluate, is a function which evaluates a string as though it were an expression in the language, and returns a result; in others, it executes multiple lines of code as though they had been included instead of the line including the eval
. The input to eval
is not necessarily a string; it may be structured representation of code, such as an abstract syntax tree, or of special type such as code
. The analog for a statement is exec, which executes a string as if it were a statement; in some languages, such as Python, both are present, while in other languages only one of either eval
or exec
is.
FreeBASIC is a free and open source multiplatform compiler and programming language based on BASIC licensed under the GNU GPL for Microsoft Windows, protected-mode MS-DOS, Linux, FreeBSD and Xbox. The Xbox version is no longer maintained.
EAGLE is a scriptable electronic design automation (EDA) application with schematic capture, printed circuit board (PCB) layout, auto-router and computer-aided manufacturing (CAM) features. EAGLE stands for Easily Applicable Graphical Layout Editor and is developed by CadSoft Computer GmbH. The company was acquired by Autodesk Inc. in 2016 who announced to support the product up to 2026 only.
Dialog Control Language (DCL) is a high-level description language and interpreter within AutoCAD for creating simple graphical dialogs. AutoLISP extensions use it to interact with the user in the AutoCAD environment.
Visual Basic (VB) before .NET, sometimes referred to as Classic Visual Basic, is a third-generation programming language, based on BASIC, and an integrated development environment (IDE), from Microsoft for Windows known for supporting rapid application development (RAD) of graphical user interface (GUI) applications, event-driven programming and both consumption and development of components via the Component Object Model (COM) technology.
Autodesk Revit is a building information modelling software for architects, structural engineers, mechanical, electrical, and plumbing (MEP) engineers, design for contractors. The original software was developed by Charles River Software, founded in 1997, renamed Revit Technology Corporation in 2000, and acquired by Autodesk in 2002. The software allows users to design a building and structure and its components in 3D, annotate the model with 2D drafting elements, and access building information from the building model's database. Revit is 4D building information modeling application capable with tools to plan and track various stages in the building's lifecycle, from concept to construction and later maintenance and/or demolition.
PC-LISP is an implementation of the Franz Lisp dialect by Peter Ashwood-Smith.
IntelliCAD is a CAD editor and development platform with an Application Programming Interface API published by the IntelliCAD Technology Consortium ("ITC") through shared development. IntelliCAD emulates the basic interface and functions of AutoCAD, however, it is particularly able to incorporate and interchange freely between a wide variety of file types.
BricsCAD® is a software application for computer-aided design (CAD), developed by Bricsys nv. The company was founded in 2002 by Erik de Keyser, a longtime CAD entrepreneur. In 2011 Bricsys acquired the intellectual property rights from Ledas for constraints-based parametric design tools, permitting the development of applications in the areas of direct modeling and assembly design. Bricsys is headquartered in Ghent, Belgium, and has additional development centers in Nizhny Novgorod and Novosibirsk, Russia; Bucharest, Romania and Singapore. Bricsys is a founding member of the Open Design Alliance, and joined the BuildingSMART International consortium in December 2016.
In computing, a script is a relatively short and simple set of instructions that typically automate an otherwise manual process. The act of writing a script is called scripting. Scripting language or script language describes a programming language that it is used for scripting.
Lisp Flavored Erlang (LFE) is a functional, concurrent, garbage collected, general-purpose programming language and Lisp dialect built on Core Erlang and the Erlang virtual machine (BEAM). LFE builds on Erlang to provide a Lisp syntax for writing distributed, fault-tolerant, soft real-time, non-stop applications. LFE also extends Erlang to support metaprogramming with Lisp macros and an improved developer experience with a feature-rich read–eval–print loop (REPL). LFE is actively supported on all recent releases of Erlang; the oldest version of Erlang supported is R14.