(defun c:te()
  (setq n (getint "请输入正多边形的边数<5>"))
  (if (= n nil) (setq n 5))
  (setq si (getint "\n (1)内切正多边形 (2)外切正多边形<1>"))
  (if (= si nil) (setq si 1))
  (setq en (entsel "\n 选择欲作内切正多边形的圆："))
  (setq I 0)
  (while en
     (setq en_data (entget (car en)))
     (setq en_type (cdr (assoc 0 en_data)))
     (if (= en_type "CIRCLE")
      (progn
 (setq cenpt (cdr (assoc 10 en_data)))
 (setq rad (cdr (assoc 40 en_data)))
      (if (= si 1)
	(command "polygon" n cenpt "I" rad)
        (command "polygon" n cenpt "C" rad)
       )
        (setq I (1+ I))
       )
      (alert "该对象不是圆")
     )
    (setq en (entsel "\n 选择下一个要作正多边形的圆"))
    )
  (princ (strcat "\n 共绘制了" (itoa i) "圆内切正多边形"))
  (prin1)
 )
