Using AutoLISP Functions

AutoCAD Map 3D AutoLISP

Up a level
Using AutoLISP Functions
 
 

To write AutoLISP programs, use the Visual LISP IDE. You do not need a compiler, because AutoCAD Map includes an interpreter that processes AutoLISP source code directly.

Optional Parameters

If an AutoLISP function has optional parameters, they are enclosed in square brackets in the function prototype. If a parameter is optional, you can omit its argument if no arguments follow.

A-lists

The term a-list used in AutoLISP function descriptions denotes an association list, also called a dotted pair. It looks like this:

(property . value)

For example, in the expression

(ade_altpdefine "textobject" 
    '( ("color" . "yellow")  
       ("textvalue" . ".Layer") ) ) 

the sub-expression ("color" . "yellow") is an a-list, and so is ("textvalue" . ".Layer").

Invoking Data Extension Commands

You can invoke almost any Data Extension command using the AutoLISP expression, (command "_.ADE[XX]" ...). The exceptions are ADEDEFCRDSYS, ADEZEXTENTS, ADEEDITDATA, and ADEATTACHDATA. You cannot invoke these commands from within ADSRX or Visual LISP. For the ADEKEYVIEW command, only the Redisplay option is supported when ADSRX or Visual LISP is active.

Incomplete Execution of Functions

If an AutoLISP function that performs a sequence of tasks fails partway through its execution and returns an error code, the tasks it completed correctly are undone. For example, ade_qrysetcond modifies a query condition. If you call this function and it is not able to modify every component of the condition, the components it did modify are returned to their original states.