|
The history of AutoLISP is closely tied to the history of AutoCAD, so a quick survey of the development of AutoCAD is given first.
AutoCAD Releases
AutoCAD was first demonstrated for the public in November 1982 at the COMDEX trade show in Las Vegas. The first shipments of AutoCAD came the next month. Here is a list of the major AutoCAD releases including a few selected features for each release to illustrate the growth of AutoCAD. AutoLISP appeared between Release 6 and Release 7.
Types of Programming Languages
During the 50's, 60's, and 70's various computer languages developed for different purposes. These languages can be grouped in several categories including:
LISP was created in the context of AI (Artificial Intelligence) research. In 1956 John McCarthy developed the foundation for LISP during the Dartmouth Summer Research Project on AI.
During the early 60's, the principal dialect of LISP was Lisp1.5. Then many different dialects and implementations for various computers appeared, including BBNLisp, Interlisp, MacLisp, NIL (New Implementation of Lisp), Franz Lisp, Scheme, Flavors, LOOPS (Lisp Object Oriented Programming System), SPICE-Lisp, and PSL (Portable Standard Lisp). The 70's and early 80's even saw the development of specialized computers known as Lisp Machines which were designed specifically to run LISP programs.
In 1981 many LISP programmers got together to identify the common aspects of certain dialects and thus created Common LISP. By 1984 Common Lisp was considered the de facto standard. Golden Common LISP was developed from Common LISP for the IBM PC, and David Betz developed XLISP, which is the dialect of LISP on which AutoLISP is based.
AutoLISP's Roots in LISP
AutoLISP is a direct descendant of the XLISP dialect of the LISP programming language. In fact, AutoLISP can be considered both a subset and a superset of XLISP. It is a subset since it does not include all the functions contained in XLISP. It is a superset since it contains many functions not found in XLISP. These added functions allow AutoLISP to interact with AutoCAD's drawing database and commands. However, in concept, syntax, and programming style, LISP (XLISP in particular) is clearly the progenitor of AutoLISP.
Basic Continuity
AutoLISP has been included in AutoCAD ever since version 2.18 (January, 1986). Although it has grown, it has maintained its continuity over the years. Each time a new release of AutoCAD comes out, you can expect to find a few new AutoLISP functions. Here are some that have appeared in past releases of AutoCAD:
A Few Sample Differences
Despite the basic continuity of AutoLISP, there are some bothersome changes that appear from time to time. Here are some that came along with AutoCAD R13, R14, and AutoCAD 2000.
(1) Ellipses -- In R13 ellipses have a true elliptical shape, whereas in R12 ellipses were made up of polylines having a series of circular arc segments. The new ellipses are stored in the drawing database differently than the old ones, and any AutoLISP programs which manipulated ellipses had to be revised for R13.
(2) Solid Models -- In R13 all the solid modeling commands and entities changed from the previous AME (Advanced Modeling Extension) to the new ACIS modeler. All AutoLISP programs written for the previous set of solid modeling commands and entities were instantly outmoded.
(3) Lightweight Polylines -- In R14 the PLINE command creates an entity called an LWPOLYLINE rather than a standard POLYLINE. (The "LW" stands for light-weight.) The standard POLYLINE entity still exists and is created by the 3DPOLY command or by splining or fitting an LWPOLYLINE. This new LWPOLYLINE is stored more efficiently in memory than the regular polyline. (All vertices are stored in one top-level entry, rather than each vertex being stored in a separate sub-entity.) AutoLISP programs which were written for AutoCAD R13 and earlier, and which extract database information on polylines or attempt to modify polylines, have to be reprogrammed so that they detect this new type of entity and work with its new method of storage.
(4) ADS -- In R14 ADS is obsolete. The AutoCAD Development System (ADS) was the C-language extension of AutoLISP. External programs were written in C, compiled for a given operating platform, then called as part of an AutoLISP program. ADS is replaced by ARX (AutoCAD Runtime Extension).
(5) AutoLISP Interpreter -- In AutoCAD 2000 the AutoLISP interpreter is new, which results in a number of significant changes, especially for advanced programming. (As just one example, in earlier versions of AutoLISP, functions were stored internally as lists. Advanced programs which read or manipulate program code elements, as opposed to merely reading and manipulating data, need to use one of several new function-defining functions to continue this practice in AutoCAD 2000.) Also, Visual LispTM in AutoCAD 2000 has a number of significant differences from the Visual Lisp that was available for use in Release 14. There are a number of concerns for the beginning and intermediate programmer as well, a few of which are cited in the following items.
(6) New Default Settings for Osnap -- In contrast to earlier releases of AutoCAD, which set all osnap modes "off" by default, AutoCAD 2000 sets certain osnap modes "on" by default. A good program should always save the user's current settings, set osnaps as needed throughout the program, then restore the user's settings when the program is finished, even in earlier versions of AutoCAD. However, those programs which "got by" without doing this may produce bogus graphic results or may even crash when run in AutoCAD 2000.
(7) Printed Messages Delayed -- In versions of AutoCAD before 2000, the output from the various print functions was displayed in the command prompt area immediately. However, in AutoCAD 2000 the messages are held in a buffer until a return character is encountered, such as "\n" or "\r". Depending on how a message or prompt has been programmed, this can create the following situation: an AutoLISP program is actually waiting for input but the message or prompt has not yet been displayed and AutoCAD is still displaying its command prompt. This would be confusing to any AutoCAD user, and requires reprogramming.
(8) Upper and Lower Case -- In AutoCAD 2000 symbol table names (such as layer names, text style names, block names, etc.) are no longer just upper case. If an application makes comparisons of such names, and assumes that they will all be upper case, the application will need to be revised.
(9) Revised Error Messages -- The wording of many
error messages is different in AutoCAD 2000. Any user defined error routines
which make use of the error string passed to it will have to be revised
to accommodate these new wordings.
(10) Better Associative Dimensions
-- Associative dimensions are now more firmly associated with part geometry,
and a new system variable, DIMASSOC, replaces the old DIMASO. Programs
which used to set DIMASO to 1, to make sure that associative dimensioning
was turned on, should now set DIMASSOC to 2.