2012

Table Of Contents
Introduction to Pro-
gramming Interfaces
AutoLISP
AutoLISP is based on the LISP programming language, which is simple to learn
and very powerful. Because AutoCAD for Mac 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 for Mac 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 for Mac in many
ways. These routines can prompt the user for input, access built-in AutoCAD
for Mac commands directly, and modify or create objects in the drawing
database. By creating AutoLISP routines you can add discipline-specific
commands to AutoCAD for Mac. Some of the standard AutoCAD for Mac
commands are actually AutoLISP applications.
7
77