;--------------------------------
; Change Linelength 30.6.91 AW
;-------------------------------
(Defun C:LAENAEND ()
  (Setvar "Cmdecho" 0)
  (Setq OM (Getvar "Orthomode"))
  (Setvar "Orthomode" 0)
  (Setq A (Entsel "\nSelect a line: "))
  (If
    A
      (Progn
        (Setq B (Entget (Car A)))
        (If
          (= "LINE" (Cdr (Assoc 0 B)))
            (Progn
              (Setq P1 (Osnap (Cadr A) "END"))
              (Setq P2 (Osnap (Cadr A) "MIT"))
              (Initget 1)
              (Setq D1 (Distance (Cdr (Assoc 10 B)) (Cdr (Assoc 11 B))))
              (Setq D1 (Rtos D1 (Getvar "Lunits") (Getvar "Luprec")))
              (Princ (Strcat "\nActual Length: " D1))
              (Setq D2 (Getdist "\nLength to add: "))
              (Setq P3 (Polar P1 (Angle P2 P1) D2))
              (Command "_change" (Car A) "" P3)
            )
            (Princ "\nThe picked object ist not a Line!")
        )
      )
      (Princ "\nNo object found!")
  )
  (Setvar "Orthomode" OM)
  (Princ)
)
