Share

vl-position (AutoLISP)

Product Documentation
Intermediate

Returns the index of the specified list item

(vl-position symbol list)

Arguments

symbol

Any AutoLISP symbol.

list

A true list.

Return Values

An integer containing the index position of symbol in list; otherwise nil if symbol does not exist in the list.

Note that the first list element is index 0, the second element is index 1, and so on.

Examples

(setq stuff (list "a" "b" "c" "d" "e"))
("a" "b" "c" "d" "e")

(vl-position "c" stuff)
2

Was this information helpful?