Function Entry: GETDIST
← Prev | ↑ Chapter | Next → | Index | Symbols
Function Entry: GETDIST
Name
getdist
Class
Function
Syntax
(getdist [pt] [msg])
Arguments and Values
pt: optional base pointmsg: optional prompt string
Autodesk documents pt as a 2D or 3D base point in the current UCS.
Description
Prompts the user to specify a distance.
Return Values
Real or nil.
Side Effects
- prompts the user
- consumes interactive input
Affected By
- current distance/unit conventions
- optional base point
Compatibility
Part of the standard user-input family.
Availability
- AutoCAD 2026: documented (per Autodesk reference page).
- BricsCAD V26: presumed compatible (no contradicting page found).
- Status: AutoCAD documented; BricsCAD presumed-both pending Phase 4 verification.
Source Notes
Notes
- Autodesk documents that if a 3D point is provided, the result is a 3D distance unless
initgetbit 64 is set, in which case Z is ignored and a 2D distance is returned. - Autodesk documents that the user cannot respond with another AutoLISP expression.
- Autodesk documents that the result is always a real, even when the user enters values in architectural units.
clautolisp
clautolisp implementation deviation — not part of the normative
specification above. AutoCAD and BricsCAD collect this distance through
the graphical drawing editor: a command-line prompt combined with
pointer/keyboard interaction in the drawing window (implicitly a GUI).
clautolisp has no drawing editor — it writes the prompt to the standard
output and reads the answer as one line of text from the standard input
(a TUI interaction). Interactively this is the REPL's terminal; for
scripted, deterministic runs it is the file attached with --mock-input.
A live CAD host, when connected, restores the native GUI behavior. On the
TUI a distance is typed as a single real number; picking two points is
not available. Invalid input returns nil rather than re-prompting.