(defun C:UI ( / CurEnt CurObj ExLoop)
(vl-load-com)
(while (not ExLoop)
(initget " ")
(setq CurEnt (entsel "\nSelect Image to Unload : "))
(cond
((eq CurEnt "") (setq ExLoop T))
((not CurEnt) (princ "1 selected, 0 found."))
(T
(setq CurObj (vlax-ename->vla-object (car CurEnt)))
(if (eq (vla-get-ObjectName CurObj) "AcDbRasterImage")
(command "_.IMAGE" "_UNL" (vla-get-Name CurObj))
(princ "Selected object is not an Image.")
)
)
)
)
(princ)
)

(c:ui)

Advertisements