purge objects from a block?

C Witt

Usenet Archive
Joined
Jun 23, 2003
Messages
396
Reaction score
0
ok.. How can you "purge" nested items from a block?.. (without exploding it)..

What could I want to purge?.. errant dimension styles, that's what. why? becuase they are not being used anymore and clutter our drawings.

Why not just re-do the blocks?.. there are WAY too many.

Hope someone has an idea..
 
I think redoing the blocks is far easier than you think:

(defun c:fixents (/ ss1 temp ent1 looper entdat bnm ctr enttyp bl_list) (command ".layer" "t" "0" "un" "0" "s" "0" "") (setq ss1 (ssadd) looper T ctr 0) (setq ss1 (ssget "x")) (repeat (sslength ss1) (setq ent1 (ssname ss1 ctr) entdat (entget ent1) enttyp (cdr (assoc 0 entdat))) (if (= enttyp "INSERT") (progn (setq bl_list (list (cdr (assoc 2 entdat)))) (foreach bnm bl_list (jddfixablock bnm) ) ) ) (setq ctr (+ ctr 1)) ) ) (defun jddfixablock (bname / enam1) (setq enam1 (tblobjname "block" bname)) ;;;write a block entmake here with bname (entmake (tblsearch bname));;; restart block def'n (while (setq enam1 (entnext enam1)) ;;; in here you just need to write a series of if statements testing for whatever objects might offend you if they offend, ignore them, if they don't offend, entmake them ie (entmake enam1) (if (= (cdr (assoc 0 (entget enam1))) "INSERT")(setq bl_list (append bl_list (list (cdr (assoc 2 (entget ent1))))))) ) ;;;close out block def'n (entmake '((0 . "ENDBLK")))
)

this will need some work & testing, but it's a start

Jamie
 

Latest threads

Back
Top