(defun c:le()
    (setq pu (getpoint "\nPICK EXTEND POINT: "))
      (setq lin (CAR (ENTSEL)))
  (setq b1 (entget lin))
  (setq c1 (assoc 10 b1))
  (setq c2 (assoc 11 b1))
  (setq p1 (cdr c1))
  (setq p2 (cdr c2))
; (SETQ INP (INTERS P1 P2 PU (REL PU 5 0)))
  (SETQ ANG (ANGLE P1 P2))
  (SETQ DIS1 (DISTANCE P1 PU))
  (SETQ DIS2 (DISTANCE P2 PU))
  (IF (AND (> DIS2 DIS1) (>= ANG (DTR 270)) (<= ANG (DTR 360)))
        (PROGN
          (SETQ Y (- (CADR PU) (CADR P1)))
          (SETQ Y1 (+ (CADR P1) Y))
            (SETQ X (/ Y (TAN ANG)))
          (SETQ X1 (+ X (CAR P1)))
             (SETQ INP (LIST X1 Y1))
           (setq d (cons (car c1) INP))
            (setq b2 (subst d c1 b1))
             (ENTMOD B2)
        )
  )
  (IF (AND (< DIS2 DIS1) (>= ANG (DTR 270)) (<= ANG (DTR 360)))
        (PROGN
          (SETQ Y (- (CADR P2) (CADR PU)))
          (SETQ Y1 (- (CADR P2) Y))
            (SETQ X (/ Y (TAN (+ (DTR 180) ANG))))
          (SETQ X1 (+ (CAR P2) (ABS X)))
             (SETQ INP (LIST X1 Y1))
           (setq d (cons (car c2) INP))
            (setq b2 (subst d c2 b1))
             (ENTMOD B2)
        )
  )
;
  (IF (AND (> DIS2 DIS1) (>= ANG (DTR 180)) (< ANG (DTR 270)))
        (PROGN
          (SETQ Y (- (CADR PU) (CADR P1)))
          (SETQ Y1 (+ (CADR P1) Y))
            (SETQ X (/ Y (TAN ANG)))
          (SETQ X1 (+ X (CAR P1)))
             (SETQ INP (LIST X1 Y1))
           (setq d (cons (car c1) INP))
            (setq b2 (subst d c1 b1))
             (ENTMOD B2)
        )
  )
  (IF (AND (< DIS2 DIS1) (>= ANG (DTR 180)) (< ANG (DTR 270)))
        (PROGN
          (SETQ Y (- (CADR P2) (CADR PU)))
          (SETQ Y1 (- (CADR P2) Y))
            (SETQ X (/ Y (TAN (+ (DTR 180) ANG))))
          (SETQ X1 (- (CAR P2) (ABS X)))
             (SETQ INP (LIST X1 Y1))
           (setq d (cons (car c2) INP))
            (setq b2 (subst d c2 b1))
             (ENTMOD B2)
        )
  )
;
;'''''
  (IF (AND (> DIS2 DIS1) (>= ANG (DTR 90)) (< ANG (DTR 180)))
        (PROGN
          (SETQ Y (- (CADR PU) (CADR P1)))
          (SETQ Y1 (+ (CADR P1) Y))
            (SETQ X (/ Y (TAN ANG)))
          (SETQ X1 (+ X (CAR P1)))
             (SETQ INP (LIST X1 Y1))
           (setq d (cons (car c1) INP))
            (setq b2 (subst d c1 b1))
             (ENTMOD B2)
        )
  )
  (IF (AND (< DIS2 DIS1) (>= ANG (DTR 90)) (<= ANG (DTR 180)))
        (PROGN
          (SETQ Y (- (CADR P2) (CADR PU)))
          (SETQ Y1 (- (CADR P2) Y))
            (SETQ X (/ Y (TAN (+ (DTR 180) ANG))))
          (SETQ X1 (- (CAR P2) (ABS X)))
             (SETQ INP (LIST X1 Y1))
           (setq d (cons (car c2) INP))
            (setq b2 (subst d c2 b1))
             (ENTMOD B2)
        )
  )
;'''''
  (IF (AND (> DIS2 DIS1) (>= ANG (DTR 0)) (< ANG (DTR 90)))
        (PROGN
          (SETQ Y (- (CADR PU) (CADR P1)))
          (SETQ Y1 (+ (CADR P1) Y))
            (SETQ X (/ Y (TAN ANG)))
          (SETQ X1 (+ X (CAR P1)))
             (SETQ INP (LIST X1 Y1))
           (setq d (cons (car c1) INP))
            (setq b2 (subst d c1 b1))
             (ENTMOD B2)
        )
  )
  (IF (AND (< DIS2 DIS1) (>= ANG (DTR 0)) (<= ANG (DTR 90)))
        (PROGN
          (SETQ Y (- (CADR P2) (CADR PU)))
          (SETQ Y1 (- (CADR P2) Y))
            (SETQ X (/ Y (TAN (+ (DTR 180) ANG))))
          (SETQ X1 (+ (CAR P2) (ABS X)))
             (SETQ INP (LIST X1 Y1))
           (setq d (cons (car c2) INP))
            (setq b2 (subst d c2 b1))
             (ENTMOD B2)
        )
  )



)
