Message 1 of 9
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying create an exit for while in gpts without resorting to esc creating the error: bad arguement type: point: nil. Searching and reading about exiting while I'm here with my code but I still dont have an exit method and any input seems to continue gpts.
;Shorten pline start and end points by set value (defun c:cl (/ cont pt1 pt2 d1 npt1 npt2 a1) (setq cont "Y") (while (= cont "Y") (gpts) )
) (defun gpts () (while (setq pt1 (getpoint "\nPick first point: ") pt2 (getpoint pt1 "\nPick second point: ")) (if (> (setq d1 (distance pt1 pt2)) 0.15) (progn (setq npt1 (polar pt1 (setq a1 (angle pt1 pt2)) (+ 0.05))) (setq npt2 (polar pt1 (setq a1 (angle pt1 pt2)) (- d1 0.05))) (command "_pline" npt1 npt2 "") ) ) (initget "Y N") (setq cont (getkword "n\Get more points? Y/N <Y>: ")) ) )
Solved! Go to Solution.