• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 22. Introduction to AutoLISP Pro... > Creating a Simple AutoLISP Program

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 are the building blocks of all AutoLISP code. If two or more routines are grouped together to accomplish some desirable task, the grouping is commonly referred to as a program. Programs are usually composed of routines. Some routines are rather specialized and are found in specialized programs. Other routines are of a basic, generalized nature and can be used—perhaps slightly modified—in a variety of larger programs. This modular use of routines provides the AutoLISP programmer with a library of routines that can be utilized over and over again, in various program contexts making the building of larger programs easier.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint