(defun myerr (s)
   (if (/= s "Function cancelled")
      (princ (strcat "\nError: " s))
   )
   (setq *error* olderr)
   (princ)
)

(if #twid nil (setq #twid 50))
(defun cspedit( / ss sn wid ssl)
 (setvar "cmdecho" 0)
 (setvar "blipmode" 0)
 (setq olderr *error*
       *error* myerr
 )
 (princ "\n\t改变线宽, (c) 1996,10,1 陈松 -- 南昌 ")
 (prompt "\n 请选择您要改变线宽的 line 或 pline 线: ")
 (setq ss(ssget))
 (if ss
  (progn
   (prompt "\n请输入线的宽度<")
   (princ #twid)
   (setq wid(getreal">: "))
   (if wid (setq #twid wid))
   (setq ssl(sslength ss))
   (setq sn 0)
   (while (< sn ssl)
    (setq sent(ssname ss sn))
    (if (= (cdr (assoc 0 (entget sent))) "LINE")
     (command "pedit" sent "y" "w" #twid "")
    )
    (if (=(cdr (assoc 0 (entget sent))) "POLYLINE")
     (command "pedit" sent "w" #twid "")
    )
    (if (=(cdr (assoc 0 (entget sent))) "ARC")
     (command "pedit" sent "y" "w" #twid "")
    )
    (setq sn (1+ sn))
   )
  )
  (prompt "\没有选到实体!!!")
 )
 (setvar "cmdecho" 1)
 (setvar "blipmode" 1)
 (setq *error* olderr)
 (princ)
)
(defun c:cspe () (cspedit))
(princ "\n\t CSPEDIT 已经加载. 键入 CSPE 执行命令 .")
(princ)
