(defun c:fr1()
;(IF (= (TYPE F1) 'FILE ) "YES"  (STOP))
;(IF (= (TYPE F2) 'FILE ) "YES" (STOP))
       (COMMAND "SETVAR" "HIGHLIGHT" "1")
       (MENUCMD "S=FILLET1")
       (setq r(getreal "please enter the 'r' value:"))
       (prompt"\n select 1st object:")
       (setq a1(entsel))
       (prompt"\n select 2st object:")
       (setq a2(entsel))
       (setq test1(cadr a1))
       (setq test2(cadr a2))
       (setq da1(entget(car a1)))
       (setq da2(entget(car a2)))
       (setq k1(assoc 10 da1))
       (setq k2(assoc 11 da1))
       (setq k3(assoc 10 da2))
       (setq k4(assoc 11 da2))
       (setq p1 (cdr k1))
       (setq p2 (cdr k2))
       (setq p3 (cdr k3))
       (setq p4 (cdr k4))
       (setq int(inters p1 p2 p3 p4 nil))
       (setq t1(car test1))
       (setq t2(car test2))
       (setq x0(car int))
       (setq x1(car p1))
       (setq x2(car p2))
       (setq x3(car p3))
       (setq x4(car p4))
   (if (or (and(> t1 x0)(< t1 x2)) (and(< t1 x0)(> t1 x2)))
       (progn
            (setq p1 int)(setq j1(cons 10 p1))(setq da1(subst j1 k1 da1))
       )
       (progn
            (setq p2 int)(setq j2(cons 11 p2))(setq da1(subst j2 k2 da1))
       )
   )
   (entmod da1)
   (setq da1(cdr(assoc -1 da1)))
    (if (or (and(> t2 x0)(< t2 x4)) (and(< t2 x0)(> t2 x4)))
      (progn
           (setq p3 int)(setq j3(cons 10 p3))(setq da2(subst j3 k3 da2))
      )
      (progn (setq p4 int)(setq j4(cons 11 p4))(setq da2(subst j4 k4 da2))
       )
     )
     (entmod da2)
     (setq da2(cdr(assoc -1 da2)))
     (command "fillet" "r" r)
     (command "fillet" da1 da2)
(setq a1 (entget (car A1)))
(setq a2 (entget (car A2)))
(SETQ ET1 (CDR (ASSOC 11 A1)))  ;right
(SETQ ET2 (CDR (ASSOC 10 A1)))  ;right
(SETQ ET3 (CDR (ASSOC 11 A2)))  ;right
(SETQ ET4 (CDR (ASSOC 10 A2)))  ;right
(SETQ INT1 (INTERS ET1 ET2 ET3 ET4 NIL))
(setq ang1 (angle ET1 ET2))
(setq ang2 (angle ET3 ET4))
(SETQ D1 (DISTANCE INT1 ET1))
(SETQ D2 (DISTANCE INT1 ET2))
(SETQ D3 (DISTANCE INT1 ET3))
(SETQ D4 (DISTANCE INT1 ET4))
(IF (> D1 D2)
    (PROGN
      (SETQ DT1 D2)
      (SETQ ANG3 (ANGLE INT1 ET2))
    )
    (PROGN
      (SETQ DT1 D1)
      (SETQ ANG3 (ANGLE INT1 ET1))
    )
)
(IF (> D3 D4)
    (PROGN
      (SETQ DT2 D4)
      (SETQ ANG4 (ANGLE INT1 ET4))
    )
    (PROGN
      (SETQ DT2 D3)
      (SETQ ANG4 (ANGLE INT1 ET3))
    )
)
(setq DT1 (* dT1 0.6))
(setq DT2 (* dT2 0.6))

(setq p2 (polar INT1 ANG3 DT1))
(setq p4 (polar INT1 ANG4 DT2))
(COMMAND "LAYER" "SET" "text" "")
(COMMAND "LINE" INT1 P2 "")
(COMMAND "LINE" INT1 P4 "")
(COMMAND "SETVAR" "HIGHLIGHT" "1")
)
