请教一个不完全彻底打碎块的问题
www.dimcax.com
请教一个不完全彻底打碎块的问题我想将选择的多层嵌套块不完全彻底打碎,即不打碎名为表中(list "dz""dzzr""dzsx""dzzrsx")的块。代码如下,但运行过程中总是没有打碎到最后一层就停止了,请高手们分析一下原因,给点改进意见,谢谢!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70( c:defa ( lst lstx ss x)
( ss ( '((0 . "insert")))
; lst nil
lstx ( "dz""dzzr""dzsx""dzzrsx");不打碎的块名列表

;_ end setq
;( '( (x) ( lst ( lst ( ( 2 x))))) lstx)
(while ( ss (ssget "_p"
(append ( ( -4 "<and")
( 0 "insert")
( -4 "<not")
( -4 "<or")
; ) ;_ end list
; lst
( ( -4 "or>")
( -4 "not>")
( -4 "and>")
; ) ;_ end list
; ) ;_ end append
; ) ;_ end ssget
; ) ;_ end setq
; (brkblk ss)

;_ end while
) ;_ end defun
( brkblk (ss / bname dd ent ent1 lst n name newtxt tca ssa)
;( ( n ( ss))
; ( ent1 ( ent ( ( ss ( n (1- n))))))
; ( ( (get 66 ent1) 1)
( ( (get 0 ( ent1 ( ( name ( (get -1 ent1)))))) "seqend")
(if ( ( (get 0 ent1) "attrib") ( (get 70 ent1) 1))
(ssset ent1 1 "")
; ) ;_ end if
; ) ;_ end while
; ) ;_ end if

;_ end repeat
;( ( n ( ss))
; ( ent1 ( ( bname ( ss ( n (1- n))))))
( "clayer" (get 8 ent1))
; ( ( (get 66 ent1) 1)
( ( (get 0 ( ent1 ( ( name ( (get -1 ent1)))))) "seqend")
(if ( (get 0 ent1) "attrib")
; (
( newtxt '((0 . "text")))
; ( lst '(67 410 10 40 1 50 41 51 7 71 72 11 210))
; ( xh lst ;序号
; ( dd ( xh ent1)) ;点对
; ( ( dd nil)
; ( newtxt ( newtxt ( ( xh ent1))))
; ) ;_ 结束if
; ) ;_ 结束foreach
( ( ( tca (get 8 ent1)) ( tca "0"))
; ( newtxt ( newtxt ( ( 8 tca))))
; ) ;_ end if
; ( newtxt ( newtxt ( ( 73 (get 74 ent1)))))
; ( newtxt)
; (vla-delete ( name))
; ) ;_ 结束progn
; ) ;_ 结束if
; ) ;_ 结束while
; ) ;_ end if
( "explode" bname)
( ( ssa ( "_p" '((0 . "attdef"))))
( ".erase" ssa "")
; )

;_ 结束repeat
) ;_ end defun
(defun get (nnum eent /)
; ( ( nnum eent))
)
;呵呵,这一段是最近刚看到的-4才这么写的,不知道是不是太啰嗦了。
( ss (ssget "_p"
(append ( ( -4 "<and")
( 0 "insert")
( -4 "<not")
( -4 "<or")
; ) ;_ end list
; lst
( ( -4 "or>")
( -4 "not>")
( -4 "and>")
; ) ;_ end list
; ) ;_ end append
; ) ;_ end ssget
; )
新手上路,请多指点。
d