Defines a function
Supported Platforms: Windows and Mac OS
(defun sym ([arguments] [/ variables ...]) expr ...)
Type: Symbol
A symbol naming the function.
Type: Integer, Real, String, List, T, or nil
The names of arguments expected by the function.
Type: Symbol
The names of one or more local variables for the function.
The slash preceding the variable names must be separated from the first local name and from the last argument, if any, by at least one space.
Type: List
Any number of AutoLISP expressions to be evaluated when the function executes.
The result of the last expression evaluated.
If you do not declare any arguments or local symbols, you must supply an empty set of parentheses after the function name.
If duplicate argument or symbol names are specified, AutoLISP uses the first occurrence of each name and ignores the following occurrences.
(defun myfunc (x y) ...) Function takes two arguments (defun myfunc (/ a b) ...) Function has two local variables (defun myfunc (x / temp) ...) One argument, one local variable (defun myfunc () ...) No arguments or local variables