(defun c:test()
(setvar "cmdecho" 0)
(setq en (entsel "\n选取圆,或[ENTER]结束:"))
(while en
(setq en (car en))
(setq endata (entget en))
(setq cen (cdr (assoc 10 endata)))
(setq rr (cdr (assoc 40 endata)))
(setq pt1 (polar cen (- (/ pi 6)) rr))
(setq pt2 (polar cen (/ pi 2) rr))
(setq pt3 (polar cen (+ pi (/ pi 6)) rr))
(command "polygon" 6 cen "i" (polar cen (/ pi 2) rr))
(command "pline" pt1 pt2 pt3 "")
(command "mirror" (entlast) "" cen (polar cen 0 rr) "")
(setq int (inters cen (polar cen (/ pi 4) rr) pt1 pt2))
(command "polygon" 4 cen "i" int)
(setq pt_rr (list (car cen) (cadr int)))
(command "circle" cen pt_rr)
(setq en (entsel "\n选取圆,或[ENTER]结束:"))
)
(prin1)
)