AutoLISP is based on the LISP programming language, which is simple to learn and very powerful for automating design tasks. Because AutoCAD has a built-in LISP interpreter, you can enter AutoLISP code at the Command prompt or load AutoLISP code from external files.
When an AutoLISP application is loaded, it functions in its own namespace for each drawing that is open. A namespace is an insulated environment keeping AutoLISP applications 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 when executed in each open drawing.
(setq a (getvar "DWGNAME"))
AutoLISP applications can prompt the user for input, access built-in AutoCAD commands directly, and modify or create objects directly in the drawing database. By creating AutoLISP routines you can add discipline-specific or workflow driven commands to AutoCAD. Some of the standard AutoCAD commands are actually AutoLISP applications.
You may choose to experiment by entering code at the Command prompt, which allows you to see the results immediately. This makes AutoLISP an easy language to experiment with, regardless of your programming experience.
AutoLISP provides three file formats for applications: