CADLisp Tools

User input

(getpoint)

Pause for the user to pick a point or type coordinates.

What it does

getpoint asks the user for a coordinate. The result is normally a list of two or three real numbers, or nil when the operation is cancelled.

Simple example

(setq p1 (getpoint "\nPick a point: "))

Practical CAD example

Use a first point as the base for a second:

(setq p1 (getpoint "\nFirst point: "))
(if p1 (setq p2 (getpoint p1 "\nSecond point: ")))

Common mistakes

  • Using the result without checking for nil.
  • Mixing points expressed in different coordinate systems.
  • Assuming every returned point contains a Z value.