; Detach any unloaded (unresolved) XREFs
(defun C:dux ()
(vlax-for BIND_xrefname (vla-get-blocks (vla-get-ActiveDocument (vlax-get-Acad-object)))
(if (= (vla-get-isxref BIND_xrefname) ':vlax-true)
(progn
(setq BIND_cont (entget (vlax-vla-object->ename BIND_xrefname))
BIND_cont (tblsearch "BLOCK" (cdr (assoc 2 BIND_cont)))
)
(if (or (= (cdr (assoc 70 BIND_cont)) 4) (= (cdr (assoc 70 BIND_cont)) 12))
(vla-Detach BIND_xrefname)
)
)
)
)
)
(c:dux)

Advertisements