LISP routine
;------------------------------------------------------------------------------
;GETXREFS: Returns a list
;------------------------------------------------------------------------------
(defun GETXREF (/ ABLOCK ACTIVEDOC ITEM THEBLOCKS THELIST YESXREF)
;retrieve a reference to the Active Document
(setq ACTIVEDOC (vla-get-activedocument (vlax-get-acad-object)))
;retrieve a reference to the blocks
(setq THEBLOCKS (vla-get-blocks ACTIVEDOC))
;create an empty list
(setq THELIST '())
;process each block
(vlax-for ITEM THEBLOCKS
;check if it's an Xref
(setq YESXREF (vlax-get-property ITEM 'ISXREF))
;if it is
(if (= YESXREF :vlax-true)
;do the following
(progn
;get the Xref name
(setq ABLOCK (vlax-get-property ITEM 'NAME))
;store it in the list
(setq THELIST (append (list ABLOCK) THELIST))
) ;progn
) ;if
) ;vlax-for
;print the list
THELIST
) ;defun
"Everybody is ignorant, only on different subjects." — Will Rogers