马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
- ;;;所有区块全部炸开(效率不好,有待改进)
- ;;;程序设计:赖云龙;;;
- ;;;---------------;;;
- (defun C:E3DB (/ K QQ1 QQ HOLDECHO HOLDBLIP A AA AAA AL LAY)
- (command "_.undo" "_group")
- (setq HOLDECHO (getvar "cmdecho"))
- (setq HOLDBLIP (getvar "blipmode"))
- (setvar "cmdecho" 0)
- (setvar "blipmode" 0)
- (setq A (getstring "\n所有区块(A)/<选择对象>: "))
- (if (/= A "")
- (progn
- (if (= (getvar "TILEMODE") 1)
- (setq AA (ssget "x" (list (cons 0 "INSERT") (cons 67 0))))
- (setq AA (ssget "x" (list (cons 0 "INSERT") (cons 67 1))))
- )
- )
- (setq AA (ssget '((0 . "INSERT"))))
- )
- (if (/= AA NIL)
- (progn
- (setq QQ1 (ssadd))
- (setq LAY 1)
- (while (/= QQ 0)
- (prompt
- "\n 爆开区块要花点时间处理....."
- )
- (setq AL (sslength AA))
- (setq QQ AL)
- (repeat AL
- (prompt (strcat "\r第"
- (itoa LAY)
- "层共 "
- (itoa QQ)
- " 个区块 >>> 余"
- (itoa AL)
- " "
- )
- )
- (setq AAA (ssname AA (- AL 1)))
- (if
- (/= (cdr
- (assoc 70
- (tblsearch "layer" (cdr (assoc 8 (entget AAA))))
- )
- )
- 4
- )
- (progn
- (command "_.EXPLODE" AAA)
- (setq WWW (ssget "p" '((0 . "INSERT"))))
- (setq K 0)
- (if (/= WWW NIL)
- (repeat (sslength WWW)
- (ssadd (ssname WWW K) QQ1)
- (setq K (1+ K))
- )
- )
- )
- (progn
- (prompt (strcat "\n区块""
- (cdr (assoc 2 (entget AAA)))
- "" 因在锁护图层""
- (cdr (assoc 8 (entget AAA)))
- ""上,故无法炸开"
- )
- )
- (prompt
- "\n 爆开区块要花点时间处理....."
- )
- )
- )
- (setq AL (1- AL))
- )
- (setq LAY (1+ LAY))
- (setq QQ (sslength QQ1))
- (setq AA QQ1)
- (setq QQ1 (ssadd))
- )
- )
- )
- (setvar "blipmode" HOLDBLIP)
- (setvar "cmdecho" HOLDECHO)
- (command "_.undo" "_end")
- (princ)
- )
;|以下供参考效率比较好
(if (= (getvar "TILEMODE") 1)
(while
(setq AA (ssget "X" (list (cons 0 "INSERT") (cons 67 0))))
(command "_.EXPLODE" AA)
)
(while
(setq AA (ssget "X" (list (cons 0 "INSERT") (cons 67 1))))
(command "_.EXPLODE" AA)
)
)|; |