(defun C:join()
;(IF (= (TYPE F1) 'FILE ) "YES"  (STOP))
;(IF (= (TYPE F2) 'FILE ) "YES" (STOP))
   (while (not (null (setq S1 (entsel "\nSelect object to re-join: "))))
      (setq l1 (entget (car S1)) P1 (cadr S1)
            Ent (cdr (assoc 0 l1))
      )
      (cond ((= Ent "LINE")
               (setq E1 (cdr (assoc 10 l1))
                     E2 (cdr (assoc 11 l1))
               )
               (command "erase" P1 ""
                        "line" "endp" E1 "endp" E2 ""
               )
            )
            ((= Ent "ARC")
               (setq Pc (cdr (assoc 10 l1))
                     R (cdr (assoc 40 l1))
                     A (cdr (assoc 50 l1))
               )
               (command "erase" P1 "")
               (setq E1 (osnap (polar Pc A R) "endp")
                     E2 (osnap (polar Pc (cdr (assoc 51 l1)) R) "endp")
               )
               (command "arc" E1 "e" E2 "d"
                        (polar E1 (+ A (* 0.5 pi)) R)
               )
            )
      )
   )
)
