- ;****************************************************
- ; cp--圆变多边形
- ;
- ;*****************************************************
- ;****************************************************圆变多边形
- (defun c:cp (/ en n)
- (setvar "cmdecho" 0)
- (setq en (entsel "请选择一个圆"))
- (setq en_data (entget (car en)))
- (setq cen (cdr (assoc 10 en_data)))
- (setq r (cdr (assoc 40 en_data)))
- (setq n (getint "\n请输入正多边形的边数:"))
- (initget "I C")
- (setq a (getkword "\n输入选项 [内接于圆(I)/外切于圆(C)] <C>:"))
- (if (= a "I")
- (progn
- (command "polygon" n cen "i" r)
- )
- (progn
- (command "polygon" n cen "c" r)
- )
- )
- (command "ERASE" en "")
- (princ)
- )
|