Home Products E-Store Services Partners Company

List Manipulation with LISP

In this article we will discuss how to process the List in Lisp. As you are probably well aware, LISP stands for "List Processing".

A list is a group of elements consisting of any data type and is stored as a single variable. A list can contain any number of Reals, Integers, Strings, Variables and even other Lists. Let's have a look at a list. Type this :

(setq pt1 (getpoint "\nChoose a Point : "))

AutoLisp should return something like this : (127.34 35.23 0.0)

Now what do I do with the list? AutoLisp has many functions available to manipulate lists. Let's have a look at them.

Car

The primary command for taking a list apart is the "Car" function. This function returns the first element of a list. (The x coordinate.)

For example :

(setq a (car pt1))

CADopia 2008 All Rights Reserved.
Home | Products | E-Store | Services | Partners | Company
Request an Eval CD
This offer is valid for Australia, Canada, India, Singapore, UK and USA addresses only.
E-Store
Contact sales@cadopia.com for more details.