AutoLisp Working with Coordinate Points

Jul 09, 2009 2 Replies

Hi all



Using lisp, how do I break down the list of x, y and z coordinates given as the centre of a circle? I have isolated the list with (setq cen-pt (cdr (assoc 10 b))) which gives (168.077 168.62 0.0), but I can't remember how to extract the x, y and z elements?



Long-long-time since I looked at this stuff :)


TIA



Phil


"TheScullster" wrote

OK so I have managed to answer the first part of my own question. After much head scratching, using car, cadr and caddr returns the values required. BUT I am still not clear on how to re-use modified values to construct the start point of a line. ie how do I use my captured variables to create a starting point for a line of the form (x, y, z)

TIA

Phil

You could put the elements back together, but if you have cen-pt equaling (168.077 168.62 0.0), can't you just use that? You'll still need to define the second point, for instance:

(setq pt2 (list 1.00 2.00 0.0))

(command "._line" cen-pt pt2 "")

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required