(defun c:2ARC()
(COMMAND "SETVAR" "HIGHLIGHT" "1")
(setq CIREN1 (entsel"\nSelect Arc1:"))
(setq CIREN2 (entsel"\nSelect Arc2:"))
(setq G1 (CADR CIREN1))
(setq G2 (CADR CIREN2))
(setq CIR1 (entget (car CIREN1)))
(setq CIR2 (entget (car CIREN2)))
(SETQ CIRP1 (CDR (ASSOC 10 CIR1)))
(SETQ CIRP2 (CDR (ASSOC 10 CIR2)))
(SETQ R1 (CDR (ASSOC 40 CIR1)))
(SETQ R2 (CDR (ASSOC 40 CIR2)))
(SETQ ANG11 (CDR (ASSOC 50 CIR1)))
(SETQ ANG12 (CDR (ASSOC 51 CIR1)))
(SETQ ANG21 (CDR (ASSOC 50 CIR2)))
(SETQ ANG22 (CDR (ASSOC 51 CIR2)))
(SETQ ARCS1 (POLAR CIRP1 ANG11 R1))
(SETQ ARCE1 (POLAR CIRP1 ANG12 R1))
(SETQ ARCS2 (POLAR CIRP2 ANG21 R2))
(SETQ ARCE2 (POLAR CIRP2 ANG22 R2))

(SETVAR "FILLETRAD" 0)
(COMMAND "FILLET" G1 G2)
(setq CIREN11 (SSGET G1))
(setq CIREN21 (SSGET G2))
(SETQ NA (ENTGET (SSNAME CIREN11 0)))
(SETQ NB (ENTGET (SSNAME CIREN21 0)))
(COMMAND "ERASE" G1 G2 "")

(SETQ BCIRP1 (CDR (ASSOC 10 NA)))
(SETQ BCIRP2 (CDR (ASSOC 10 NB)))
(SETQ BR1 (CDR (ASSOC 40 NA)))
(SETQ BR2 (CDR (ASSOC 40 NB)))
(SETQ BANG11 (CDR (ASSOC 50 NA)))
(SETQ BANG12 (CDR (ASSOC 51 NA)))
(SETQ BANG21 (CDR (ASSOC 50 NB)))
(SETQ BANG22 (CDR (ASSOC 51 NB)))
(SETQ BARCS1 (POLAR BCIRP1 BANG11 R1))
(SETQ BARCE1 (POLAR BCIRP1 BANG12 R1))
(SETQ BARCS2 (POLAR BCIRP2 BANG21 R2))
(SETQ BARCE2 (POLAR BCIRP2 BANG22 R2))
(SETQ INT1 (INTERS BARCS1 BARCE1 BARCS2 BARCE2 NIL))

(COMMAND "ARC" "C" CIRP1  ARCS1 ARCE1)
(COMMAND "ARC" "C" CIRP2  ARCS2 ARCE2)
(COMMAND "POINT" INT1))

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