You are on page 1of 6

# Quick Reference Table - AutoLisp

AutoLisp Quick Reference Table.
(+ <NUMBER> <NUMBER> ...)
Returns the sum of two or more numbers.
(- <NUMBER> <NUMBER> ...)
Returns the difference of two or more numbers.
(* <NUMBER> <NUMBER> ...)
Returns the product of two or more numbers.
(/ <NUMBER> <NUMBER> ...)
Returns the quotient of two or more numbers.
(= <NUMBER> <NUMBER> ...)
Returns T if the numbers are equal, nil if not.
(/= <NUMB1> <NUMB2>)
Returns T if the numbers are not equal, nil if they are.
(< <NUMB1> <NUMB2>)
Returns T if <NUMB1> is less than <NUMB2>.
(<= <NUMB1> <NUMB2>)
Returns T if <NUMB1> is equal to or less than <NUMB2>.
(> <NUMB1> <NUMB2>)
Returns T if <NUMB1>is greater than <NUMB2>.
(>= <NUMB1> <NUMB2>)
Returns T if <NUMB1> is equal to or greater than <NUMB2>.
(~ <NUMBER>)
Returns the bitwise of <NUMBER>.
(1+ <NUMBER>)
Returns the <NUMBER> increased by one.
(1- <NUMBER>)
Returns the <NUMBER> decreased by one.

(abs <NUMBER>)
Returns the absolute value of <NUMBER>.
(and <EXPR> ...)
Returns the logical AND of a list of expressions.
Returns nil if expressions are nil.
(angle <PT1> <PT2>)
Returns the angle in radians between two points.
(angtos <ANGLE>[<MODE><PRECIS.>])
Returns the angle as a string. Mode 0=Degrees,1=Deg Min Sec,
(append <EXPR> ....)
Returns a number of lists as one list.
(apply <FUNCTION> <LIST>)
Executes function with the arguments given as a list.
(ascii <STRING>)
Returns ascii value of first character of a string.
(assoc <ITEM><ALIST>)
Searches <ALIST> for <ITEM>.
(atan <NUM1> [<NUM2>])
Returns the arctangent of <NUM1> or <NUM1>/<NUM2>.
(atof <STRING>)
Returns the conversion of a string into a real.
(atoi <STRING>)
Returns the conversion of a string into an integer.
(atom <ITEM>)
Returns T if <ITEM> is not a list.

(Boole <FUNC> <NUMB1> <NUMB2)
Returns Boolean bitwise truth comparisons.

