defun c:LARC
(setq CIREN1 (entsel"\nSelect Arc:"))
(setq LINEN2 (entsel"\nSelect Line:"))
(setq G1 (CADR CIREN1))
(setq G2 (CADR LINEN2))
(setq CIR1 (entget (car CIREN1)))
(setq LINE (entget (car LINEN2)))
(SETQ LIP1 (CDR (ASSOC 10 LINE)))
(SETQ LIP2 (CDR (ASSOC 11 LINE)))
(SETQ CIRP1 (CDR (ASSOC 10 CIR1)))
(SETQ R1 (CDR (ASSOC 40 CIR1)))
(SETQ ANG11 (CDR (ASSOC 50 CIR1)))
(SETQ ANG12 (CDR (ASSOC 51 CIR1)))
(SETQ ARCS1 (POLAR CIRP1 ANG11 R1))
(SETQ ARCE1 (POLAR CIRP1 ANG12 R1))
(SETVAR "FILLETRAD" 0)
(COMMAND "FILLET" G1 G2)
(setq CIREN11 (SSGET G1))
(setq LINEN21 (SSGET G2))
(SETQ NA (ENTGET (SSNAME CIREN11 0)))
(SETQ NB (ENTGET (SSNAME LINEN21 0)))
(COMMAND "ERASE" G1 G2 "")

(SETQ BCIRP1 (CDR (ASSOC 10 NA)))
(SETQ BR1 (CDR (ASSOC 40 NA)))
(SETQ BANG11 (CDR (ASSOC 50 NA)))
(SETQ BANG12 (CDR (ASSOC 51 NA)))
(SETQ BARCS1 (POLAR BCIRP1 BANG11 R1))
(SETQ BARCE1 (POLAR BCIRP1 BANG12 R1))

(SETQ INT1 (INTERS BARCS1 BARCE1 LIP1 LIP2 NIL))

(COMMAND "ARC" "C" CIRP1 ARCS1 ARCE1)
(COMMAND "LINE" LIP1 LIP2 "")
(COMMAND "POINT" INT1)

;(SETQ D1 (DISTANCE INT1 ARCS1))
;(SETQ D2 (DISTANCE INT1 ARCE1))
;(SETQ D3 (DISTANCE INT1 LIP1))
;(SETQ D4 (DISTANCE INT1 LIP2))
;(IF (AND (> D1 D2) (> D3 D4))
;    (PROGN
;       (SETQ TEST 1)
;       (COMMAND "LINE" ARCE1 LIP2 "")
;       (SETQ CEN (LIST (/ (+ (CAR ARCE1) (CAR LIP2)) 2) (/ (+ (CADR ARCE1) (CADR LIP2)) 2)))
;       (SETQ ANG (ANGLE CEN INT1))
;       (SETQ OF (/ (DISTANCE CEN INT1) 2))
;       (SETQ P3 (POLAR ARCE1 ANG OF))
;       (SETQ P4 (POLAR LIP2 ANG OF))
;       (COMMAND "LINE" P3 P4 "")
;       (COMMAND "ARC" "C" CIRP1 ARCE1 INT1)
;       (COMMAND "LINE" LIP2 INT1 "")
;       (SETQ TRIM1 (LIST (/ (+ (CAR P3) (CAR P4)) 2) (/ (+ (CADR P3) (CADR P4)) 2)))
;       (COMMAND "TRIM" CEN TRIM1 "" ARCE1 LIP2 "")
;       (COMMAND "ERASE" CEN TRIM1 "")
;    )
;)
;(IF (AND (< D1 D2) (> D3 D4))
;    (PROGN
;       (SETQ TEST 2)
;       (COMMAND "LINE" ARCS1 LIP2 "")
;       (SETQ CEN (LIST (/ (+ (CAR ARCS1) (CAR LIP2)) 2) (/ (+ (CADR ARCS1) (CADR LIP2)) 2)))
;       (SETQ ANG (ANGLE CEN INT1))
;       (SETQ OF (/ (DISTANCE CEN INT1) 2))
;       (SETQ P3 (POLAR ARCS1 ANG OF))
;       (SETQ P4 (POLAR LIP2 ANG OF))
;       (COMMAND "LINE" P3 P4 "")
;       (COMMAND "ARC" "C" CIRP1  INT1 ARCS1)
;       (COMMAND "LINE" LIP2 INT1 "")
;       (SETQ TRIM1 (LIST (/ (+ (CAR P3) (CAR P4)) 2) (/ (+ (CADR P3) (CADR P4)) 2)))
;       (COMMAND "TRIM" CEN TRIM1 "" ARCS1 LIP2 "")
;       (COMMAND "ERASE" CEN TRIM1 "")
;     )
;)
;(IF (AND (> D1 D2) (< D3 D4))
;    (PROGN
;       (SETQ TEST 3)
;       (COMMAND "LINE" ARCE1 LIP1 "")
;       (SETQ CEN (LIST (/ (+ (CAR ARCE1) (CAR LIP1)) 2) (/ (+ (CADR ARCE1) (CADR LIP1)) 2)))
;       (SETQ ANG (ANGLE CEN INT1))
;       (SETQ OF (/ (DISTANCE CEN INT1) 2))
;       (SETQ P3 (POLAR ARCE1 ANG OF))
;       (SETQ P4 (POLAR LIP1 ANG OF))
;       (COMMAND "LINE" P3 P4 "")
;       (COMMAND "ARC" "C" CIRP1 ARCE1 INT1)
;       (COMMAND "LINE" LIP1 INT1 "")
;       (SETQ TRIM1 (LIST (/ (+ (CAR P3) (CAR P4)) 2) (/ (+ (CADR P3) (CADR P4)) 2)))
;       (COMMAND "TRIM" CEN TRIM1 "" ARCE1 LIP1 "")
;       (COMMAND "ERASE" CEN TRIM1 "")
;    )
;)
;(IF (AND (< D1 D2) (< D3 D4))
;    (PROGN
;       (SETQ TEST 4)
;       (COMMAND "LINE" ARCS1 LIP1 "")
;       (SETQ CEN (LIST (/ (+ (CAR ARCS1) (CAR LIP1)) 2) (/ (+ (CADR ARCS1) (CADR LIP1)) 2)))
;       (SETQ ANG (ANGLE CEN INT1))
;       (SETQ OF (/ (DISTANCE CEN INT1) 2))
;       (SETQ P3 (POLAR ARCS1 ANG OF))
;       (SETQ P4 (POLAR LIP1 ANG OF))
;       (COMMAND "LINE" P3 P4 "")
;       (COMMAND "ARC" "C" CIRP1  INT1 ARCS1)
;       (COMMAND "LINE" LIP1 INT1 "")
;       (COMMAND "TRIM" CEN TRIM1 "" ARCS1 LIP1 "")
;       (SETQ TRIM1 (LIST (/ (+ (CAR P3) (CAR P4)) 2) (/ (+ (CADR P3) (CADR P4)) 2)))
;       (COMMAND "TRIM" CEN TRIM1 "" ARCS1 LIP1 "")
;       (COMMAND "ERASE" CEN TRIM1 "")
;     )
;)
;
;;
