Creating a Simple AutoLISP Program

Now that you have seen how to use AutoLISP in the relatively simple context of a keyboard macro, it is time to progress to a more complex example. AutoLISP routines lie a step above macros in complexity—and flexibility. Generally speaking, AutoLISP routines are distinguished by the fact that they will accept input from the user (or other routines) and are capable of branching in more than one direction based on the input they receive. AutoLISP routines, in other words, exhibit “intelligence”—or at least the ability to make simple decisions.

Functions, Routines, and Programs

Routines are composed of one or more AutoLISP functions—such as the Command function used in writing the 3DUTIL.LSP macros. AutoLISP functions ...

Get Inside AutoCAD® 2002 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.