Retrieving elements from Lists
Posted: Fri Jan 18, 2002 3:42 pm
I have written an autolisp program where i generate a list of points that i would like to connect with the SPLINE command. The problem I am having is that I have been only able to get the spline command to recognize the first element of the list automatically. Following is the basic code:
<BLOCKQUOTE><font size="1" face="Verdana, Arial">code:</font><HR><pre>
(repeat 5
(setq pt2 (getpoint ("\n enter point")))
(setq l1 (append l1 (list pt2)))
)
(command "spline" (car l1))
</pre><HR></BLOCKQUOTE>
As you can see above, this routine will get me the first point in the list l1, however, if I try to loop to get futher points in the list, I am not able to get further in. Does anyone know how to go about this process? Thanks!
Tom
<BLOCKQUOTE><font size="1" face="Verdana, Arial">code:</font><HR><pre>
(repeat 5
(setq pt2 (getpoint ("\n enter point")))
(setq l1 (append l1 (list pt2)))
)
(command "spline" (car l1))
</pre><HR></BLOCKQUOTE>
As you can see above, this routine will get me the first point in the list l1, however, if I try to loop to get futher points in the list, I am not able to get further in. Does anyone know how to go about this process? Thanks!
Tom