Zephyr Home  /  AutoLISP Reference
AUTOMATION · AUTOLISP REFERENCE

Your .lsp files run here.

Zephyr ships a native AutoLISP engine with the full inventoried builtin set — verified against every documented example. Routines you wrote for full AutoCAD run unmodified: entity creation and editing, selection sets, system variables, file I/O, dictionaries, layer states, and scripted (command …) calls — identically on macOS, Windows, and Linux.

305builtins inventoried
288implemented
17Tier‑2 stubs (clean errors)
3commands: LOAD · EVAL · SCRIPT

Running scripts

COMMANDALIASDESCRIPTION
LOAD—Load and evaluate a .lsp file
EVAL—Evaluate a single Lisp expression string
SCRIPTSCRRun a .scr command script

Scripted (command …) calls include "INSERT" / "-INSERT", "_CHPROP" (color, layer, linetype, ltscale, lineweight), and, for images and PDFs, "-ATTACH" with AutoCAD's operand order: (command "-ATTACH" path [page] point [scale [rotation]]). Drawing attaches stay interactive (XATTACH). Drawing properties and system variables including CELTYPE, CELTSCALE, CELWEIGHT, CECOLOR, LTSCALE, AUTOCONTRAST, and xref variables REFPATHTYPE, VISRETAIN, BINDTYPE, XDWGFADECTL, XREFNOTIFY, and XLOADCTL are readable and settable through getvar/setvar, and (tblsearch "BLOCK" name) returns an xref's saved path (group 1) and flags (group 70).

