下面我粘的是ZZXXQQ版主的代码。程序并没有什么错误,只是括号有点问题。这是版主特意对代码使用者的考验吧。找下错误,也有利用提高自己。- ;圆环外径变圆 ZZXXQQ 2009.10.19
- (defun c:tt ()
- (setvar "CMDECHO" 0)
- (setq oldos (getvar "OSMODE"))
- (if (setq ss (ssget '((0 . "LWPOLYLINE") (70 . 1) (42 . 1.0))))
- (progn
- (setvar "osmode" 0)
- (command ".UNDO" "BE")
- (setq i -1)
- (repeat (sslength ss)
- (setq ent (entget (ssname ss (setq i (1+ i))))
- w (cdr (assoc 40 ent))
- pt (cdr (assoc 10 ent))
- pc (osnap pt "CEN")
- r (+ (distance pc pt) (/ w 2))
- )
- (command "CIRCLE" pc r)
- )
- (command ".ERASE" ss "")
- (command ".UNDO" "E")
- (setvar "osmode" oldos)
- )
- )
- (setvar "CMDECHO" 1)
- (princ)
- )
|