caddr (AutoLISP)

 
 
 

Returns the third element of a list

Supported Platforms: Windows and Mac OS

Signature

(caddr list)
list

Type: List

A list with three or more elements.

Return Values

Type: Integer, Real, String, List, T or nil

The third element in list; otherwise nil, if the list is empty or contains fewer than three elements.

Remarks

In AutoLISP, caddr is frequently used to obtain the Z coordinate of a 3D point (the third element of a list of three reals).

Examples

(setq pt3 '(5.25 1.0 3.0))
(5.25 1.0 3.0)

(caddr pt3)
3.0

(caddr '(5.25 1.0))
nil