dhl Posted November 4, 2009 Posted November 4, 2009 I'm trying to find the smoothest way of using (ssget "wp" ptlist) I want it to be as similar to (command "select" "wp") as possible. (perhaps its possible to extract a ptlist from select wp?) Which is the best way? draw a polyline? Quote
JohnM Posted November 4, 2009 Posted November 4, 2009 ;;;**************** example 1*********** (setq ptlst '()) (setq pts 1) (while pts (setq pts(getpoint "\nSelect Point: ")) (if pts (setq ptlst (cons pts ptlst))) );_while (if pts (setq ss(ssget "_WP" ptlst))) ;;;***********example 2 (command "select" "WP") (setq ss (ssget "_P")) Quote
gile Posted November 4, 2009 Posted November 4, 2009 John, you can make it a little more concise: (while (setq pt (getpoint pt "\nSpecify a point:")) (setq ptlst (cons pt ptlst)) ) (if ptlst (setq ss (ssget "_WP" ptlst)) ) another way more "graphical" (defun c:sswp (/ pt ptlst ss) (if (setq pt (getpoint "\nSpecify a point:")) (progn (setq ptlst (list pt)) (while (setq pt (getpoint pt "\nSpecify a point:")) (redraw) (setq ptlst (cons pt ptlst)) (grvecs (apply 'append (mapcar 'list ptlst (cdr ptlst)))) ) (setq ss (ssget "_WP" ptlst)) (redraw) (sssetfirst nil ss) ) ) (princ) ) 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.