(DEFUN C:CONT ()
(GRAPHSCR) (TERPRI)
(SETQ CY (GETVAR "CALAYER"))
;(IF (= (TYPE F1) 'FILE ) "YES"  (STOP))
;(IF (= (TYPE F2) 'FILE ) "YES" (STOP))
(COMMAND "SETVAR" "HIGHLIGHT" "1")
(setq ART1 (entget (car (entsel"\nSelect Line1:"))))
(setq ART2 (entget (car (entsel"\nSelect Line2 :"))))
(SETQ ARTA (CDR ART1))
(SETQ ART11 (ASSOC 11 ARTA))
(SETQ ART12 (ASSOC 10 ARTA))
(SETQ ALA (ASSOC 8 ARTA))
(SETQ ALA1 (CDR ALA))
(SETQ ART11 (CDR ART11 ))
(SETQ ART12 (CDR ART12 ))
(SETQ ER1 (LIST (/ (+ (CAR ART11) (CAR ART12)) 2) (/ (+ (CADR ART11) (CADR ART12)) 2)))
(SETQ TRB (CDR ART2))
(SETQ ART21 (ASSOC 11 TRB))
(SETQ ART22 (ASSOC 10 TRB))
(SETQ ART21 (CDR ART21 ))
(SETQ ART22 (CDR ART22 ))
(SETQ ER2 (LIST (/ (+ (CAR ART21) (CAR ART22)) 2) (/ (+ (CADR ART21) (CADR ART22)) 2)))
(SETQ M1 (DISTANCE ART11 ART21))
(SETQ M2 (DISTANCE ART11 ART22))
(SETQ M3 (DISTANCE ART12 ART21))
(SETQ M4 (DISTANCE ART12 ART22))
(SETQ DISTL (MAX M1 M2 M3 M4))
(IF (= DISTL M1)
    (PROGN
    (COMMAND "ERASE" ER1 "")
    (COMMAND "ERASE" ER2 "")
    (COMMAND "ALAYER" "SET" ALA1 "")
    (COMMAND "LINE" ART11 ART21 "")
    (COMMAND "ALAYER" "SET" CY "")
    )
)
(IF (= DISTL M2)
    (PROGN
    (COMMAND "ERASE" ER1 "")
    (COMMAND "ERASE" ER2 "")
    (COMMAND "ALAYER" "SET" ALA1 "")
    (COMMAND "LINE" ART11 ART22 "")
    (COMMAND "ALAYER" "SET" CY "")
    )
)
(IF (= DISTL M3)
    (PROGN
    (COMMAND "ERASE" ER1 "")
    (COMMAND "ERASE" ER2 "")
    (COMMAND "ALAYER" "SET" ALA1 "")
    (COMMAND "LINE" ART12 ART21 "")
    (COMMAND "ALAYER" "SET" CY "")
    )
)
(IF (= DISTL M4)
    (PROGN
    (COMMAND "ERASE" ER1 "")
    (COMMAND "ERASE" ER2 "")
    (COMMAND "ALAYER" "SET" ALA1 "")
    (COMMAND "LINE" ART12 ART22 "")
    (COMMAND "ALAYER" "SET" CY "")
    )
)
(COMMAND "SETVAR" "HIGHLIGHT" "1")
)
