(defun C:ANG ()
(SETVAR "ORTHOMODE" 0)
;(SETVAR "APERTURE" 3)
;(IF (= (TYPE F1) 'FILE ) "YES"  (STOP))
;(IF (= (TYPE F2) 'FILE ) "YES" (STOP))
(SETVAR "OSMODE" 512)
(SETQ W1 (ENTSEL "\nSelect line:"))
;(SETVAR "APERTURE" 4)
(SETVAR "OSMODE" 0)
(SETQ W2 (ENTGET (CAR W1 )))
(SETQ WW (CADR W1))
(SETQ P1 (ASSOC 10 W2 ))
(SETQ P2 (ASSOC 11 W2 ))
(SETQ ANGL (ANGLE (CDR P1) (CDR P2)))
(SETQ ANG1 (RTD ANGL))
(SETQ ANG2 ANG1)
(IF (AND (> ANG1 90) (<= ANG1 180)) (SETQ ANG1 (- ANG1 90)))
(IF (AND (> ANG1 180) (<= ANG1 270)) (SETQ ANG1 (- ANG1 180)))
(IF (AND (> ANG1 270) (<= ANG1 360)) (SETQ ANG1 (- ANG1 270)))
(IF (> ANG1 45) (SETQ ANG1 (- 90 ANG1)))
(SETQ ANGL (DTR ANG1))
(setq angls (angtos angl 1))
(SETQ I 1)
(REPEAT 4
     (IF (= (SUBSTR ANGLS I 1) "d")
         (SETQ ANGLT (STRCAT (SUBSTR ANGLS 1 (- I 1)) "%%d"
                             (SUBSTR ANGLS (+ I 1) (- (STRLEN ANGLS) I)))
         ))
     (SETQ I (+ I 1))
)
(MENUCMD "S=NUMBER")
(SETQ W4 (GETSTRING "\nSelect number or RETURN for none:"))
(IF (= W4 "")
     (COMMAND "DIM" "LEADER" ww pause "" anglt EXIT)
     (COMMAND "DIM" "LEADER" ww pause "" (STRCAT W4 "-" anglt) EXIT))
(COMMAND "SETVAR" "HIGHLIGHT" "1")
)
