Wiley AutoCAD and AutoCAD LT All-in-One Desk Reference For Dummies 978-0-471-75260-8 User Manual

Product codes
978-0-471-75260-8
Page of 10
Getting to Know the Available Programming Interfaces
656
was based on the LISP programming language. The introduction of AutoLISP
allowed users of AutoCAD to tailor the program for how they wanted to work
to improve productivity.
After AutoLISP came the introduction of ADS (AutoCAD Development
System), which introduced C-style coding as a programming option. ADS had
a rather short life span because the C language was already being overshad-
owed by the next generation of the C programming language, C++. ADS,
which was only around for about three years, evolved into ObjectARX, which
is still the premier programming option in AutoCAD 2007. If you look at the
install directory of AutoCAD, you can see that this is the tool of choice by
Autodesk itself to extend the core functionality of AutoCAD.
In 1997, Autodesk extended the programming interfaces it was offering to
include ActiveX, which allowed VB programmers to extend the core func-
tionality of AutoCAD. ActiveX is not just for VB programmers; many other
mainstream languages such as Java and C++ support ActiveX so they can
interface with AutoCAD. Autodesk didn’t stop with ActiveX support. It kept
up with the ever-changing landscape of technology and introduced a pro-
gramming interface for .NET that could be used with the new .NET languages
by Microsoft and other development language vendors.
AutoLISP
AutoLISP is a programming language based on the LISP language. LISP stands
for lisprocessing. It was first introduced back in 1958 and was popular
during the ’70s and ’80s. Programmers often joke that the LISP acronym
really stands for Lost IStupid Parentheses. Take one look at the code, and
you might agree. LISP uses start and end parentheses for a statement, as the
following example shows:
(command “line” “0,0” “5,5” “”)
In the example, you can see the use of the parentheses to start and end the
expression. The example uses the LINE command to draw a line starting at
the coordinate 0,0 and ending at 5,5. As you can see, it’s not much different
from what you are use to typing in at the command line. Although not a very
powerful statement, it is rather easy to understand.
AutoLISP can be used to organize multiple statements into a custom com-
mand that a user can enter at the command line or use in a command macro
for a toolbar button. To create a new command or a function that can be
used to extend the built-in AutoLISP functions, use the function DEFUN —
DEfine FUNction.
52_752606 bk10ch01.qxp  6/28/06  8:57 PM  Page 656