i have this lisp and i want to be able to make it loop, how do i fix it so it will loop?
Code:
; COORD.LSP-Place a north/east/elevation coordinate label at given location
; USAGE:
;
; Command: (load "COORD") [ENTER]
; C:COORD
;
; Command: COORD [ENTER]
; COORD
; Indicate point to define: <select point>
; Starting point for label: <select point>
; Indicate point to define: [ENTER] <=- [ENTER] at this prompt ends COORD
(defun c:crd ( / dimsc N E Z p1 p2 p3 p4 p5 p6)
(setvar "cmdecho" 0)
(setq dimsc (getvar "dimscale"))
(setq p1 (getpoint "\nIndicate point to define: "))
(setq p2 (getpoint "\nStarting point for label: "))
(setq p3 (polar p2 0.785390 (* 0.05 dimsc)))
(setq p4 (polar p2 5.03414 (* 0.15811 dimsc)))
(setq p6 (polar p2 11.1630 (* 0.30000 dimsc)))
(setq e (rtos (car p1)))
(setq n (rtos (cadr p1)))
(setq p5 (polar p2 0 (* (+ 1.5 (max (strlen e)(strlen n)))(* 0.12 dimsc))))
(command "text" p3 (* dimsc 0.12) "0" (strcat "N " n))
(command "text" p4 (* dimsc 0.12) "0" (strcat "E " e))
(command "line" p1 p2 p5 "")
(if (and (> (angle p1 p2) 1.5708)
(< (angle p1 p2) 4.71239)
)
(command "move" "c" p3 p4 "r" p1 "" p5 p2)
)
(setvar "cmdecho" 1)
(princ)