caddr

AutoCad AutoLISP Functions

 
caddr
 
 
 

Returns the third element of a list

(caddr list)

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

Arguments

list

A list.

Return Values

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

Examples

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

(5.25 1.0 3.0)

Command: (caddr pt3)

3.0

Command: (caddr '(5.25 1.0))

nil

See Also
    • The Point Lists topic in the AutoLISP Developer's Guide.