WPerciful Posted October 30, 2013 Posted October 30, 2013 I was making a centerline tool acts kind of like a polyline. The routine will continue to call itself until it no longer gets a value for the getpoint. But that doesn’t exit cleanly. Please help! (defun clin ( point / pt1 pt2 ) (if (/= point nil) (if (= (vl-symbol-name (type point)) "LIST") (progn (setq pt1 point pt2 (getpoint "\nSpecify next point: " pt1) ) (command "line" pt1 pt2 "") (clin pt2) ) ) (princ) ) (princ) ) Quote
Lee Mac Posted October 30, 2013 Posted October 30, 2013 (defun clin ( pt1 / pt2 ) (if (and pt1 (setq pt2 (getpoint "\nSpecify next point: " pt1))) (progn (command "_.line" "_non" pt1 "_non" pt2 "") (clin pt2) ) ) (princ) ) (clin (getpoint "\nSpecify first point: ")) Quote
Lee Mac Posted October 30, 2013 Posted October 30, 2013 Or, iteratively: (defun clin ( pt1 / pt2 ) (while (and pt1 (setq pt2 (getpoint "\nSpecify next point: " pt1))) (command "_.line" "_non" pt1 "_non" pt2 "") (setq pt1 pt2) ) (princ) ) (clin (getpoint "\nSpecify first point: ")) Quote
WPerciful Posted October 30, 2013 Author Posted October 30, 2013 Works GREAT! Thank you sir! Awesome as always! 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.