Understanding AutoLISP and Visual LISP

Developed principally for use in Artificial Intelligence (AI) applications, LISP is still popular in the AI community. AutoLISP was first introduced into AutoCAD as its principle programming language with Release 2.18 in January 1986. It was chosen as the initial AutoCAD programming language for two important reasons: LISP structurally relies upon lists to contain its data types and most of CAD relies upon lists of coordinates or data that can be easily expressed in list form. Just as important, LISP, and AutoLISP by extension, is uniquely suited for the relatively unstructured design environment of CAD projects, which typically involve repeatedly applying different solutions to the design process.

In the years since 1986, AutoLISP has become widely popular and well accepted as an easy-to-learn, easy-to-use customization language for use in AutoCAD. More than 1.25 million AutoCAD customers currently use AutoLISP either directly or through third-party applications integrated with AutoCAD. However, despite its popularity and adoption by the communities of AutoCAD users and developers, AutoLISP began to show some serious limitations as AutoCAD, and the machines on which it is run, improved in functionality and speed.

Beginning with AutoCAD Release 14, a new implementation of “AutoLISP,” termed Visual LISP, was introduced. Visual LISP can be best described as a complete development environment for creating applications and customizing AutoCAD using the LISP programming language. Visual LISP is also an extension and an enhancement to the “old” AutoLISP found in Release 14 and before. Visual LISP provides greater functionality, improved productivity and performance, increased security, and a new Integrated Development Environment (IDE). It is important to realize that if you are already familiar with AutoLISP, the transition to Visual LISP is virtually seamless. Although there are new functions in Visual LISP, the “old” AutoLISP has been essentially retained, and your investment in learning AutoLISP can be easily transported into Visual LISP.

Much of the increased functionality and improved productivity of Visual LISP is centered upon the fact that it is an Object ARX application, and it has a completely new LISP interpreter. It greatly expands AutoCAD’s ActiveX support by including additional ActiveX objects and events. Although much of the advanced aspects of Visual LISP are outside the scope of this chapter, Visual LISP does also include several new elements that aid in the writing and debugging of AutoLISP/Visual LISP code and that serve all AutoLISP users—both novice and expert.

Note

The term “AutoLISP” should be taken to mean the AutoLISP programming language. “Visual LISP” is a development environment, within which programs written in AutoLISP (the language) are developed, debugged, and optionally compiled into Object ARX applications.“Visual LISP” provides its own AutoLISP evaluator that, in effect, replaces the pre-AutoCAD 2000 AutoLISP evaluator. In this chapter, as with the AutoCAD community in general, the term “AutoLISP” is still valid and refers to the programming language used by Visual LISP.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.57.172