Cycle through the Blocks colelction checking the IsXref
property. When it returns True, create a filtered selection
set using the name of that block. Doing so will yield every
xref insert regardless of which space block it is contained
in:
Dim blkDef As AcadBlock, xref As AcadExternalReference
Dim fType(1) As Integer, fData(1)
Dim ss As AcadSelectionSet
Set ss = ThisDrawing.Selectionsets.Add("ss")
fType(0) = 0 : fData(0) = "INSERT"
fType(1) = 2
For Each blkDef In ThisDrawing.Blocks
If blkDef.IsXref Then
fData(1) = blkDef.Name
ss.Select , , fType, fData
For Each xref In ss
Next
End If
Next
--
http://www.acadx.com
"Barry Bell" wrote in message
news:2DD44CAEE63F7A534C96A915FBD0E4BF@in.WebX.maYIadrTaRb...
> I am trying to find out all the XRefs for a document in
the following way,
>
> --
> Sub getxrefs()
> Dim myXRefs As AcadExternalReference
> For Each myXRefs In ActiveDocument.ModelSpace
> MsgBox myXRefs.Path
> Next
> UserForm1.Show
> End Sub
> --
>
> This is fine for ModelSpace XRefs but I would to get all
the XRefs for
> PaperSpace as well. I thought that it would be a case of
changing the third
> line to 'For Each myXRefs In ActiveDocument.PaperSpace'
but this does not
> work.
>
> Any help with PaperSpace XRef's would be most gratefully
received.
>
> Barry Bell
>
>