cadr
 
 
 

Returns the second element of a list

(cadr list)

In AutoLISP, cadr is frequently used to obtain the Y coordinate of a 2D or 3D point (the second element of a list of two or three reals).

Arguments

list

A list.

Return Values

The second element in list; otherwise nil, if the list is empty or contains only one element.

Examples

Command: (setq pt2 '(5.25 1.0))

(5.25 1.0)

Command: (cadr pt2)

1.0

Command: (cadr '(4.0))

nil

Command: (cadr '(5.25 1.0 3.0))

1.0

See Also