本帖最后由 琴剑江山_10184 于 2015-3-16 11:00 编辑
- ;;;;琴剑江山 2015.3.16
- (defun c:ta (/ ADD DXF-10 ENT GET GET2 LEN LEN2 NN NN2)
- (setvar "cmdecho" 0)
- (princ "\n功能 [批量删除多段内所有对象]")
- (setq get (ssget (list '(0 . "LWPOLYLINE") (cons 8 "bend"))));删除"bend"层的,自行修改你的层
- (setq Len (sslength get) add (ssadd))
- (repeat Len
- (setq nn (ssname get (setq Len (1- Len)))
- ent (entget nn))
- (if (= (cdr (assoc 0 ent)) "LWPOLYLINE")
- (progn
- (setq dxf-10 (vl-remove-if '(lambda (x) (/= (car x) 10)) ent)
- get2 (ssget "_WP" (mapcar 'cdr dxf-10))
- Len2 (sslength get2))
- (repeat Len2
- (setq nn2 (ssname get2 (setq Len2 (1- Len2))))
- (ssadd nn2 add)
- )
- )
- )
- )
- (vl-cmdf "_.ERASE" add "")
- (princ)
- )
|