offset命令本身就可以循环的,只是我的程序只将最后一个对象修改到当前层,以下进行了修正 - (defun c:Of2( / ent ents)
- (setvar "cmdecho" 1)
- (setq ent (entlast))
- (command "_.offset" pause)
- (while (= (getvar "cmdactive") 1)
- (command pause)
- (if (not (equal ent (entlast)))
- (progn
- (setq ents (entget (entlast)))
- (setq ents (subst (cons 8 (getvar "clayer")) (assoc 8 ents) ents))
- (entmod ents)
- )
- )
- )
- (princ)
- )
|