bartdewilde Posted June 18, 2009 Posted June 18, 2009 hello is there in Visual LISP for AutoCAD something as an array variabele ? like: (defun (setq x 1) (while T (setq pt[x] (getpoint "\nPlease pick a point")) (setq x (+ x 1) ) so if you pick a point, it's stored in pt1 you pick another point it's stored in pt2 etc... etc... and if not is there an easy way to reach this? Quote
rkmcswain Posted June 18, 2009 Posted June 18, 2009 You can use a list to hold a collection of items. ;;; Example (setq mylist '()) (while T (setq pt (getpoint "\nPlease pick a point")) (setq mylist (cons pt mylist)) ) Quote
Freerefill Posted June 18, 2009 Posted June 18, 2009 Using that method, you can obtain each point by using: (nth [i]loc list[/i]) Where "loc" is the position of the item in the list (remember, the first item is 0, the second is 1, and so on) and "list" is any valid list. There is a way of creating variables on-the-fly, so that you can actually access them as pt1, pt2, and so on, rather than building a list and accessing them from the list, but if you want a list of points, that method wouldn't be any good. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.