Here's my version (includes hatch, pdf, ole, images)...
(defun c:HAB (/) (c:HIB))
(defun c:HIB (/ *error* _catch u lock e s ss i lst r)
;; send all Hatch and Images Back (draworder)
;; Alan J. Thompson, 12.23.10 | 2016.09.09
(defun *error* (msg)
(foreach l lock (vla-put-lock l :vlax-true))
(if r
(vla-regen *AcadDoc*
(if (eq (getvar 'CVPORT) 1)
acAllViewports
acActiveViewport
)
)
)
(and u (vla-endundomark *AcadDoc*))
(if (and msg (not (wcmatch (strcase msg) "*BREAK*,*CANCEL*,*QUIT*,")))
(progn (vl-bt) (princ (strcat "\nError: " msg)))
)
)
(defun _catch (f a / r)
(if (not (vl-catch-all-error-p (setq r (vl-catch-all-apply f a))))
r
)
)
(setq u (not (vla-startundomark
(cond (*AcadDoc*)
(setq *AcadDoc* (vla-get-activedocument (vlax-get-acad-object)))
)
)
)
)
(vlax-for lay (vla-get-layers *AcadDoc*)
(if (eq (vla-get-lock lay) :vlax-true)
(vla-put-lock (car (setq lock (cons lay lock))) :vlax-false)
)
)
(setq e (vla-getextensiondictionary (vla-get-modelspace *AcadDoc*))
s (cond ((_catch 'vla-getobject (list e "acad_sortents")))
((_catch 'vla-getobject (list e "acad_sortents" "acdbsortentstable")))
)
)
(foreach pair '((0 . "HATCH") (0 . "IMAGE,OLE2FRAME,PDFUNDERLAY"))
(if (setq ss (ssget "_X" (list pair '(410 . "Model"))))
(progn
(repeat (setq i (sslength ss))
(setq lst (cons (vlax-ename->vla-object (ssname ss (setq i (1- i)))) lst))
)
(vlax-invoke s 'MoveToBottom lst)
(setq r t
lst nil
)
)
)
)
(*error* nil)
(princ)
)
(vl-load-com)
(princ)