Perhaps flick through the INSERTs?
(defun GetAttrib ( att / ss )
(if (setq ss (ssget "_X" '((0 . "INSERT") (66 . 1))))
(
(lambda ( i / a e n l )
(while (and (not a) (setq e (ssname ss (setq i (1+ i)))))
(if (not (member (setq n (cdr (assoc 2 (entget e)))) l))
(progn (setq l (cons n l))
(while
(not
(eq "SEQEND"
(cdr
(assoc 0
(setq l
(entget
(setq e (entnext e))
)
)
)
)
)
)
(if (eq att (cdr (assoc 2 (entget e)))) (setq a n))
)
)
)
)
a
)
-1
)
)
)
Returns block name, but could return whatever is needed really.