(defun csjoin( / ss ssl sent0 sent1)
 (setvar "cmdecho" 0)
 (setvar "blipmode" 0)
 (prompt "\n 请选择两条要连接的 pline 线: ")
 (setq ss(ssget))
 (if ss
  (progn
   (setq ssl(sslength ss))
   (if (= ssl 2)
    (progn
     (setq sent0(ssname ss 0))
     (setq sent1(ssname ss 1))
     (if (= (cdr (assoc 0 (entget sent0))) "POLYLINE")
      (progn
       (if (= (cdr (assoc 0 (entget sent1))) "POLYLINE")
        (command "pedit" sent0 "j" sent0 sent1 "" "")
        (prompt "\错误: 没有选到两条 pline 线!!!")
       )
      )
      (prompt "\错误:没有选到两条 pline 线!!!")
     )
    )
    (prompt "\错误: 没有选到两条 pline 线!!!")
   )
  )
  (prompt "\错误: 没有选到两条 pline 线!!!")
 )
 (setvar "cmdecho" 1)
 (setvar "blipmode" 1)
)
(defun c:csj () (csjoin))
(princ "\n\t Copyright 1996,4,19 -----陈松,南昌")
(princ "\n\t CSJOIN 已经加载. 键入 CSJ 执行命令 .")
(princ)
