2013

Table Of Contents
Introduction to Program-
ming Interfaces
AutoLISP
AutoLISP is based on the LISP programming language, which is simple to learn
and very powerful. Because AutoCAD has a built-in LISP interpreter, you can
enter AutoLISP code at the command prompt or load AutoLISP code from
external files.
Overview of AutoLISP
AutoLISP is an application interface in AutoCAD that automating of design
tasks. When an AutoLISP application or routine is loaded, it functions in its
own namespace for each drawing that is open. A namespace is an insulated
environment keeping AutoLISP routines that are specific to one drawing from
having symbol or variable name and value conflicts with those in another
drawing. For example, the following line of code sets a different value to the
symbol a for different documents.
(setq a (getvar "DWGNAME"))
AutoLISP applications or routines can interact with AutoCAD in many ways.
These routines can prompt the user for input, access built-in AutoCAD
commands directly, and modify or create objects in the drawing database. By
creating AutoLISP routines you can add discipline-specific commands to
AutoCAD. Some of the standard AutoCAD commands are actually AutoLISP
applications.
7
79