External references are treated as blocks in autocad, and accessed as such in .NET.
I just looked in the object browser, and unfortunately there does not appear to be a property in the BlockReference class which indicates whether it is an Xref, but in the BlockTableRecord class there is an XrefStatus property which indicates NotAnXref for regular block definitions, and the load status of Xref's (FileNotFound, Resolved, Unloaded, Unreferenced, Unresolved). That of course makes it tough to restrict the selection function to only allow Xrefs, but you can restrict it to BlockReferences, then open the corresponding BTR and check the XrefStatus. Also, as I recall, the code I have which uses that property also has to check the name of the block because if you loop through the block table you will see definitions that are in the Xref, but the XrefStatus of those nested definitions returns NotAnXref.
Edited by: chiefbraincloud on May 6, 2009 3:10 PM
I just looked again, and there are also two other properties IsFromExternalReference and IsFromOverlayReference, which also return incorrectly for a block definition nested in an Xref. Based on the description of what it is you are trying to do, you probably wouldn't encounter that problem, because you aren't looping through the whole block table, you are getting a selection from the user.
Dave O.