;; Color all circles red
(setq ss (ssget "_X" '((0 . "CIRCLE"))))
(setq i 0)
(repeat (sslength ss)
  (setq e (entget (ssname ss i)))
  (entmod (if (assoc 62 e)
            (subst '(62 . 1) (assoc 62 e) e)
            (append e (list '(62 . 1)))))
  (setq i (1+ i)))

Defining the ribbon

The ribbon and its classic File / Edit / View menu bar are not compiled into the binary — they are an AutoLISP file, lisp/ribbon.lsp. It is copied into the per-user app-data directory on first run, reloads itself about a second after you save, and keeps the previous layout live if an edit fails to parse. Nothing here needs a rebuild or a restart.

A definition file defines one function, zephyr-ribbon, which returns the layout with the helpers below. Everything else in the file may be ordinary AutoLISP — loops, conditionals, append — so a ribbon can be generated from a table instead of typed out by hand.

FORMMEANING
(zr-ribbon menubar tabs)The whole definition: a menu bar section and/or a tab section (either may be nil)
(zr-menubar menus)Classic menu bar, shown in the collapsed "menu" presentation
(zr-menu title items)One top-level menu — File, Edit, Draw…
(zr-tabs tabs)Ribbon tabs, shown in the "labels" and "icons" presentations
(zr-tab title panels)One ribbon tab — Home, Insert…
(zr-panel title items)One panel inside a tab, titled underneath the buttons
(zr-big cmd label icon opts)Large ribbon button: icon above label
(zr-small cmd label icon opts)Small ribbon button: icon beside label
(zr-item cmd label opts)Menu entry (menus have no icon column)
(zr-drop label items)Ribbon flyout / menu entry with sub-items
(zr-sub title items)Submenu inside a menu
(zr-sep)Separator

Every container takes a list of children (this AutoLISP enforces exact arity and has no rest arguments), and cmd is any command name — including your own c: routines. Pass nil for icon to derive it from the command name; an unknown name draws a letter placeholder rather than an empty button.

OPTION / PREDICATEEFFECT
(zr-enable pred)Grey the entry out unless every predicate holds
(zr-check pred)Draw the entry pressed while the predicates hold (toggles)
(zr-tip text)Tooltip
(zr-sel n) · (zr-nocmd) · (zr-cmd name)Selection count, no command running, a specific command running
(zr-undoable) · (zr-redoable) · (zr-dirty)Undo/redo available, drawing has unsaved changes
(zr-var name value)System variable equals a value — (zr-var "GRIDMODE" 1)
(zr-tabcount n)At least n drawings open

State is evaluated live every frame, but never by calling LISP: predicates read the drawing, the selection and the same system-variable store getvar uses, so a routine that changes GRIDMODE updates the ribbon immediately. Labels interpolate system variables too — "Layer: %CLAYER%" follows the active layer.

;; ribbon.lsp - excerpt
(defun zephyr-ribbon ()
  (zr-ribbon
    (zr-menubar
      (list (zr-menu "File"
              (list (zr-item "NEW"  "New"  nil)
                    (zr-item "OPEN" "Open..." nil)
                    (zr-sep)
                    (zr-item "SAVE" "Save" nil)))))
    (zr-tabs
      (list (zr-tab "Home"
              (list (zr-panel "Draw"
                      (list (zr-big   "LINE"   "Line"   "line" nil)
                            (zr-small "CIRCLE" "Circle" "circle" nil)))
                    (zr-panel "Modify"
                      (list (zr-big "ERASE" "Erase" "erase"
                              (list (zr-enable (zr-sel 1))))
                            (zr-small "GRID" "Grid: %GRIDMODE%" "grid"
                              (list (zr-check (zr-var "GRIDMODE" 1))))))))))))
COMMANDDESCRIPTION
RIBBONShow or hide the ribbon (a dockable window; its position persists)
RIBBONMODEMenu bar, labels, or icons + labels. Bare Enter reports the current presentation
RIBBONRELOADRe-read the definition file and rebuild the layout

The definition is a layout document, not a dialog toolkit: it cannot create arbitrary windows or ask for input while loading. For that, DCL dialogs are the Tier 2 item on the roadmap.

Function reference

+Implemented
(+ [number number...])

Returns the sum of all numeric arguments.

Returns
Integer or Real
Parameters
number1, number2...: Numeric values to sum. If omitted, returns 0.
(+ 1 2)
;; Returns: 3
(+ 1 2 3.5)
;; Returns: 6.5
/Implemented
(/ number [number...])

Divides the first number by subsequent arguments.

Returns
Integer or Real
Parameters
number: Dividend and divisor parameters. If all are integers, performs integer truncation.
(/ 5 2)
;; Returns: 2
(/ 5.0 2)
;; Returns: 2.5
>Implemented
(> numstr [numstr...])

Checks if each argument is greater than the one to its right.

Returns
T or nil
Parameters
numstr: Number or string parameters to compare.
(> 10 5 2)
;; Returns: T
(> "c" "b")
;; Returns: T
>=Implemented
(>= numstr [numstr...])

Checks if each argument is greater than or equal to the one to its right.

Returns
T or nil
Parameters
numstr: Number or string parameters to compare.
(>= 10 10 5)
;; Returns: T
<Implemented
(< numstr [numstr...])

Checks if each argument is less than the one to its right.

Returns
T or nil
Parameters
numstr: Number or string parameters to compare.
(< 2 5 10)
;; Returns: T
<=Implemented
(<= numstr [numstr...])

Checks if each argument is less than or equal to the one to its right.

Returns
T or nil
Parameters
numstr: Number or string parameters to compare.
(<= 5 5 10)
;; Returns: T
*Implemented
(* [number [number...]])

Returns the product of all numeric arguments.

Returns
Integer or Real
Parameters
number: Numeric values to multiply.
(* 3 5)
;; Returns: 15
(* 3 1.5)
;; Returns: 4.5
*error*Implemented
(defun *error* (msg)...)

User-definable error-handling callback function.

Returns
Varies
Parameters
msg: A string containing the error message description.
(defun *error* (msg)
  (princ (strcat "\nError occurred: " msg))
  (princ)
)
*pop-error-mode*Implemented
(*pop-error-mode*)

Pops and terminates the error mode corresponding to *push-error-using-command*.

Returns
nil
Parameters
No arguments.
(*pop-error-mode*)
;; Returns: nil
*push-error-using-command*Implemented
(*push-error-using-command*)

Pushes custom error-handling state allowing the use of command within an error handler.

Returns
nil
Parameters
No arguments.
(*push-error-using-command*)
;; Returns: nil
*push-error-using-stack*Implemented
(*push-error-using-stack*)

Pushes custom error-handling state using LISP's internal stack context.

Returns
nil
Parameters
No arguments.
(*push-error-using-stack*)
;; Returns: nil
-Implemented
(- number [number...])

Subtracts subsequent numbers from the first numeric argument.

Returns
Integer or Real
Parameters
number: Base value and subtractors. If single number is provided, negates it.
(- 50 10)
;; Returns: 40
(- 10)
;; Returns: -10
/=Implemented
(/= numstr [numstr...])

Compares arguments for inequality.

Returns
T or nil
Parameters
numstr: Number or string parameters to compare.
(/= 5 10)
;; Returns: T
(/= "a" "a")
;; Returns: nil
=Implemented
(= numstr [numstr...])

Compares arguments for equality.

Returns
T or nil
Parameters
numstr: Number or string parameters to compare.
(= 5 5)
;; Returns: T
(= "a" "b")
;; Returns: nil
~Implemented
(~ int)

Computes the bitwise NOT (1's complement) of an integer.

Returns
Integer
Parameters
int: A signed integer.
(~ 3)
;; Returns: -4
1-Implemented
(1- number)

Decrements a numeric value by 1.

Returns
Integer or Real
Parameters
number: A numeric value.
(1- 10)
;; Returns: 9
(1- 10.5)
;; Returns: 9.5
1+Implemented
(1+ number)

Increments a numeric value by 1.

Returns
Integer or Real
Parameters
number: A numeric value.
(1+ 10)
;; Returns: 11
absImplemented
(abs number)

Returns the absolute value of a number.

Returns
Integer or Real
Parameters
number: Integer or Real value.
(abs -10)
;; Returns: 10
acad_colordlgImplemented
(acad_colordlg color-number [flag])

Displays the AutoCAD Select Color dialog box.

Returns
Integer (0-256) or nil
Parameters
color-number: Default color index (1-255). flag: nil to enable ByLayer/ByBlock, T to disable.
(acad_colordlg 1 nil)
;; Displays dialog; returns color selected
acad_helpdlgImplemented
(acad_helpdlg helpfile topic)

Invokes Help file search utility (Obsolete: Use help instead).

Returns
nil
Parameters
helpfile: Help filename. topic: Target topic name.
(acad_helpdlg "myhelp.chm" "topic1")
acad-pop-dbmodImplemented
(acad-pop-dbmod)

Pops and restores the value of the DBMOD system variable from the internal stack.

Returns
T or nil
Parameters
No arguments.
(acad-pop-dbmod)
;; Restores saved DBMOD status
acad-push-dbmodImplemented
(acad-push-dbmod)

Pushes and saves the active value of DBMOD system variable onto the internal stack.

Returns
T
Parameters
No arguments.
(acad-push-dbmod)
;; Saves DBMOD status
acad_strlsortImplemented
(acad_strlsort list)

Sorts a list of strings in alphabetical order.

Returns
List (of Strings) or nil
Parameters
list: List containing string elements.
(acad_strlsort '("c" "a" "b"))
;; Returns: ("a" "b" "c")
acad_truecolorcliImplemented
(acad_truecolorcli color)

Prompts true color selection inside command line.

Returns
List or nil
Parameters
color: Default color list or dotted pairs.
(acad_truecolorcli '((62. 1)))
;; Returns selected true color list
acad_truecolordlgImplemented
(acad_truecolordlg color [allowbylayer][currentlayercolor])

Displays Select Color dialog with tabs for index, true, and color books.

Returns
List or nil
Parameters
color: Dotted pair of default selection. allowbylayer: T/nil flag.
(acad_truecolordlg '(62. 1))
;; Returns selected true color list
acdimenableupdateImplemented
(acdimenableupdate status)

Controls automatic dimension updates during graphics modification.

Returns
T or nil
Parameters
status: T to enable automatic updates, nil to disable.
(acdimenableupdate nil)
;; Suspends automatic updates
acet-layerp-markImplemented
(acet-layerp-mark [status])

Sets begin/end transaction mark for Layer Previous command groupings.

Returns
T or nil
Parameters
status: T sets begin mark, nil sets end mark.
(acet-layerp-mark T)
;; Begins layer previous undo boundary
acet-layerp-modeImplemented
(acet-layerp-mode [status])

Checks or sets the active LAYERPMODE system status.

Returns
T or nil
Parameters
status: T to enable layer tracking, nil to disable.
(acet-layerp-mode T)
;; Turns LAYERPMODE on
acet-laytransTier 2 · clean error
(acet-laytrans drawing settings)

Translates drawing layer schema configurations based on mapping settings.

Returns
T or nil
Parameters
drawing: Active drawing reference. settings: Setup file path.
(acet-laytrans "drawing.dwg" "std.dws")
acet-ms-to-psImplemented
(acet-ms-to-ps value)

Converts a model space unit value to paper space coordinate units.

Returns
Real
Parameters
value: Real number distance to convert.
(acet-ms-to-ps 10.0)
;; Returns paper space equivalence
acet-ps-to-msImplemented
(acet-ps-to-ms value)

Converts a paper space unit value to model space coordinate units.

Returns
Real
Parameters
value: Real number distance to convert.
(acet-ps-to-ms 1.5)
;; Returns model space equivalence
alertImplemented
(alert string)

Displays a modal warning dialog box with a clean OK button.

Returns
nil
Parameters
string: Message text body to show.
(alert "Action completed!")
;; Displays warning box, returns nil
allocImplemented
(alloc size)

Sets segment size for AutoLISP memory allocation.

Returns
Integer
Parameters
size: Int specifying number of bytes to allocate.
(alloc 10000)
;; Returns old allocation size
andImplemented
(and [expr...])

Performs logical AND. Employs short-circuit evaluation.

Returns
T or nil
Parameters
expr: One or more AutoLISP expressions to test.
(and (= 1 1) (/= 2 3))
;; Returns: T
angleImplemented
(angle pt1 pt2)

Computes the radian angle of a line projected onto the XY plane from pt1 to pt2.

Returns
Real
Parameters
pt1, pt2: Lists denoting 2D or 3D coordinate points.
(angle '(0.0 0.0) '(10.0 10.0))
;; Returns: 0.785398
angtofImplemented
(angtof string [mode])

Converts an angle string representation into its real value in radians.

Returns
Real or nil
Parameters
string: Angle text. mode: Formats (0=Degrees, 1=Deg/Min/Sec, 2=Grads, 3=Radians, 4=Surveyor).
(angtof "180" 0)
;; Returns: 3.14159
angtosImplemented
(angtos angle [mode [prec]])

Formats a radian angle value into a text string representation.

Returns
String
Parameters
angle: Radian real value. mode: Code format. prec: Precision decimal count.
(angtos 3.14159 0 2)
;; Returns: "180.00"
appendImplemented
(append [list1 [list2...]])

Merges multiple standard lists together into a single unified list.

Returns
List
Parameters
list: Zero or more lists to concatenate.
(append '(1 2) '(3 4))
;; Returns: (1 2 3 4)
applyImplemented
(apply function list)

Executes a function using list elements as individual parameters.

Returns
Varies
Parameters
function: Symbol, subroutine, or lambda. list: Argument list.
(apply '+ '(5 10 15))
;; Returns: 30
arxTier 2 · clean error
(arx)

Returns a list of all currently loaded ObjectARX applications.

Returns
List (of Strings)
Parameters
No arguments.
(arx)
;; Returns loaded ARX module list
arxloadTier 2 · clean error
(arxload app [on_failure])

Loads an ObjectARX application module into the active context.

Returns
String (app name) or failure-value
Parameters
app: ARX filename. on_failure: Value returned if load fails.
(arxload "geom.arx" "Failed")
arxunloadTier 2 · clean error
(arxunload app [on_failure])

Unloads an ObjectARX application from memory.

Returns
String or failure-value
Parameters
app: ARX filename. on_failure: Value returned if unload fails.
(arxunload "geom.arx")
asciiImplemented
(ascii string)

Returns the ASCII/Unicode character code of the first character in a string.

Returns
Integer
Parameters
string: String to query.
(ascii "A")
;; Returns: 65
assocImplemented
(assoc key alist)

Searches an association list for an entry matching key and returns its pair.

Returns
List or nil
Parameters
key: lookup key atom. alist: association list.
(assoc 10 '((0. "LINE") (10 0.0 0.0 0.0)))
;; Returns: (10 0.0 0.0 0.0)
atanImplemented
(atan num1 [num2])

Returns the arctangent of a number, or quotient of two numbers, in radians.

Returns
Real
Parameters
num1, num2: Numeric values.
(atan 1.0)
;; Returns: 0.785398
atofImplemented
(atof string)

Converts an alphanumeric string into a real floating-point value.

Returns
Real
Parameters
string: Text representation of a number.
(atof "123.45")
;; Returns: 123.45
atoiImplemented
(atoi string)

Converts an alphanumeric string into a 32-bit signed integer value.

Returns
Integer
Parameters
string: Text representation of an integer.
(atoi "456")
;; Returns: 456
atomImplemented
(atom item)

Verifies if the specified argument is an atom (i.e. not a list).

Returns
T or nil
Parameters
item: Any AutoLISP element.
(atom 'a)
;; Returns: T
(atom '(1 2))
;; Returns: nil
atoms-familyImplemented
(atoms-family format [exclude])

Returns a list of all currently defined symbol names.

Returns
List
Parameters
format: 0 (returns symbols) or 1 (returns string representations). exclude: Exclusion list.
(atoms-family 1 '("nil" "t"))
;; Returns active symbol name strings
autoarxloadTier 2 · clean error
(autoarxload app cmdlist)

Registers an ObjectARX command to autoload its corresponding file on call.

Returns
nil
Parameters
app: ARX filename. cmdlist: commands triggering load.
(autoarxload "myarx" '("mycmd"))
autoloadImplemented
(autoload filename commands)

Registers a command to load its corresponding LISP file when invoked.

Returns
nil
Parameters
filename: LISP file. commands: list of command string names.
(autoload "tools.lsp" '("C:ALIGN"))
booleImplemented
(boole operator int1 int2...)

Performs bitwise Boolean truth comparisons between integers.

Returns
Integer
Parameters
operator: Logical operations (1-15). int: Signed integer values.
(boole 1 12 5)
;; Returns bitwise AND of 12 and 5: 4
boundpImplemented
(boundp symbol)

Verifies if a value is currently bound to the specified symbol name.

Returns
T or nil
Parameters
symbol: Variable symbol to check.
(setq x 10)
(boundp 'x)
;; Returns: T
(boundp 'y)
;; Returns: nil
caddrImplemented
(caddr list)

Returns the third element of a list.

Returns
Varies
Parameters
list: Standard list.
(caddr '(10 20 30 40))
;; Returns: 30
cadrImplemented
(cadr list)

Returns the second element of a list.

Returns
Varies
Parameters
list: Standard list.
(cadr '(10 20 30))
;; Returns: 20
carImplemented
(car list)

Returns the first element of a list.

Returns
Varies
Parameters
list: Standard list or dotted pair.
(car '(10 20 30))
;; Returns: 10
cdrImplemented
(cdr list)

Returns a list containing all elements except the first, or second element of a dotted pair.

Returns
List, Atom or nil
Parameters
list: Standard list or dotted pair.
(cdr '(10 20 30))
;; Returns: (20 30)
(cdr '(10. 20))
;; Returns: 20
chrImplemented
(chr int)

Converts an integer ASCII/Unicode code into its single-character string representation.

Returns
String
Parameters
int: Integer character code.
(chr 65)
;; Returns: "A"
closeImplemented
(close file-desc)

Closes an open file stream descriptor.

Returns
nil
Parameters
file-desc: Pointer to open file stream.
(close f)
;; Closes stream, returns nil
commandImplemented
(command [arguments...])

Executes an AutoCAD command asynchronously within active workspace.

Returns
nil
Parameters
arguments: Command names and operational inputs.
(command "_LINE" '(0 0 0) '(10 10 0) "")
;; Draws line
command-sImplemented
(command-s [arguments...])

Executes an AutoCAD command synchronously for faster execution.

Returns
nil
Parameters
arguments: Command names and inputs.
(command-s "_LINE" '(0 0 0) '(5 5 0) "")
condImplemented
(cond (test1 [expr1_1...]) [(test2 [expr2_1...])...])

Evaluates multi-conditional branches, executing actions for first non-nil condition.

Returns
Varies
Parameters
test: conditional expression. expr: operations evaluated if test is non-nil.
(setq x 2)
(cond ((= x 1) "One") ((= x 2) "Two"))
;; Returns: "Two"
consImplemented
(cons new-element list-or-atom)

Adds an element to the head of a list, or constructs a dotted pair.

Returns
List or Dotted Pair
Parameters
new-element: atom/list to add. list-or-atom: tail target.
(cons 1 '(2 3))
;; Returns: (1 2 3)
(cons 1 2)
;; Returns: (1. 2)
cosImplemented
(cos angle)

Computes the cosine of an angle in radians.

Returns
Real
Parameters
angle: Radian angle.
(cos 3.14159)
;; Returns: -1.0
cvunitImplemented
(cvunit value from to)

Converts real-world values or coordinate lists between measurement unit definitions.

Returns
Real, List or nil
Parameters
value: Num/Point. from: active unit string. to: target unit string.
(cvunit 1 "inch" "mm")
;; Returns: 25.4
defun-q-list-refImplemented
(defun-q-list-ref 'function)

Displays the internal list structure of a function defined with defun-q.

Returns
List or nil
Parameters
function: Quoted function symbol defined via defun-q.
(defun-q MyTest (x) (print x))
(defun-q-list-ref 'MyTest)
;; Returns: ((X) (PRINT X))
defun-q-list-setImplemented
(defun-q-list-set 'sym list)

Defines a function symbol using a raw list structure.

Returns
Symbol
Parameters
sym: Function name symbol. list: Definition list representation.
(defun-q-list-set 'MyCombined '( (x) (print x) ))
defun-qImplemented
(defun-q name (args / locals) expr...)

Defines a custom function while storing its structure as an editable list of S-expressions.

Returns
Symbol
Parameters
name: function name. args: parameters. locals: local variables.
(defun-q MyFunc (x) (* x x))
defunImplemented
(defun [c:]name (args / locals) expr...)

Defines a named custom function, with optional local variables.

Returns
Symbol
Parameters
c:name: command name. args: parameters. locals: localized variables.
(defun c:hello () (alert "Hello!") (princ))
dictaddImplemented
(dictadd dict symbol obj)

Adds a non-graphical object to a specified dictionary.

Returns
Ename or nil
Parameters
dict: dictionary ename. symbol: dictionary entry key name. obj: object ename.
(dictadd dict_name "MY_KEY" obj_name)
dictnextImplemented
(dictnext dict [rewind])

Retrieves the next non-graphical object in a dictionary.

Returns
List or nil
Parameters
dict: dictionary ename. rewind: if non-nil, resets lookup pointer to top.
(dictnext dict_ename)
dictremoveImplemented
(dictremove dict symbol)

Removes a non-graphical object entry from a dictionary.

Returns
Ename or nil
Parameters
dict: dictionary ename. symbol: key name string to remove.
(dictremove dict_ename "MY_KEY")
dictrenameImplemented
(dictrename dict oldname newname)

Renames a key entry inside a dictionary.

Returns
Ename or nil
Parameters
dict: dictionary ename. oldname, newname: string keys.
(dictrename dict_ename "OLD" "NEW")
dictsearchImplemented
(dictsearch dict symbol [setnext])

Searches a dictionary for an entry matching a key.

Returns
List or nil
Parameters
dict: dictionary ename. symbol: target key. setnext: if non-nil, sets pointer.
(dictsearch dict_ename "MY_KEY")
distanceImplemented
(distance pt1 pt2)

Calculates the absolute 3D distance between two coordinate points.

Returns
Real
Parameters
pt1, pt2: coordinate point lists.
(distance '(0 0 0) '(3 4 0))
;; Returns: 5.0
distofImplemented
(distof string [mode])

Parses a distance string representation into its real value.

Returns
Real or nil
Parameters
string: distance text. mode: format code.
(distof "12.50" 2)
;; Returns: 12.50
dumpallpropertiesImplemented
(dumpallproperties ename [context])

Prints or logs all supported properties of an entity.

Returns
T or nil
Parameters
ename: Target entity. context: int context rule (0 or 1).
(dumpallproperties (entlast))
entdelImplemented
(entdel ename)

Deletes (or undeletes) an entity inside drawing database.

Returns
Ename or nil
Parameters
ename: Target entity name.
(entdel (entlast))
;; Deletes the last created entity
entgetImplemented
(entget ename [app-list])

Queries and retrieves DXF properties of a drawing entity name.

Returns
List (Association List)
Parameters
ename: Entity. app-list: list of application keys for xdata lookup.
(entget (entlast))
;; Returns DXF group code list
entlastImplemented
(entlast)

Returns the entity name of the last non-deleted object in the database.

Returns
Ename or nil
Parameters
No arguments.
(entlast)
;; Returns ename pointer
entmakeImplemented
(entmake [elist])

Creates a new graphical or database object via DXF code definitions.

Returns
List or nil
Parameters
elist: DXF association list mapping the entity property states.
(entmake '((0. "POINT") (10 0 0 0)))
entmakexImplemented
(entmakex [elist])

Creates an entity, assigns it a handle, and returns its entity name.

Returns
Ename or nil
Parameters
elist: DXF association list.
(entmakex '((0. "LINE") (10 0 0 0) (11 10 10 0)))
entmodImplemented
(entmod elist)

Modifies an existing database entity using updated DXF properties.

Returns
List or nil
Parameters
elist: updated DXF list containing target ename in group 1.
(setq edata (entget (entlast)))
(setq edata (subst '(8. "Layer2") (assoc 8 edata) edata))
(entmod edata)
;; Updates layer
entnextImplemented
(entnext [ename])

Returns the next entity in the drawing database.

Returns
Ename or nil
Parameters
ename: Starting entity name. If omitted, returns first entity.
(entnext)
;; Returns first entity in active database
entselImplemented
(entsel [prompt])

Prompts user to select a single drawing entity.

Returns
List or nil
Parameters
prompt: Message text. Returns (ename point) list.
(entsel "Pick entity: ")
entupdImplemented
(entupd ename)

Forces visual redraw of specified database entity.

Returns
nil
Parameters
ename: Target entity name.
(entupd (entlast))
;; Forces redraw
eqImplemented
(eq expr1 expr2)

Checks if two expressions are bound to identical object references in memory.

Returns
T or nil
Parameters
expr1, expr2: expressions.
(setq a '(1 2) b a)
(eq a b)
;; Returns: T
equalImplemented
(equal expr1 expr2 [tolerance])

Checks if two expressions evaluate to equal values.

Returns
T or nil
Parameters
expr1, expr2: expressions. tolerance: real fuzz tolerance.
(equal 1.0001 1.0002 0.001)
;; Returns: T
evalImplemented
(eval expr)

Evaluates an AutoLISP S-expression and returns its result.

Returns
Varies
Parameters
expr: any valid S-expression.
(eval '(+ 1 2))
;; Returns: 3
exitImplemented
(exit)

Forces exit of current program and aborts execution context.

Returns
nil
Parameters
No arguments.
(exit)
;; Aborts execution
expImplemented
(exp num)

Computes the natural exponential (e raised to the specified power).

Returns
Real
Parameters
num: Integer or Real value.
(exp 1)
;; Returns: 2.71828
expandImplemented
(expand segments)

Allocates additional virtual memory segments for LISP nodes.

Returns
Integer
Parameters
segments: Integer segment allocation count.
(expand 10)
exptImplemented
(expt base power)

Raises the base value to the specified power.

Returns
Real or Integer
Parameters
base: base number. power: power exponent.
(expt 2 3)
;; Returns: 8
findfileImplemented
(findfile filename)

Searches AutoCAD library paths for a file.

Returns
String or nil
Parameters
filename: relative filename search target.
(findfile "acad.pat")
;; Returns complete directory path
findtrustedfileImplemented
(findtrustedfile filename)

Searches AutoCAD secure paths for specified filename.

Returns
String or nil
Parameters
filename: target file name.
(findtrustedfile "secure_tool.lsp")
fixImplemented
(fix num)

Truncates a real number to its nearest integer.

Returns
Integer
Parameters
num: Integer or Real value.
(fix 12.75)
;; Returns: 12
floatImplemented
(float num)

Converts a number into its real floating-point representation.

Returns
Real
Parameters
num: Numeric value.
(float 10)
;; Returns: 10.0
foreachImplemented
(foreach symbol list [expr...])

Loops through list, binding each element sequentially to a symbol for execution.

Returns
Varies
Parameters
symbol: loop variable. list: list structure. expr: execution body.
(foreach x '(1 2 3) (princ x))
;; Prints "123"
gcImplemented
(gc)

Forces garbage collection to run immediately, freeing unallocated dynamic memory pages.

Returns
nil
Parameters
No arguments.
(gc)
gcdImplemented
(gcd int1 int2)

Calculates the greatest common denominator of two integers.

Returns
Integer
Parameters
int1, int2: Integer values.
(gcd 12 18)
;; Returns: 6
getangleImplemented
(getangle [pt][prompt])

Prompts user to specify an angle.

Returns
Real (Radians) or nil
Parameters
pt: optional base point. prompt: string message.
(getangle '(0 0) "Angle: ")
getcfgImplemented
(getcfg section)

Retrieves application settings from AppData section of acad20xx.cfg file.

Returns
String or nil
Parameters
section: registry path string inside CFG structure.
(getcfg "AppData/MyTool/Setting1")
getcnameImplemented
(getcname command_name)

Retrieves localized or global command name for AutoCAD keywords.

Returns
String or nil
Parameters
command_name: command name string.
(getcname "_LINE")
;; Returns localized command name
getcornerImplemented
(getcorner pt [prompt])

Prompts user to select rectangular corner.

Returns
List (3D Point) or nil
Parameters
pt: baseline corner origin point. prompt: message string.
(getcorner '(0 0 0) "Corner point: ")
getdistImplemented
(getdist [pt][prompt])

Prompts user to enter distance values.

Returns
Real or nil
Parameters
pt: optional baseline origin point. prompt: message string.
(getdist "Distance: ")
getenvImplemented
(getenv variable_name)

Retrieves the value of a system environment variable.

Returns
String or nil
Parameters
variable_name: environment key string.
(getenv "PATH")
getfiledImplemented
(getfiled title default_path ext flags)

Displays native file selection dialog box.

Returns
String or nil
Parameters
title: dialog title. default_path: starting folder. ext: extensions. flags: configurations.
(getfiled "Select LISP" "C:/" "lsp" 8)
getintImplemented
(getint [prompt])

Prompts user to specify an integer.

Returns
Integer or nil
Parameters
prompt: message string.
(getint "Enter count: ")
getkwordImplemented
(getkword [prompt])

Prompts user to enter keywords initialized via initget.

Returns
String or nil
Parameters
prompt: message string.
(initget "Yes No")
(getkword "Continue? (Yes/No): ")
getorientImplemented
(getorient [pt][prompt])

Prompts user to enter absolute angle ignores ANGBASE.

Returns
Real (Radians) or nil
Parameters
pt: base point. prompt: message string.
(getorient "Orientation: ")
getpointImplemented
(getpoint [pt][prompt])

Prompts user for coordinate point selection.

Returns
List (3D Point) or nil
Parameters
pt: baseline point. prompt: message string.
(getpoint "Pick: ")
getpropertyvalueImplemented
(getpropertyvalue ename property_name [index])

Retrieves value of a property from a drawing entity.

Returns
Varies
Parameters
ename: Target entity. property_name: Target property string. index: optional index.
(getpropertyvalue (entlast) "Area")
getrealImplemented
(getreal [prompt])

Prompts user to enter a real number.

Returns
Real or nil
Parameters
prompt: message string.
(getreal "Enter factor: ")
getstringImplemented
(getstring [flag][prompt])

Prompts user to specify a string.

Returns
String or nil
Parameters
flag: non-nil allows space inputs. prompt: message string.
(getstring T "Enter text: ")
getvarImplemented
(getvar name)

Retrieves current value of an AutoCAD system variable.

Returns
Varies
Parameters
name: string variable key.
(getvar "CLAYER")
;; Returns active layer name
graphscrImplemented
(graphscr)

Displays AutoCAD graphical viewport editor canvas.

Returns
nil
Parameters
No arguments.
(graphscr)
grclearImplemented
(grclear)

Clears active graphic viewport display buffers.

Returns
nil
Parameters
No arguments.
(grclear)
grdrawImplemented
(grdraw pt1 pt2 color [highlight])

Draws a temporary vector line in active viewport.

Returns
nil
Parameters
pt1, pt2: coordinate points. color: color index integer. highlight: highlight flag.
(grdraw '(0 0) '(10 10) 1 1)
grreadImplemented
(grread [track][allkeys [curtype]])

Directly reads user input device stream (keys, mouse, coordinates).

Returns
List
Parameters
track: mouse coordinate tracking. allkeys: return keycodes. curtype: cursor type.
(grread T)
grtextImplemented
(grtext [box text [highlight]])

Writes a string message to coordinates/status line.

Returns
nil
Parameters
box: coordinate/menu cell int. text: message. highlight: highlights cell.
(grtext -1 "My Toolbar Status")
grvecsImplemented
(grvecs vlist [trans])

Draws multiple temporary vectors in active viewport.

Returns
nil
Parameters
vlist: coordinate list of vectors. trans: transform matrix.
(grvecs '(1 (0 0) (5 5)))
handentImplemented
(handent handle)

Retrieves drawing ename pointing to persistent hexadecimal handle.

Returns
Ename or nil
Parameters
handle: string handle code key.
(handent "A1")
;; Returns entity name
helpImplemented
(help [helpfile [topic [flag]]])

Invokes AutoCAD offline or online Help documentation system.

Returns
String or nil
Parameters
helpfile: file path. topic: target topic ID. flag: windows help styles.
(help "acad_acr.chm" "LINE")
ifImplemented
(if test then-statement [else-statement])

Conditionally branch S-expression execution.

Returns
Varies
Parameters
test: conditional test S-expression. then/else: branches executed on results.
(if (= 1 1) "Yes" "No")
;; Returns: "Yes"
initcommandversionImplemented
(initcommandversion [version])

Initializes target version constraints for active command pipeline.

Returns
T or nil
Parameters
version: Command version constraint integer.
(initcommandversion 1)
initdiaImplemented
(initdia [flag])

Forces next AutoCAD command to display its graphical dialog.

Returns
nil
Parameters
flag: Optional integer control code.
(initdia 1)
(command "_PLOT")
initgetImplemented
(initget [bits][string])

Initializes validation filters and keyword lists for subsequent user-input prompts.

Returns
nil
Parameters
bits: integer bit filter codes. string: delimited keyword options.
(initget 1 "Yes No")
(getkword "Confirm? ")
intersImplemented
(inters pt1 pt2 pt3 pt4 [onseg])

Computes coordinate intersection of two lines.

Returns
List (3D Point) or nil
Parameters
pt1, pt2, pt3, pt4: coordinate points. onseg: non-nil restricts intersection to segments.
(inters '(0 0) '(10 10) '(0 10) '(10 0))
;; Returns: (5.0 5.0 0.0)
ispropertyreadonlyImplemented
(ispropertyreadonly ename property_name)

Checks if a property of a drawing entity is read-only.

Returns
T or nil
Parameters
ename: Target entity. property_name: Target property name string.
(ispropertyreadonly (entlast) "Area")
itoaImplemented
(itoa int)

Converts integer to string.

Returns
String
Parameters
int: signed 32-bit integer.
(itoa 123)
;; Returns: "123"
lambdaImplemented
(lambda args expr...)

Defines an anonymous user function block.

Returns
Subroutine (USUBR)
Parameters
args: parameters. expr: execution statements.
(mapcar '(lambda (x) (* x 2)) '(1 2 3))
;; Returns: (2 4 6)
lastImplemented
(last list)

Retrieves the final element in a list structure.

Returns
Varies
Parameters
list: standard list.
(last '(1 2 3))
;; Returns: 3
layerstate-addlayersImplemented
(layerstate-addlayers name list)

Appends layer lists into existing saved layer states.

Returns
T or nil
Parameters
name: state string name. list: list of layer names.
(layerstate-addlayers "State1" '("0"))
layerstate-compareImplemented
(layerstate-compare name drawing)

Compares a layer state to layers in a specified drawing.

Returns
T or nil
Parameters
name: state name. drawing: drawing database.
(layerstate-compare "State1" "drawing.dwg")
layerstate-deleteImplemented
(layerstate-delete name)

Deletes a saved layer state.

Returns
T or nil
Parameters
name: state name string.
(layerstate-delete "State1")
layerstate-exportImplemented
(layerstate-export name file)

Exports a layer state configuration to an LAS file.

Returns
T or nil
Parameters
name: state name. file: export path string.
(layerstate-export "State1" "C:/state.las")
layerstate-getlastrestoredImplemented
(layerstate-getlastrestored)

Returns the name of the last restored layer state in active session.

Returns
String or nil
Parameters
No arguments.
(layerstate-getlastrestored)
layerstate-getlayersImplemented
(layerstate-getlayers name)

Lists all layers registered inside a layer state.

Returns
List (of layers) or nil
Parameters
name: state name.
(layerstate-getlayers "State1")
layerstate-getnamesImplemented
(layerstate-getnames)

Returns a list of all saved layer state names.

Returns
List (of strings)
Parameters
No arguments.
(layerstate-getnames)
layerstate-hasImplemented
(layerstate-has name)

Checks if a specified layer state exists.

Returns
T or nil
Parameters
name: state name string.
(layerstate-has "State1")
layerstate-importImplemented
(layerstate-import file)

Imports layer states from an LAS file.

Returns
T or nil
Parameters
file: LAS file path string.
(layerstate-import "C:/state.las")
layerstate-importfromdbImplemented
(layerstate-importfromdb name database)

Imports layer states from another drawing database.

Returns
T or nil
Parameters
name: state name. database: source database ename.
(layerstate-importfromdb "State1" db_ename)
layerstate-removelayersImplemented
(layerstate-removelayers name list)

Removes specified layers from a layer state.

Returns
T or nil
Parameters
name: state name. list: layer list.
(layerstate-removelayers "State1" '("Layer1"))
layerstate-renameImplemented
(layerstate-rename oldname newname)

Renames a saved layer state.

Returns
T or nil
Parameters
oldname, newname: strings.
(layerstate-rename "State1" "NewState")
layerstate-restoreImplemented
(layerstate-restore name [viewport_id [flags]])

Restores saved layer state configurations.

Returns
T or nil
Parameters
name: state name. viewport_id: target viewport. flags: restore configurations.
(layerstate-restore "State1")
layerstate-saveImplemented
(layerstate-save name [mask [viewport_id]])

Saves current drawing layer configurations into a state.

Returns
T or nil
Parameters
name: state name. mask: integer filter mask. viewport_id: target viewport.
(layerstate-save "State1")
layoutlistImplemented
(layoutlist)

Returns a list of all paper layout names in the current drawing.

Returns
List (of Strings)
Parameters
No arguments.
(layoutlist)
;; Returns layout list
lengthImplemented
(length list)

Returns an integer representing the size of a list.

Returns
Integer
Parameters
list: standard list.
(length '(1 2 3 4))
;; Returns: 4
listImplemented
(list [expr...])

Creates a standard LISP list structure from S-expressions.

Returns
List
Parameters
expr: any valid S-expressions.
(list 1 2 3)
;; Returns: (1 2 3)
listpImplemented
(listp item)

Checks if the specified argument is a list or nil.

Returns
T or nil
Parameters
item: any valid argument.
(listp '(1 2))
;; Returns: T
(listp nil)
;; Returns: T
loadImplemented
(load filename [on-failure])

Loads an external LISP file into active context.

Returns
Varies
Parameters
filename: LISP file path. on-failure: value returned on failure.
(load "mylib.lsp" "Failed")
logImplemented
(log num)

Computes natural logarithm of a number.

Returns
Real
Parameters
num: Real or Integer value.
(log 2.71828)
;; Returns: 1.0
logandImplemented
(logand int1 int2...)

Performs bitwise logical AND on integer arguments.

Returns
Integer
Parameters
int: signed integers.
(logand 12 5)
;; Returns: 4
logiorImplemented
(logior int1 int2...)

Performs bitwise logical OR on integer arguments.

Returns
Integer
Parameters
int: signed integers.
(logior 12 5)
;; Returns: 13
lshImplemented
(lsh int num_bits)

Performs bitwise shift on integer arguments.

Returns
Integer
Parameters
int: starting integer. num_bits: shift bits integer.
(lsh 2 1)
;; Returns: 4
mapcarImplemented
(mapcar function list1 [list2...])

Maps a function over elements of lists, returning the results.

Returns
List
Parameters
function: subroutine or lambda mapper. list: list values.
(mapcar '1+ '(1 2 3))
;; Returns: (2 3 4)
maxImplemented
(max num1 num2...)

Returns the largest numeric value among arguments.

Returns
Integer or Real
Parameters
num: Integer or Real values.
(max 10 20.5 5)
;; Returns: 20.5
memImplemented
(mem)

Displays diagnostic heap memory segment statistics.

Returns
nil
Parameters
No arguments.
(mem)
memberImplemented
(member expr list)

Searches list for occurrence of S-expression and returns remaining slice.

Returns
List or nil
Parameters
expr: search target. list: standard list.
(member 3 '(1 2 3 4))
;; Returns: (3 4)
menucmdTier 2 · clean error
(menucmd string)

Displays or executes AutoCAD menu commands.

Returns
nil
Parameters
string: menu group commands.
(menucmd "P0=POP1")
menugroupTier 2 · clean error
(menugroup group)

Retrieves loaded status of menu groups.

Returns
Varies
Parameters
group: menu group name string.
(menugroup "ACAD")
minImplemented
(min num1 num2...)

Returns the smallest numeric value among arguments.

Returns
Integer or Real
Parameters
num: numeric values.
(min 5 10 -2)
;; Returns: -2
minuspImplemented
(minusp num)

Checks if a numeric value is negative.

Returns
T or nil
Parameters
num: numeric value.
(minusp -10)
;; Returns: T
namedobjdictImplemented
(namedobjdict)

Returns entity name of the named object dictionary.

Returns
Ename
Parameters
No arguments.
(namedobjdict)
nentselImplemented
(nentsel [prompt])

Prompts user to select sub-entities inside block/nested references.

Returns
List or nil
Parameters
prompt: message string. Returns nested entity data list.
(nentsel "Select nested element: ")
nentselpImplemented
(nentselp [prompt][pt])

Sub-entity selector, returning 3D coordinate transform matrices.

Returns
List or nil
Parameters
prompt: message string. pt: optional pick point.
(nentselp "Select nested element: ")
notImplemented
(not item)

Computes logical negation.

Returns
T or nil
Parameters
item: S-expression to check.
(not T)
;; Returns: nil
(not nil)
;; Returns: T
nthImplemented
(nth n list)

Retrieves the n-th element of a list structure (0-indexed).

Returns
Varies
Parameters
n: integer index. list: standard list.
(nth 1 '(10 20 30))
;; Returns: 20
nullImplemented
(null item)

Checks if the specified S-expression evaluates to nil.

Returns
T or nil
Parameters
item: S-expression to test.
(null nil)
;; Returns: T
numberpImplemented
(numberp item)

Checks if the specified S-expression is an Integer or Real number.

Returns
T or nil
Parameters
item: S-expression to test.
(numberp 10.5)
;; Returns: T
openImplemented
(open filename mode)

Opens an external file stream.

Returns
File Descriptor or nil
Parameters
filename: file path string. mode: access mode ("r" = read, "w" = write, "a" = append).
(setq f (open "C:/log.txt" "w"))
orImplemented
(or [expr...])

Performs logical OR. Employs short-circuit evaluation.

Returns
T or nil
Parameters
expr: expressions to evaluate.
(or (= 1 2) (= 2 2))
;; Returns: T
osnapImplemented
(osnap pt mode-string)

Applies object snap modifiers on a coordinate point.

Returns
List (3D Point) or nil
Parameters
pt: original point coordinate. mode-string: snaps list (e.g. "_mid,_end").
(osnap '(5 5 0) "_endpoint")
polarImplemented
(polar pt angle distance)

Calculates coordinate point project at angle and distance.

Returns
List (3D Point)
Parameters
pt: starting point. angle: radians. distance: projection distance.
(polar '(0 0 0) 0.0 10.0)
;; Returns: (10.0 0.0 0.0)
prin1Implemented
(prin1 [expr [file-desc]])

Prints S-expression, keeping escape characters format.

Returns
Varies
Parameters
expr: expression. file-desc: optional output file.
(prin1 "Hello\nWorld")
;; Prints: "Hello\nWorld"
princImplemented
(princ [expr [file-desc]])

Prints S-expression, stripping escape characters.

Returns
Varies
Parameters
expr: expression. file-desc: optional output file.
(princ "Hello\nWorld")
;; Prints clean text
printImplemented
(print [expr [file-desc]])

Prints S-expression, preceded by newline and followed by a space.

Returns
Varies
Parameters
expr: expression. file-desc: optional output file.
(print "Hello")
prognImplemented
(progn [expr...])

Evaluates S-expressions sequentially, returning the value of the final evaluation.

Returns
Varies
Parameters
expr: sequential execution expressions.
(progn (setq x 10) (setq y 20) (+ x y))
;; Returns: 30
promptImplemented
(prompt msg)

Prints a message string directly in AutoCAD command prompt console.

Returns
nil
Parameters
msg: text message string.
(prompt "Initializing...\n")
;; Returns nil
quitImplemented
(quit)

Forces immediate exit of current session execution.

Returns
nil
Parameters
No arguments.
(quit)
quoteImplemented
(quote expr)

Returns the argument S-expression without evaluating it.

Returns
Varies
Parameters
expr: S-expression to quote.
(quote (+ 1 2))
;; Returns: (+ 1 2) (equivalent to '(1 2))
read-charImplemented
(read-char [file-desc])

Reads a single character from open file stream.

Returns
Integer (Unicode value) or nil
Parameters
file-desc: open file stream descriptor. If omitted, reads console.
(read-char f)
read-lineImplemented
(read-line [file-desc])

Reads a line of text from open file stream.

Returns
String or nil
Parameters
file-desc: open file stream descriptor.
(read-line f)
;; Returns line string
readImplemented
(read string)

Parses string representation of S-expressions into first LISP expression.

Returns
Varies
Parameters
string: string representation of S-expressions.
(read "(+ 1 2)")
;; Returns: (+ 1 2)
redrawImplemented
(redraw [ename [mode]])

Refreshes graphic screen or redraws individual entities.

Returns
nil
Parameters
ename: entity. mode: int style (1=Redraw, 2=Undraw, 3=Highlight, 4=Unhighlight).
(redraw (entlast) 3)
;; Highlights last entity
regappImplemented
(regapp application_name)

Registers unique application name key for extended entity data (xdata).

Returns
String or nil
Parameters
application_name: string application key.
(regapp "MY_APP")
;; Registers key in APPID table
remImplemented
(rem num1 num2)

Returns division remainder of the first number by the second.

Returns
Real or Integer
Parameters
num1: dividend. num2: divisor.
(rem 10 3)
;; Returns: 1
repeatImplemented
(repeat count [expr...])

Loops through S-expressions specified integer number of times.

Returns
Varies
Parameters
count: integer loop counter. expr: S-expressions inside loop.
(repeat 3 (princ "!"))
;; Prints "!!!"
reverseImplemented
(reverse list)

Reverses elements order in a list.

Returns
List
Parameters
list: standard list.
(reverse '(1 2 3))
;; Returns: (3 2 1)
rtosImplemented
(rtos number [mode [prec]])

Converts real floating-point numbers to formatted strings.

Returns
String
Parameters
number: real value. mode: units (1=Sci, 2=Dec, 3=Eng, 4=Arch, 5=Frac). prec: decimal count.
(rtos 12.5 2 2)
;; Returns: "12.50"
setImplemented
(set 'symbol expr)

Binds value to quoted symbol variable.

Returns
Varies
Parameters
symbol: quoted symbol variable. expr: S-expression value.
(set 'x 10)
;; Binds x to 10
setcfgImplemented
(setcfg section value)

Writes application config data to AppData of CFG files.

Returns
String or nil
Parameters
section: registry path string. value: string data value.
(setcfg "AppData/MyTool/Setting1" "On")
setenvImplemented
(setenv variable value)

Sets value of system environment variables.

Returns
String
Parameters
variable: environment key. value: string data value.
(setenv "ShowFullPath" "1")
setfunhelpImplemented
(setfunhelp command_name helpfile topic)

Binds command call keyword to Help documentation pages.

Returns
String or nil
Parameters
command_name: command symbol. helpfile: file. topic: target topic ID.
(setfunhelp "C:TEST" "myhelp.chm" "TEST_TOPIC")
setpropertyvalueImplemented
(setpropertyvalue ename property_name value)

Sets value of a property on a drawing entity.

Returns
Varies
Parameters
ename: Target entity. property_name: Target property string. value: updated value.
(setpropertyvalue (entlast) "Color" 1)
setqImplemented
(setq symbol1 value1 [symbol2 value2...])

Binds S-expression values to unquoted symbol variables.

Returns
Varies
Parameters
symbol: target variable name. value: S-expression value.
(setq a 10 b 20)
;; Returns: 20
setvarImplemented
(setvar name value)

Sets active value of an AutoCAD system variable.

Returns
Varies
Parameters
name: string system variable key. value: target value.
(setvar "FILEDIA" 1)
setviewImplemented
(setview view_name [viewport_id])

Establishes a view configuration for a specified viewport.

Returns
T or nil
Parameters
view_name: string view name key. viewport_id: target viewport index.
(setview "MyView")
showhtmlmodalwindowTier 2 · clean error
(showhtmlmodalwindow url [options])

Displays an HTML modal dialog window.

Returns
Varies
Parameters
url: target modal URI string. options: optional size window styles.
(showhtmlmodalwindow "http://google.com")
sinImplemented
(sin angle)

Computes the sine of an angle in radians.

Returns
Real
Parameters
angle: Radian angle.
(sin 1.570796)
;; Returns: 1.0
snvalidImplemented
(snvalid symbol_name)

Validates characters of symbol name (checks if valid in symbol tables).

Returns
T or nil
Parameters
symbol_name: string symbol name key.
(snvalid "NEW_LAYER")
;; Returns: T
sqrtImplemented
(sqrt num)

Computes the square root of a positive number.

Returns
Real
Parameters
num: Integer or Real value.
(sqrt 16)
;; Returns: 4.0
ssaddImplemented
(ssadd [ename [ss]])

Constructs a new selection set or appends entities to existing selection sets.

Returns
Pickset
Parameters
ename: optional entity ename. ss: optional target selection set.
(setq ss (ssadd))
ssdelImplemented
(ssdel ename ss)

Deletes specified entity from selection sets.

Returns
Pickset or nil
Parameters
ename: target entity ename. ss: target selection set.
(ssdel (entlast) ss)
ssgetImplemented
(ssget [mode][pt1 [pt2]][filter])

Constructs AutoCAD selection set grouping drawing entities based on rules/filters.

Returns
Pickset or nil
Parameters
mode: string type code. pt: coordinates. filter: DXF association filter list.
(ssget "X" '((0. "CIRCLE")))
;; Selects all Circle entities
ssgetfirstImplemented
(ssgetfirst)

Retrieves active gripped/preselected entities in drawing context.

Returns
List (of Selection Sets) or nil
Parameters
No arguments.
(ssgetfirst)
sslengthImplemented
(sslength ss)

Returns the size/length of a selection set.

Returns
Integer
Parameters
ss: active selection set.
(sslength ss)
;; Returns element count
ssmembImplemented
(ssmemb ename ss)

Checks if specified entity is in selection set.

Returns
Ename or nil
Parameters
ename: target entity. ss: active selection set.
(ssmemb (entlast) ss)
ssnameImplemented
(ssname ss index)

Retrieves entity name at target index inside selection set.

Returns
Ename or nil
Parameters
ss: active selection set. index: integer index.
(ssname ss 0)
;; Returns first entity in selection set
ssnamexImplemented
(ssnamex ss index)

Retrieves sub-method coordinates and details of how selection sets were created.

Returns
List or nil
Parameters
ss: active selection set. index: index of element.
(ssnamex ss 0)
sssetfirstImplemented
(sssetfirst gripped_ss [selected_ss])

Programmatically selects and grips drawing entities.

Returns
List
Parameters
gripped_ss: gripped set. selected_ss: selected set.
(sssetfirst nil ss)
startappImplemented
(startapp application [file])

Launches external operating system applications.

Returns
Integer or nil
Parameters
application: executable path string. file: optional file argument.
(startapp "notepad.exe" "C:/log.txt")
strcaseImplemented
(strcase string [which])

Returns copy of string converted to uppercase or lowercase.

Returns
String
Parameters
string: source text. which: if non-nil, converts to lowercase.
(strcase "Hello" T)
;; Returns: "hello"
strcatImplemented
(strcat string1 [string2...])

Concatenates multiple string arguments into a single string.

Returns
String
Parameters
string: text values to concatenate.
(strcat "A" " " "B")
;; Returns: "A B"
strlenImplemented
(strlen string)

Returns number of characters contained inside string.

Returns
Integer
Parameters
string: target text.
(strlen "Hello")
;; Returns: 5
substImplemented
(subst new old list)

Substitutes occurrences of old elements with new in list structures.

Returns
List
Parameters
new: replacement. old: target. list: standard list.
(subst 'x 'b '(a b c))
;; Returns: (a x c)
substrImplemented
(substr string start [length])

Extracts target substring of specified length.

Returns
String
Parameters
string: text. start: 1-indexed start pos. length: substring length.
(substr "HelloWorld" 1 5)
;; Returns: "Hello"
tabletTier 2 · clean error
(tablet code [row1 row2 row3 direction])

Configures and calibrates digitizing tablet parameters.

Returns
List or nil
Parameters
code: config code. row: calibration parameters.
(tablet 1)
tblnextImplemented
(tblnext table_name [rewind])

Retrieves next entry in specified AutoCAD symbol table.

Returns
List or nil
Parameters
table_name: table string (e.g. "LAYER"). rewind: if non-nil, resets pointer.
(tblnext "LAYER")
tblobjnameImplemented
(tblobjname table_name entry_name)

Gets entity pointer ename for symbol table entry.

Returns
Ename or nil
Parameters
table_name: table string. entry_name: entry string.
(tblobjname "LAYER" "0")
tblsearchImplemented
(tblsearch table_name entry_name [setnext])

Searches symbol table for entry matching keyword.

Returns
List or nil
Parameters
table_name: table string. entry_name: entry. setnext: if non-nil, sets pointer.
(tblsearch "LAYER" "0")
terpriImplemented
(terpri)

Prints a standard newline line break to command console.

Returns
nil
Parameters
No arguments.
(terpri)
textboxImplemented
(textbox elist)

Computes 2D coordinate bounds of text entity.

Returns
List (of Points) or nil
Parameters
elist: DXF association list of text entity.
(textbox (entget (entlast)))
textpageTier 2 · clean error
(textpage)

Clears command text screen and forces console display page refresh.

Returns
nil
Parameters
No arguments.
(textpage)
textscrImplemented
(textscr)

Activates and opens the AutoCAD text console window.

Returns
nil
Parameters
No arguments.
(textscr)
traceImplemented
(trace function...)

Activates function debugging trace.

Returns
Varies
Parameters
function: target custom function symbols.
(trace MyFunc)
transImplemented
(trans pt from to [disp])

Translates coordinates between coordinate systems (WCS, UCS, etc.).

Returns
List (3D Point)
Parameters
pt: coordinates. from/to: system codes or ename. disp: non-nil treats pt as displacement vector.
(trans '(1 2 0) 1 0)
;; Translates UCS to WCS
typeImplemented
(type item)

Returns active LISP data type identifier atom.

Returns
Symbol or nil
Parameters
item: S-expression to check.
(type 10)
;; Returns: INT
(type "A")
;; Returns: STR
untraceImplemented
(untrace function...)

Deactivates function debugging trace.

Returns
Varies
Parameters
function: Custom function symbols.
(untrace MyFunc)
verImplemented
(ver)

Returns active AutoLISP version string details.

Returns
String
Parameters
No arguments.
(ver)
;; Returns: "Visual LISP v1.6"
vl-acad-defunImplemented
(vl-acad-defun symbol)

Exports a custom LISP function symbol as external subroutine for ObjectARX.

Returns
Symbol
Parameters
symbol: quoted function symbol.
(vl-acad-defun 'MyFunc)
vl-acad-undefunImplemented
(vl-acad-undefun symbol)

Hides/undefines LISP function symbol from ObjectARX applications.

Returns
Symbol
Parameters
symbol: quoted function symbol.
(vl-acad-undefun 'MyFunc)
vl-arx-importTier 2 · clean error
(vl-arx-import [function])

Imports ObjectARX/ADSRX functions into Separate-Namespace LISP VLX modules.

Returns
T or nil
Parameters
function: optional quoted function name.
(vl-arx-import 'ads_cmd)
vl-bb-refImplemented
(vl-bb-ref 'symbol)

Retrieves value of variables from blackboard global namespace.

Returns
Varies
Parameters
symbol: quoted symbol variable name.
(vl-bb-ref 'factor)
vl-bb-setImplemented
(vl-bb-set 'symbol value)

Writes variable values to blackboard global namespace.

Returns
Varies
Parameters
symbol: quoted symbol variable. value: S-expression value.
(vl-bb-set 'factor 1.5)
vl-catch-all-applyImplemented
(vl-catch-all-apply function list)

Evaluates function arguments trapping exceptions.

Returns
Varies or error object
Parameters
function: subroutine. list: arguments.
(vl-catch-all-apply '/ '(10 0))
;; Returns: #<%catch-all-apply-error%>
vl-catch-all-error-messageImplemented
(vl-catch-all-error-message err)

Extracts descriptive error string from trapped exception objects.

Returns
String
Parameters
err: trapped error object.
(setq err (vl-catch-all-apply '/ '(10 0)))
(vl-catch-all-error-message err)
;; Returns: "divide by zero"
vl-catch-all-error-pImplemented
(vl-catch-all-error-p arg)

Checks if argument is catch-all error object.

Returns
T or nil
Parameters
arg: S-expression.
(vl-catch-all-error-p err)
;; Returns: T
vl-cmdfImplemented
(vl-cmdf [arguments...])

Synchronously executes command pipeline validating parameters in advance.

Returns
T or nil
Parameters
arguments: command name and inputs.
(vl-cmdf "_LINE" '(0 0) '(5 5) "")
vl-conspImplemented
(vl-consp list)

Checks if the specified list is non-empty.

Returns
T or nil
Parameters
list: S-expression.
(vl-consp '(1 2))
;; Returns: T
(vl-consp nil)
;; Returns: nil
vl-directory-filesImplemented
(vl-directory-files [path [pattern [dirs]]])

Returns files list inside specified path.

Returns
List (of Strings) or nil
Parameters
path: directory. pattern: file wildcard. dirs: -1=dirs, 0=both, 1=files.
(vl-directory-files "C:/" "*.lsp" 1)
vl-doc-exportImplemented
(vl-doc-export 'symbol)

Exports function from Separate-Namespace VLX to active drawing namespace.

Returns
nil
Parameters
symbol: quoted symbol variable.
(vl-doc-export 'MyFunc)
vl-doc-importImplemented
(vl-doc-import 'symbol)

Imports exported functions into Separate-Namespace LISP VLX namespace.

Returns
nil
Parameters
symbol: quoted symbol variable.
(vl-doc-import 'MyFunc)
vl-doc-refImplemented
(vl-doc-ref 'symbol)

Reads variable values from active drawing document namespace.

Returns
Varies
Parameters
symbol: quoted symbol variable.
(vl-doc-ref 'factor)
vl-doc-setImplemented
(vl-doc-set 'symbol value)

Writes variable values to active drawing document namespace.

Returns
Varies
Parameters
symbol: quoted symbol. value: target value.
(vl-doc-set 'factor 1.5)
vl-everyImplemented
(vl-every predicate list1 [list2...])

Checks if predicate resolves non-nil for all list elements.

Returns
T or nil
Parameters
predicate: subroutine. list: standard lists.
(vl-every '= '(1 2) '(1 2))
;; Returns: T
vl-exit-with-errorImplemented
(vl-exit-with-error string)

Aborts execution context passing custom error text to parent namespace *error*.

Returns
nil
Parameters
string: error message.
(vl-exit-with-error "Fatal Error!")
vl-exit-with-valueImplemented
(vl-exit-with-value value)

Aborts execution returning custom value to parent invoker context.

Returns
Varies
Parameters
value: execution return value.
(vl-exit-with-value 100)
vl-file-copyImplemented
(vl-file-copy src dest [append])

Copies or appends files.

Returns
Integer or nil
Parameters
src: source. dest: target. append: if non-nil, appends instead of overwriting.
(vl-file-copy "C:/a.txt" "C:/b.txt")
vl-file-deleteImplemented
(vl-file-delete filename)

Deletes specified file from directory paths.

Returns
T or nil
Parameters
filename: file path string.
(vl-file-delete "C:/temp.txt")
vl-file-directory-pImplemented
(vl-file-directory-p filename)

Checks if the specified path points to active directory.

Returns
T or nil
Parameters
filename: path string.
(vl-file-directory-p "C:/Windows")
;; Returns: T
vl-file-renameImplemented
(vl-file-rename old new)

Renames specified file.

Returns
T or nil
Parameters
old, new: file path strings.
(vl-file-rename "a.txt" "b.txt")
vl-file-sizeImplemented
(vl-file-size filename)

Retrieves file size in bytes.

Returns
Integer or nil
Parameters
filename: path string.
(vl-file-size "C:/boot.ini")
vl-file-systimeImplemented
(vl-file-systime filename)

Retrieves file last-modified system time details.

Returns
List (of integers) or nil
Parameters
filename: path string.
(vl-file-systime "C:/boot.ini")
vl-filename-baseImplemented
(vl-filename-base filename)

Strips path and extension returning filename root base name.

Returns
String
Parameters
filename: path string.
(vl-filename-base "C:/temp/draw.lsp")
;; Returns: "draw"
vl-filename-directoryImplemented
(vl-filename-directory filename)

Strips base name and extension returning directory path.

Returns
String
Parameters
filename: path string.
(vl-filename-directory "C:/temp/draw.lsp")
;; Returns: "C:/temp"
vl-filename-extensionImplemented
(vl-filename-extension filename)

Returns filename extension portion.

Returns
String
Parameters
filename: path string.
(vl-filename-extension "draw.lsp")
;; Returns: ".lsp"
vl-filename-mktempImplemented
(vl-filename-mktemp [pattern [dir [ext]]])

Generates unique temp file path.

Returns
String
Parameters
pattern: name structure. dir: folder. ext: target extension.
(vl-filename-mktemp "test" nil ".txt")
vl-list*Implemented
(vl-list* object [object...])

Constructs lists, wrapping final argument into S-expression cdr.

Returns
List or Dotted Pair
Parameters
object: LISP elements.
(vl-list* 1 2 3)
;; Returns: (1 2. 3)
vl-list->stringImplemented
(vl-list->string list)

Combines list of integer ASCII/Unicode values into text string.

Returns
String
Parameters
list: integer Unicode characters list.
(vl-list->string '(72 101 108 108 111))
;; Returns: "Hello"
vl-list-lengthImplemented
(vl-list-length list)

Retrieves length of true flat lists.

Returns
Integer or nil
Parameters
list: S-expression.
(vl-list-length '(1 2 3))
;; Returns: 3
vl-list-loaded-vlxTier 2 · clean error
(vl-list-loaded-vlx)

Lists all separate-namespace VLX files associated with active document context.

Returns
List (of Strings)
Parameters
No arguments.
(vl-list-loaded-vlx)
vl-load-allTier 2 · clean error
(vl-load-all filename)

Loads LISP files into all active and future drawing documents namespaces.

Returns
nil
Parameters
filename: LISP file path string.
(vl-load-all "utils.lsp")
vl-member-ifImplemented
(vl-member-if predicate list)

Checks if elements in list satisfy predicate subroutine, returning remaining list slice.

Returns
List or nil
Parameters
predicate: subroutine. list: standard list.
(vl-member-if 'minusp '(1 2 -3 4))
;; Returns: (-3 4)
vl-member-if-notImplemented
(vl-member-if-not predicate list)

Checks if elements in list do not satisfy predicate subroutine.

Returns
List or nil
Parameters
predicate: subroutine. list: standard list.
(vl-member-if-not 'minusp '(-1 -2 3 4))
;; Returns: (3 4)
vl-mkdirImplemented
(vl-mkdir directory)

Creates new directory paths on disk.

Returns
T or nil
Parameters
directory: path name string.
(vl-mkdir "C:/NewFolder")
vl-positionImplemented
(vl-position symbol list)

Retrieves index position of symbol inside flat list.

Returns
Integer or nil
Parameters
symbol: element. list: standard flat list.
(vl-position "b" '("a" "b" "c"))
;; Returns: 1
vl-prin1-to-stringImplemented
(vl-prin1-to-string item)

Formats LISP elements as escaped printed string representations.

Returns
String
Parameters
item: S-expression value.
(vl-prin1-to-string "Hello")
;; Returns: "\"Hello\""
vl-princ-to-stringImplemented
(vl-princ-to-string item)

Formats LISP elements as unescaped printed string representations.

Returns
String
Parameters
item: S-expression value.
(vl-princ-to-string "Hello")
;; Returns: "Hello"
vl-propagateImplemented
(vl-propagate 'symbol)

Copies variable values across all active document namespaces.

Returns
nil
Parameters
symbol: quoted variable symbol name.
(vl-propagate 'scale_factor)
vl-registry-deleteImplemented
(vl-registry-delete path [value])

Deletes keys or values from Windows Registry or Mac plist files.

Returns
T or nil
Parameters
path: key path string. value: optional value name to delete.
(vl-registry-delete "HKEY_CURRENT_USER\\Software\\MyApp")
vl-registry-descendentsImplemented
(vl-registry-descendents key)

Lists registry subkeys/values.

Returns
List (of Strings)
Parameters
key: key path string.
(vl-registry-descendents "HKEY_CURRENT_USER\\Software")
vl-registry-readImplemented
(vl-registry-read key [value])

Reads values from Windows Registry or Mac plist files.

Returns
String or nil
Parameters
key: key path string. value: value name.
(vl-registry-read "HKEY_CURRENT_USER\\Software\\MyApp" "Path")
vl-registry-writeImplemented
(vl-registry-write key [value data])

Writes values to Windows Registry or Mac plist files.

Returns
String or nil
Parameters
key: key path. value: value name. data: string value.
(vl-registry-write "HKEY_CURRENT_USER\\Software\\MyApp" "Path" "C:/App")
vl-removeImplemented
(vl-remove element list)

Removes element occurrences from a list.

Returns
List
Parameters
element: target item. list: standard list.
(vl-remove 2 '(1 2 3 2 4))
;; Returns: (1 3 4)
vl-remove-ifImplemented
(vl-remove-if predicate list)

Removes elements from a list passing predicate filter tests.

Returns
List
Parameters
predicate: subroutine. list: standard list.
(vl-remove-if 'minusp '(1 -2 3 -4))
;; Returns: (1 3)
vl-remove-if-notImplemented
(vl-remove-if-not predicate list)

Keeps elements from a list passing predicate filter tests.

Returns
List
Parameters
predicate: subroutine. list: standard list.
(vl-remove-if-not 'minusp '(1 -2 3 -4))
;; Returns: (-2 -4)
vl-someImplemented
(vl-some predicate list1 [list2...])

Checks if predicate holds true for at least one list element combination.

Returns
Varies
Parameters
predicate: subroutine. list: standard lists.
(vl-some 'minusp '(1 2 -3 4))
;; Returns: T
vl-sortImplemented
(vl-sort list comparison_function)

Sorts list elements based on comparison subroutines (note: removes duplicates).

Returns
List
Parameters
list: standard list. comparison_function: comparison subroutine.
(vl-sort '(3 1 2 3) '<)
;; Returns: (1 2 3)
vl-sort-iImplemented
(vl-sort-i list comparison_function)

Sorts list elements returning indices mapping order.

Returns
List (of Integers)
Parameters
list: standard list. comparison_function: comparison subroutine.
(vl-sort-i '(10 30 20) '<)
;; Returns: (0 2 1)
vl-string->listImplemented
(vl-string->list string)

Converts text characters into Unicode value list.

Returns
List (of Integers)
Parameters
string: target text.
(vl-string->list "ABC")
;; Returns: (65 66 67)
vl-string-eltImplemented
(vl-string-elt string index)

Retrieves Unicode character code at specified string index.

Returns
Integer
Parameters
string: target text. index: 0-indexed position integer.
(vl-string-elt "ABC" 1)
;; Returns: 66
vl-string-left-trimImplemented
(vl-string-left-trim characters string)

Trims matching leading characters from string.

Returns
String
Parameters
characters: match set string. string: target text.
(vl-string-left-trim "_" "___Hello")
;; Returns: "Hello"
vl-string-mismatchImplemented
(vl-string-mismatch str1 str2)

Finds index of first character mismatch position between strings.

Returns
Integer
Parameters
str1, str2: comparison strings.
(vl-string-mismatch "Hello" "Help")
;; Returns: 3
vl-string-positionImplemented
(vl-string-position char string)

Finds index position of character in string.

Returns
Integer or nil
Parameters
char: character Unicode integer. string: target text.
(vl-string-position 66 "ABC")
;; Returns: 1
vl-string-right-trimImplemented
(vl-string-right-trim characters string)

Trims matching trailing characters from string.

Returns
String
Parameters
characters: match set string. string: target text.
(vl-string-right-trim "_" "Hello___")
;; Returns: "Hello"
vl-string-searchImplemented
(vl-string-search pattern string [start])

Searches text matching substring pattern.

Returns
Integer or nil
Parameters
pattern: search string. string: target text. start: starting pos.
(vl-string-search "world" "Hello world")
;; Returns: 6
vl-string-substImplemented
(vl-string-subst new old string [start])

Substitutes first occurrence of old substring with new.

Returns
String
Parameters
new: replacement. old: target. string: text. start: starting pos.
(vl-string-subst "a" "o" "Hello world")
;; Returns: "Hella world"
vl-string-translateImplemented
(vl-string-translate source target string)

Translates characters based on maps.

Returns
String
Parameters
source: lookup. target: replacement. string: target text.
(vl-string-translate "abc" "123" "cabin")
;; Returns: "31bin"
vl-string-trimImplemented
(vl-string-trim characters string)

Trims leading and trailing matching characters from string.

Returns
String
Parameters
characters: match set string. string: target text.
(vl-string-trim "_" "__Hello__")
;; Returns: "Hello"
vl-symbol-nameImplemented
(vl-symbol-name symbol)

Returns string name of symbol.

Returns
String
Parameters
symbol: target variable symbol.
(vl-symbol-name 'factor)
;; Returns: "FACTOR"
vl-symbol-valueImplemented
(vl-symbol-value symbol)

Retrieves value bound to specified symbol.

Returns
Varies
Parameters
symbol: target variable symbol.
(setq x 10)
(vl-symbol-value 'x)
;; Returns: 10
vl-symbolpImplemented
(vl-symbolp item)

Checks if S-expression is a symbol.

Returns
T or nil
Parameters
item: S-expression.
(vl-symbolp 'x)
;; Returns: T
vl-unload-vlxTier 2 · clean error
(vl-unload-vlx vlx-name)

Unloads Separate-Namespace VLX applications.

Returns
nil
Parameters
vlx-name: string application name.
(vl-unload-vlx "my_app")
vl-vbaloadTier 2 · clean error
(vl-vbaload filename)

Loads VBA project files.

Returns
nil
Parameters
filename: VBA project file path.
(vl-vbaload "C:/proj.dvb")
vl-vbarunTier 2 · clean error
(vl-vbarun macro)

Runs specified VBA macro.

Returns
nil
Parameters
macro: string macro name.
(vl-vbarun "MyMacro")
vl-vlx-loaded-pTier 2 · clean error
(vl-vlx-loaded-p vlx-name)

Checks if Separate-Namespace VLX is loaded.

Returns
T or nil
Parameters
vlx-name: string application name.
(vl-vlx-loaded-p "my_app")
vportsImplemented
(vports)

Returns active viewport configuration list.

Returns
List (of viewport descriptors)
Parameters
No arguments.
(vports)
wcmatchImplemented
(wcmatch string pattern)

Checks if a string matches wildcard pattern.

Returns
T or nil
Parameters
string: source text. pattern: wildcard pattern (supports *,?, #, etc.).
(wcmatch "test.dwg" "*.dwg")
;; Returns: T
whileImplemented
(while test [expr...])

Evaluates expressions inside a loop as long as test is non-nil.

Returns
Varies
Parameters
test: conditional test. expr: loop execution expressions.
(setq i 0)
(while (< i 3)
  (princ i)
  (setq i (1+ i))
)
;; Prints "012"
write-charImplemented
(write-char char [file-desc])

Writes single character code to file stream.

Returns
Integer
Parameters
char: character code. file-desc: open file descriptor.
(write-char 65 f)
write-lineImplemented
(write-line string [file-desc])

Writes a line of text to file stream.

Returns
String
Parameters
string: line text. file-desc: open file descriptor.
(write-line "Log Entry" f)
xdroomImplemented
(xdroom ename)

Checks amount of available xdata memory space on drawing entity.

Returns
Integer
Parameters
ename: target entity.
(xdroom (entlast))
xdsizeImplemented
(xdsize list)

Calculates size in bytes of specified xdata list.

Returns
Integer
Parameters
list: extended data list.
(xdsize '((1001. "MY_APP") (1000. "DATA")))
zeropImplemented
(zerop num)

Checks if numeric S-expression evaluates to zero.

Returns
T or nil
Parameters
num: Integer or Real value.
(zerop 0.0)
;; Returns: T
(zerop 5)
;; Returns: nil
Note: Tier‑2 entries (DCL dialogs, reactors, ActiveX/VLAX automation, ARX/VLX/VBA application loading) parse and report a clean “not yet supported” error instead of failing silently, so scripts that probe for them behave predictably.