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