;-----------------------------------------
; Winkel zwischen zwei Linien 30.6.91 AW
; eingebaut in c12d1
;----------------------------------------
(Defun C:WINKEL ()
  (Setvar "Cmdecho" 0)
  (Setq A (Entsel "\nErste Linie: "))
  (If
    A
      (Progn
        (Setq B (Entget (Car A)))
        (If
          (= "LINE" (Cdr (Assoc 0 B)))
            (Progn
              (Setq C (Entsel "\nZweite Linie: "))
              (If
                C
                  (Progn
                    (Setq D (Entget (Car C)))
                    (If
                      (= "LINE" (Cdr (Assoc 0 D)))
                        (Progn
                          (Setq P1 (Osnap (Cadr A) "MIT"))
                          (Setq P2 (Osnap (Cadr C) "MIT"))
                          (Setq P3 (Inters (Cdr (Assoc 10 B))
                                           (Cdr (Assoc 11 B))
                                           (Cdr (Assoc 10 D))
                                           (Cdr (Assoc 11 D))
                                           ONSEG
                                   )
                          )
                          (Setq ANG (- (Angle P3 P2) (Angle P3 P1)))
                          (Setq ANG (Angtos ANG (Getvar "Aunits") 
                                                (Getvar "Auprec")))
                          (Princ (Strcat "\nEingeschlossener Winkel: " ANG))
                        )
                        (Princ "\nObjekt ist keine Linie!")
                    )
                  )
                  (Princ "\nKein Objekt gefunden!")
              )
            )
            (Princ "\nObjekt ist keine Linie!")
        )
      )
      (Princ "\nKein Objekt gefunden!")
  )
  (Princ)
)
