Well, my top secret plan is to get all that information, then detach all the
xrefs and then insert them all into the one drawing as blocks. Like bind but
without all the hassle of not being able to bind nested xrefs. I'm sure
someone has probably already done it but I was trying to figure it out
myself.
Graeme
"R. Robert Bell" wrote in message
news:594ADA07AB214F89E458D324E31CCEF8@in.WebX.maYIadrTaRb...
> Well, a nested XRef's insertion point only make sense in the context of
the
> parent XRef that it is in. I deemed it unneeded to report the insertion
> point of nested XRefs, because of what use would it be?
>
> For instance:
>
> XRef name: Diff
> XRef path: C:\Temp\Diff.dwg
> Inserted at: 12,12,0
> Scale factor: 1
>
> XRef name: Drawing2
> XRef path: C:\Temp\Drawing2.dwg
> Inserted at: 9.63501133246334,30.3961543419182,0
> Scale factor: 1
>
> XRef name: X-Diff
> XRef path: C:\Temp\X-Diff.dwg
>
> In the above, there are only two XRefs actually placed in the drawing (in
> modelspace). The 3rd one, X-Diff, is a nested XRef in Diff.
>
>
> --
> R. Robert Bell, MCSE
> www.AcadX.com
>
>
> "Graeme Hyslop" wrote in message
> news:D57B5414773E384648F1BFC3D90EBE77@in.WebX.maYIadrTaRb...
> | Thank you Robert that worked almost perfect. To start with it listed the
> | name and path of them all, but only the scale and insertion point of the
> | first xref. By commenting out the If ynInserted ... line it worked
> | perfectly. Is the If ynInserted ... line important for something ?
> |
> | Graeme
> |
> | > Option Explicit
> | >
> | > Public Sub Test()
> | > Dim XRefs As New Collection
> | > Set XRefs = GetXRefs
> | >
> | > Dim XRef As AcadExternalReference
> | > Dim ynInserted As Boolean
> | > Dim i As Integer
> | >
> | > For i = 1 To XRefs.Count
> | > Set XRef = XRefs(i)
> | > ynInserted = IsInserted(XRef)
> | > Debug.Print _
> | > "XRef name: " & XRef.Name & _
> | > vbCrLf & "XRef path: " & XRef.Path
> | > If ynInserted Then
> | > Debug.Print _
> | > "Inserted at: " & _
> | > CStr(XRef.InsertionPoint(0)) & "," & _
> | > CStr(XRef.InsertionPoint(1)) & "," & _
> | > CStr(XRef.InsertionPoint(2)) & _
> | > vbCrLf & "Scale factor: " & XRef.XScaleFactor
> | > End If
> | > Next i
> | > End Sub
> | >
> | > Private Function IsInserted(Block As AcadExternalReference) As Boolean
> | > Dim BlockOwner As Long
> | > BlockOwner = Block.OwnerID
> | >
> | > If BlockOwner = ThisDrawing.ModelSpace.ObjectID Then
> | > IsInserted = True
> | > Exit Function
> | > End If
> | >
> | > Dim ThisLayout As AcadLayout
> | > For Each ThisLayout In ThisDrawing.Layouts
> | > If BlockOwner = ThisLayout.ObjectID Then
> | > IsInserted = True
> | > Exit Function
> | > End If
> | > Next ThisLayout
> | > End Function
> | >
> | > Private Function GetXRefs() As Collection
> | > Dim ThisBlock As AcadBlock
> | > Dim ThisObject As AcadEntity
> | > Dim AnXRef As AcadExternalReference
> | > Dim Result As New Collection
> | > Dim i As Integer
> | > For Each ThisBlock In ThisDrawing.Blocks
> | > For Each ThisObject In ThisBlock
> | > If TypeOf ThisObject Is AcadExternalReference Then
> | > Set AnXRef = ThisObject
> | > Result.Add AnXRef, CStr(i)
> | > i = i + 1
> | > End If
> | > Next ThisObject
> | > Next ThisBlock
> | > Set GetXRefs = Result
> | > Set Result = Nothing
> | > End Function
> | >
> | >
> | > --
> | > R. Robert Bell, MCSE
> | > www.AcadX.com
> | >
> | >
> |
> |
>
>