AutoLISP

From Wikipedia, the free encyclopedia

AutoLISP is a dialect of Lisp programming language built specifically for use with the full version of AutoCAD and its derivatives like Autodesk Map 3D and Autodesk Architectural Desktop. Neither the application programming interface nor the interpreter to execute AutoLISP code are included in the AutoCAD LT product line, unless you buy add ons like "LT-Extender".

AutoLisp is a small, dynamically scoped Lisp. It lacks modern Lisp features such as a macro system or let bindings. Aside from the core language, most of the primitive functions are for geometry or the manipulation of graphical entities in AutoCAD. The properties of these graphical entities are revealed to AutoLISP as association lists in which AutoCAD "group codes" are paired with values that indicate properties such as points, radii, colors, layers, linetypes, etc.

AutoLisp code can interact with the user through primitive functions that allow the user to input points, selection sets, numbers and other data. AutoLisp also has a built in GUI mini-language, the Dialog Control Language, for creating small interactive forms within AutoCAD.

; example of macro without command-line interface exposed

(defun hello_world ()
  (alert "Hello World!"))


; example of macro with command-line interface exposed

(defun c:hello_world ()
  (alert "Hello World!")
  (princ))

; example of LISP's flexible condition handling

(cond
  ((= a b) (princ "\n(a) and (b) are equal"))
  ((and (= (type a) 'INT) (= (type b) 'INT)) 
    (princ (strcat "\n(a)+(b)=" (itoa (+ a b)))))
  ((and (= (type a) 'STR) (= (type b) 'STR))
    (princ (strcat "\n(a)+(b)=" a b)))
  ((and (listp a) (= (type b) 'SUBR))
    (mapcar '(lambda (x) (princ (b x))) a)))
  

AutoLisp was derived from a very early version of XLISP, which was created by David Betz. The language was added to AutoCAD in Version 2.18 in January 1986, and continued to be enhanced in successive releases up to Release 12 in June 1992. After that, its development was neglected by Autodesk in favor of more fashionable development environments. However, it has remained AutoCAD's primary user customization language.

Vital-LISP, a considerably enhanced version of AutoLISP including an IDE, debugger, and compiler, was developed and sold by third party developer Basis Software. Vital LISP was a superset of the existing AutoLISP language that added VBA-like access to the AutoCAD object model, reactors (event handling for AutoCAD objects), general ActiveX support, and some other general Lisp functions. Autodesk purchased this, renamed it Visual LISP, and briefly sold it as an add-on. It was incorporated into AutoCAD as a replacement for AutoLISP in AutoCAD 2000, released in March 1999. Since then Autodesk has chosen to halt major enhancements to Visual LISP in favor of focusing more effort on VBA and ObjectARX.

AutoLisp had such a strong following that other CAD application vendors added it to their own products. FelixCAD, BricsCad, IntelliCAD and others have AutoLISP functionality, so that AutoLisp users can consider using them as an alternative to AutoCAD. Most development involving AutoLISP since AutoCAD 2000 is actually performed within Visual LISP since the original AutoLISP engine was replaced with the Visual LISP engine. There are thousands of utilities and hundreds of applications that have been developed using AutoLISP or Visual LISP still in existence.


AutoCAD related articles
AutoCAD | AutoCAD DXF | AutoLISP | DWG
Advanced Search
Included Web Search Engines


Safe Search

close

Top Matching Results

Occasionally Search.com will highlight specialized results that are based on the context of your query. Examples of specialized results include specific links to news, images, or video.

Top Matching Results may highlight information from other Search.com pages, content from the CNET Network of sites, or third party content. The listings are based purely on relevance. Search.com does not receive payment for listings in this section but our partners that provide this data may get paid for listing these products.

Sponsored Links

This section contains paid listings which have been purchased by companies that want to have their sites appear for specific search terms and related content. These listings are administered, sorted and maintained by a third party and are not endorsed by Search.com.

Search Results

Search.com sends your search query to several search engines at one time and integrates the results into one list which has been sorted by relevance using Search.com's proprietary algorithm. You can customize the list of search engines included in your metasearch from the preferences.

The search engines that are used in your metasearch may allow companies to pay to have their Web sites included within the results. To view the Paid Inclusion policy for a specific search engine, please visit their Web site. Search.com does not accept payment or share revenue with any search engine partner for listings in this section.