(entdel <ENAME>) Deletes the entity <ENAME> or undeletes it if it has already been deleted. (eq <EXPR1> <EXPR2>) Returns T if expressions are bound to same object.. (chr <NUMBER>) Returns the string represented by an ascii value.) Evaluates any number of lists as arguments. (cdar <LIST>) Returns second element of the first element of list. (entnext [<ENAME>]) Returns the first non-deleted entity after <ENAME>. (entget <ENAME>) Returns <ENAME> from the database as a list. Use for polylines or blocks. (cond (<TEST1><RESULT1>). (equal <EXPR1> <EXPR2>) Returns T if the expressions are equal... (defun <SYM><ARG LIST><EXPR>. (cddr <LIST>) Returns all but first element of last element list. (close <FILENAME>) Closes a file.) Executes an AutoCAD command. (caddr <LIST>) Returns the third element of a list. (entmod <ENAME>) Updates <ENAME> in the database. (cdr <LIST>) Returns all but the first element of a list. (cons <NEW FIRST ELEMENT><LIST>) Contructs a new list. (command <ARGS>..) Defines an AutoLISP function. (boundp <ATOM>) Returns T if <ATOM> has a value bound to it. (eval <EXPR>) Evalutes an expression. NOT for blocks or polylines (entupd <ENAME>) Updates <ENAME> in the database. (cadr <LIST>) Returns the second element of a list. (cos <ANGLE>) Returns the cosine of an angle. (entlast) Returns the last non-deleted entity in the database. (entsel [<PROMPT>]) Selects a single entity by a point pick. (car <LIST>) Returns the first element of a list.<NUMB>'s must be integers. .. (caar <LIST>) Returns first element of the first element of a list. (distance <PT1> <PT2>) Returns the distance between two points. (cadar <LIST>) Returns last element of the first element of a list..

. (getdist [<PT>][<PROMPT>]) Pauses for input of distance at optional start point. (getvar <varname>) Retrieves the value of an AutoCAD system variable. (graphscr) Flips from text screen to graphics screen. (getangle [<PT>][<PROMPT>]) Pauses for input of an angle at optional starting point <PT>. (inters <pt1><pt2><pt3><pt4>[<onseg>]) Returns the intersection point of two lines. If <ONSEG> is greater than 0 the intersection may lie past the endpoints of the lines. (grread <track>) Allows AutoLISP to read AutoCADs input devices.. (float <NUMBER>) Converts <NUMBER> to a real. (fix <NUMBER>) Converts <NUMBER> to an integer. (foreach <NAME><LIST><EXPR>) Evaluates <EXPR> for each element in the <LIST> and assigns to <NAME>. (itoa <number>) Returns the conversion of an integer to a string. (grclear) Clears the graphics screen. (getcorner [<PT>][<PROMPT>]) Getpoint function . (getorient [<PT>][<PROMPT>]) Returns angle in radians from current orientation. (if <testexpr><thenexpr>[<elseexpr>]) Conditionally evaluates expressions.) Defines an "anonymous" function. (getkword [<PROMPT>]) Requests a keyword from the user. (gcd <NUM1> <NUM2>) Returns the greatest common denominator. (grtext <box><text><highlight>]) Write to text portion of graphics screen. (getenv [<VARIABLE>]) Returns string value assigned to a system variable. (lambda <arguments><expr>. (getreal [<PROMPT>]) Pauses for input of a real number. (getpoint [<PT>][<PROMPT>]) Pauses for input of an angle at optional point <PT>.(exp <NUMBER>) Returns E to the power <NUMBER>. (getstring [<CR>][<PROMPT>]) Pauses for input of a string. (findfile <FILENAME>) Searches all paths to find <FILENAME>. .draws triangle as crosshairs move. (grdraw <from><to><color>[<highlight>]) Draws a vector between two points. (expt <BASE> <NUMBER>) Returns <BASE> to the power <NUMBER>.

(member <expr><list>) Searches <LIST> for first occurence of <EXPR> and returns the remainder of the list..) Returns the logical bitwise OR of a list of numbers. (menucmd <string>) Switch between pages in an AutoCAD menu.(last <list>) Returns the last element in <LIST>.. (open <FILENAME><MODE>) Opens a file. (load <filename>) Loads an AutoLISP program in memory. (length <list>) Returns the number of elements in <LIST>.. (numberp <ITEM>) Returns T if <ITEM> is an integer or a real.. (polor <PT><ANGLE><DISTANCE>) Returns point at <ANGLE> and <DISTANCE> from <PT>. (nth <n><LIST>) Returns the "nth" element of <LIST>. (not <ITEM>) Returns T if the expression is nil.) Evalutes each expression sequentially.. (min <NUMBER><NUMBER>.) Returns the logical bitwise AND of a list of numbers. .) Returns the logical OR of a list of expressions. (or <EXPR>. (lsh <numb1><numbits>) Returns the logical bitwise SHIFT operator of <NUM1> by <NUMBITS> (mapcar <function><list1>. (progn <EXPR>. (log <number>) Returns natural log of <NUMBER> as a real. (minusp <ITEM>) Returns T if the item is negative. (null <ITEM>) Returns T if <ITEM> is bound to nil. (max <number><number>. (print <EXPR>[<FILENAME>]) Same as prin1 except a new line is printed before <EXPR> and a space is printed after. (prin1 <EXPR>[<FILENAME>]) Prints <EXPR> on the screen or to <FILENAME>..<listn>) Executes <FUNCTION> on the elements of <LIST1> through <LIST2>... (logand <number><number>. (princ <EXPR>[<FILENAME>]) Same as prin1 except control character are printed without expansion.. (osnap <PT><MODE-STRING>) Returns a point by applying the osnap command.... (list <expr>) Returns the list of a number of expressions. (listp <list>) Returns T if the item is a list. (logior <number><number>.) Returns the maximum of the numbers given.) Returns the smallest of the numbers given...

. (strcat <STRING1><STRING2>. (ssname <SS><INDEX>) Returns the name of the <INDEX>th entity in selection set <SS>. (set <SYM><EXPR>) Sets the value of a sysmbol name.) Concatenates a series of strings. (rem <NUM1> <NUM2> . (sslength <SS>) Returns the number of entities in selection set <SS>... (subst <NEWITEM><OLDITEM><LIST>) Substitutes <NEWITEM> for <OLDITEM> in <LIST>. If <WHICH> is not nill the returned string will be all lower case.. (setvar <VARNAME><VALUE>) Sets a system variable to <VALUE>.. (tblnext <NAME> [<rewind>]) Scans symbol table for next entity.) Evaluates each expression <NUMBER> times..) Sets the value of <SYM1> to <EXPR1>. (ssadd [<ENAME>][<SS>]) Adds entities to selections sets. or <ENAME> in <MODE>. (read-line [<FILENAME>]) Returns a string from the keyboard buffer or from <FILENAME>. (reverse <LIST>) Returns a list reversed. (ssmemb [<ENAME>][<SS>]) Returns <ENAME> if <ENAME> is a member of selections set <SS>. (ssdel [<ENAME>][<SS>]) Deletes entities from selections sets. (sqrt <NUMBER>) Returns the square root of <NUMBER>. (read <STRING>) Returns the first LIST obtained from <STRING>. (read-char [<FILENAME>]) Returns a character from the keyboard buffer or from <FILENAME>.) Returns the remainder of <NUM1>/<NUM2>.. (substr <STRING><START><LENGTH>) Returns a substring of <STRING> begining at <START> of <LENGTH> characters..(prompt <MSG>) Displays <MSG> on the screen PROMPT area. (strcase <STRING>[<WHICH>)] Returns <STRING> as upper case if <WHICH> is nill. (redraw [<ENAME>][<MODE>]) Redraws either entire drawing. (repeat <NUMBER> <EXPR> . (quote <EXPR>) Returns <EXPR> unevaluated. (sin <ANGLE>) Returns the sine of an angle. (strlen <STRING>) Returns the number of characters in a string. (setq <SYM1><EXPR1>. (ssget [<MODE>][<PT1><PT2>]) Returns a selection set. (rtos <NUMBER> [<MODE><PRECIS>]) Returns a real number as a string.

(zerop <ITEM>) Returns T if <ITEM> evaluates to zero. (*error* <STRING>) User-definable error function.. (terpri) Prints a new line on the screen.. (trace <FUNCTIONS>. (type <ITEM>) Returns the type of <ITEM>.. (write-line <STRING> [<FILENAME>]) Writes <STRING> to the screen or to <FILENAME>.. (textscr) Flips from graphics screen to text screen. (trans <PT><FROM><TO>[<DISP>]) Translates a point <PT> from one coordinate system to another. (while <TESTEXPR><EXPR>) Evaluates <TESTEXPR> and if not nill executes <EXPR>.) Clears the trace floag for <FUNCTIONS>. (write-char <NUM> [<FILENAME>]) Writes the character represented by the ASCII value of <NUM> to the screen or to <FILENAME>.(tblsearch <NAME><SYM>[<setnext>]) Searches entire symbol table for <NAME>. (vmon) Enables AutoLISP virtual function pager. (ver) Returns AutoLISP version number.) Debugging aid that returns the last function name. (vports) Returns a list of currently active viewports. . (untrace <FUNCTIONS>.