Hi everyone, (my first post)
I have a simple bit of code that is supposed to allow multiple user selected points, put them in a list and then set a variable to the last element in that list. What is puzzling me is that the code works as long as I leave out the line command, which is essential for the purpose of the routine. As soon as I add the line command, so the user can see where they are putting the line, pt2, which should be the last element in the list, becomes pt, the first element in the list. Here is the code:
(defun c:pointlist (/)
(setq ptlist nil)
(while
(setq pt (getpoint "\nPick Point: "))
(command-s ".line" pt)
(setq ptlist (append ptlist (list pt)))
)
(setq pt2 (last ptlist))
(command-s ".line" pt2)
) [code\]
I'm sure there is something simple that I'm missing here. I would appreciate any help to point me in the right direction.
Thank you,
Russ Parker