958620832 发表于 2013-9-25 08:02
具体代码修改后是什么样的,请赐教
- (defun c:br (/ *error* NAME SS P LEN I)
- (defun *error* (msg)
- (setq len (sslength ss) i 0)
- (repeat len
- (redraw (ssname ss i) 4) ;_ 取消高亮度显示
- (setq i (+ i 1)))
- (command ".UNDO" "E")
- (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*") (princ (strcat "\n** Error: " msg " **")))
- (princ))
- (setq name (car (entsel "\n请选择被打断线段:")) ss (ssadd))
- (ssadd name ss)
- (redraw name 3) ;_ 高亮度显示被选线段
- (while (setq p (getpoint "\n请选择断点:"))
- (setq len (sslength ss) i 0)
- (repeat len
- (command "_.break" (ssname ss i) p p)
- (redraw (ssname ss i) 3) (redraw (entlast) 3) ;_ 高亮度显示打断后的所有线段
- (ssadd (entlast) ss) ;_ 打断后的线段中,除了(entlast),其余都自动纳入之前选集ss
- (setq i (+ i 1))))
- (setq len (sslength ss) i 0)
- (repeat len
- (redraw (ssname ss i) 4) ;_ 取消高亮度显示
- (setq i (+ i 1)))
- (princ)
- )
|