I am doing this the slow way ... it is painfully slow...
By iterating every object in the block. Test for layer name and add to list of acad entities.
AcadBlock block1 = acadApp.ActiveDocument.Blocks.Item(...);
foreach (AcadEntity ae1 in block1)
{ ... }
It is horribly slow.
I was going to try a selection set in DBX document ... could not find it ...
Selection sets with filters are nice and fast... if only I could do it with a nested layer... what have I missed?
Thanks for reading...
Kevin.
Hope this blog will help you regarding selection sets.
http://adndevblog.typepad.com/autocad/2012/07/creating-a-selection-set-using-com-interop.html
Thx ... that blog page matches the code I use for filtering of non-nested. I am hoping to find a similar filter that works within externally referenced entities.
One way to work around is to programatically change the xrefdatabase as current working database and apply Selection filter and return current database.
If you tried above approach already , I'm sorry I don't have an API which selects all xref entities with in current database.