Catalog of Functions
Catalog of Functions
in 21 Categories
This catalog is one gateway to the function definitions. The other gateway is "Alphabetic list of functions."
The function definitions are organized in 21 groups, and similar functions are listed together within those groups. This
arrangement helps you find the function needed to accomplish a certain task.
Below is a list of the 21 categories. A more complete list, with all the functions included in each category, is found
further down this page.
1 Mathematics
+ --------- Add
- --------- Subtract
* --------- Multiply
/ --------- Divide
rem ------- Remainder of integer division
1+ -------- Increment by one
1- -------- Decrement by one
abs ------- Absolute
fix ------- Truncates a real to an integer
float ----- Converts an integer to a real
gcd ------- Greatest common denominator
min ------- Smallest (least) of group
max ------- Largest (greatest) of group
sqrt ------ Square root
expt ------ Exponent
exp ------- Power of e
log ------- Natural log
cvunit ---- Converts a value from one unit to another
3 Setting variables
setq ------ Assigns a value to a variable (variable automatically quoted)
set ------- Assigns a value to a variable (must quote the variable)
also see setvar under "14 - Working with AutoCAD"
4 User input
initget --- Controls input allowed in next user input function
getint ---- Allows user to enter an integer
getreal --- Allows user to enter a real
getpoint -- Allows user to pick a point (rubber-band is a line)
osnap ----- Returns a point snapped to some feature of existing geometry
getcorner - Allows user to pick a point (rubber-band is a rectangle)
getdist --- Allows user to pick a distance
getangle -- Allows user to pick an angle
getorient - Allows user to pick a Cartesian angle
getstring - Allows user to enter a string
getkword -- Allows user to enter selected key word options
5 Conditionals
if -------- Checks single condition, uses then-expression and else-expression
cond ------ Checks multiple conditions, uses then-expression only
8 Iteration (repetition)
repeat ---- Repeats a program section a certain number of times
while ----- Repeats a program section only while a condition is true
foreach --- Repeats a program section for each member of a list
9 List manipulation
car ------- Returns first member of a list (X coord. of a point)
cadr ------ Returns second member of a list (Y coord. of a point)
caddr ----- Returns third member of a list (Z coord. of a point)
cdr ------- Returns a list containing all members but the first
nth ------- Returns the nth member of a list
last ------ Returns last member of a list
reverse --- Returns a list in reverse order
list ------ Creates a list
cons ------ Adds an element to the beginning of a list
append ---- Appends contents of several lists into one list
length ---- Returns number of top level elements in a list
member ---- Finds a top-level element in a list
assoc ----- Finds sub-lists in an association list
subst ----- Puts a new element in place of an existing element in a list
acad_strlsort Sorts strings in a list
10 Text strings
ascii ----- Returns a character's ASCII code
chr ------- Returns the character represented by an ASCII code
strlen ---- Number of charracters in a string
strcat ---- Concatenates strings
substr ---- Substring
strcase --- Converts to upper or lower case
wcmatch --- Finds string matches using wild-cards
also see acad_strlsort under "9 - List manipulation"
11 Printing to screen
prin1 ----- Prints text to the command line or to a file
princ ----- Prints text to the command line or to a file
print ----- Prints text to the command line or to a file
prompt ---- Prints a string to the command line
terpri ---- Terminates a line of print, returns cursor to beginning of next line
13 Function related
defun ----- Defines a function (stores expressions in memory)
load ------ Loads a file into memory for execution
autoload -- Automatically loads a file when a command from that file is entered
progn ----- Groups several expressions to be evaluated as one
exit ------ Quits the current function, returns to Command prompt
quit ------ Quits the current function, returns to Command prompt
apply ----- Applies a function to the elements of a list
mapcar ---- Applies a function in sequence to the members of multiple lists
lambda ---- Defines a temporary function
15 Files
open ------ Opens a buffer in memory for file data
close ----- Flushes a file's buffer to disk
read-line - Returns a line (string) read from a file (or keyboard)
write-line - Writes a line (string) to a file (or screen)
read-char - Returns ASCII code for a character read from file (or keyboard)
write-char - Writes a character to a file (or screen)
findfile -- Returns path to a given file
getfiled -- Displays a standard file dialog box
16 Entity access
entlast --- Returns name of last entity added to the drawing
entnext --- Returns name of next entity in the drawing
entsel ---- Allows user to select a single entity
nentsel --- Allows user to select a simple entity within a complex entity
nentselp -- Selects a simple entity within a complex entity without user input
entget ---- Retrieves an entities defining data in the form of an association list
entmod ---- Modifies an existing entity
entupd ---- Updates the appearance of a modified entity
entdel ---- Deletes an entity
entmake --- Creates a new entity
handent --- Uses an entity's handle to retrieve its name
textbox --- Returns diagonal corners of a box surrounding a text entity
17 Symbol tables
These are tables of named objects such as layers, blocks, and text styles
18 Selection sets
Selection sets are somewhat like lists, but they cannot be manipulated with the same functions used to
manipulate lists.
19 Bitwise
logior ---- Bitwise OR
logand ---- Bitwise AND
~ --------- Bitwise not, 1's complement
lsh ------- Bitwise left shift
boole ----- General bitwise boolean function
20 Debugging
trace ----- Turns tracing on for a specified function
untrace --- Turns tracing off for a specified function
also see *error* under "21 - Miscellaneous"
21 Miscellaneous
*error* --- Allows redefinition of the built-in error routine
ver ------- Displays current version of AutoLISP
startapp -- Starts a Windows application
alert ----- Displays a message in a simple dialog box
help ------ Displays a help file
setfunhelp - Associates a help file name with a function
atoms-family Returns all currently defined symbols
quote ----- Returns expression unevaluated
eval ------ Evaluates an expression
read ------ Converts a string into a symbol
getenv ---- Retrieves the setting of variable in the system environment
grread ---- Receives input directly from keyboard, mouse, etc.
grtext ---- Displays text in status line or screen menu area
grdraw ---- Draws a temporary vector
grvecs ---- Draws multiple vectors
mem ------- Displays memory statistics
HOME