(defun c:fs_ptfillet
       (/ i k l loop n plst pt r ss step sz e1 e2 os *error*)
  (defun *error* (msg) (setvar "osmode" os))
  (setq loop t)
  (while loop
    (princ "\n目前的設定值: 模式 = ")
    (if	(zerop (getvar "trimmode"))
      (princ "不")
    )
    (princ "修剪 ，半徑 = ")
    (princ (getvar "filletrad"))
    (setq os (getvar "osmode"))
    (setvar "osmode" 0)
    (initget "R T U")
    (setq pt (getpoint
	       "\n请在要倒圆角一侧拾取一点：[半径(R)/切换修剪(T)/复原(U)]"
	     )
    )
    (cond ((= "R" pt)
	   (if (setq r (getdist "请指定圆角半径："))
	     (setvar "filletrad" r)
	   )
	  )
	  ((= "T" pt)
	   (setvar "trimmode" (abs (1- (getvar "trimmode"))))
	  )
	  ((= "U" pt)
	   (command ".U")
	  )
	  ((null pt) (fsxm-silenceexit))
	  (t (setq loop nil))
    )
  )
  (*error* "")
  (setq *error* nil)
  (setq sz (fsxm-pickboxsize))
  (setq n 0)
  (while
    (progn
      (setq n (+ n 2))
      (setq l (* 2 pi sz n))
      (setq i (max 8 (1+ (fix (/ l sz)))))
      (setq step (/ pi i 0.5))
      (setq k 0)
      (setq plst nil)
      (repeat i
	(setq plst (cons (polar pt (* k step) (* n sz)) plst))
	(setq k (1+ k))
      )
      (setq
	ss (ssget "CP" plst '((0 . "*line,arc,circle,ellipse,ray")))
      )
      (not (and ss (>= (sslength ss) 2)))
    )
  )
  (setq e1 (ssname ss 0))
  (setq e2 (ssname ss 1))
  (command ".fillet" (list e1 pt) (list e2 pt))
  (c:fs_ptfillet)
  (princ)
)