| Author |
Message |
Edward Bagby
Guest
|
Posted:
Fri Apr 01, 2005 10:26 pm Post subject:
Accessing Xref Filenames |
|
|
I want to get the actual filename of the attached xref in a drawing, not the
xref "name"
In my case the actual filename and xref name is different. How can I get
this info?
The structure of my code is basically:
Dim xref As AcadBlock
Dim strXRefFileName As String
For Each xref In ThisDrawing.Blocks
If xref.IsXRef Then
strXRefFileName = [Need to get xref filename here]
End If
Next
Thank you for the help.
Edward
|
|
| Back to top |
|
 |
Jeff Mishler
Guest
|
Posted:
Fri Apr 01, 2005 10:45 pm Post subject:
Re: Accessing Xref Filenames |
|
|
The path is stored with the actual insert of the block. Expanding on your
code:
Dim blk As AcadBlock
Dim xref As AcadExternalReference
Dim ss As AcadSelectionSet
Dim iCode(1) As Integer
Dim vVal(1) As Variant
Dim strXRefFileName As String
Set ss = ThisDrawing.PickfirstSelectionSet
iCode(0) = 0: iCode(1) = 2
vVal(0) = "INSERT"
For Each blk In ThisDrawing.Blocks
If blk.IsXRef Then
vVal(1) = blk.Name
ss.Select acSelectionSetAll, , , iCode, vVal
If ss.Count > 0 Then
Set xref = ss.Item(0)
strXRefFileName = xref.Path
End If
ss.Clear
Set xref = Nothing
End If
Next
--
Jeff
check out www.cadvault.com
"Edward Bagby" <ebagby@superstructures.com> wrote in message
news:424d844a$1_1@newsprd01...
| Quote: | I want to get the actual filename of the attached xref in a drawing, not
the xref "name"
In my case the actual filename and xref name is different. How can I get
this info?
The structure of my code is basically:
Dim xref As AcadBlock
Dim strXRefFileName As String
For Each xref In ThisDrawing.Blocks
If xref.IsXRef Then
strXRefFileName = [Need to get xref filename here]
End If
Next
Thank you for the help.
Edward
|
|
|
| Back to top |
|
 |
Edward Bagby
Guest
|
Posted:
Sat Apr 02, 2005 3:43 am Post subject:
Re: Accessing Xref Filenames |
|
|
Worked like a charm!
This solution seems so inobvious. How did you ever figure that out. It was
not in any documentation that I saw.
Thanks,
Edward
"Jeff Mishler" <jeff_m@cadvault.com> wrote in message
news:424d88b7_2@newsprd01...
| Quote: | The path is stored with the actual insert of the block. Expanding on your
code:
Dim blk As AcadBlock
Dim xref As AcadExternalReference
Dim ss As AcadSelectionSet
Dim iCode(1) As Integer
Dim vVal(1) As Variant
Dim strXRefFileName As String
Set ss = ThisDrawing.PickfirstSelectionSet
iCode(0) = 0: iCode(1) = 2
vVal(0) = "INSERT"
For Each blk In ThisDrawing.Blocks
If blk.IsXRef Then
vVal(1) = blk.Name
ss.Select acSelectionSetAll, , , iCode, vVal
If ss.Count > 0 Then
Set xref = ss.Item(0)
strXRefFileName = xref.Path
End If
ss.Clear
Set xref = Nothing
End If
Next
--
Jeff
check out www.cadvault.com
"Edward Bagby" <ebagby@superstructures.com> wrote in message
news:424d844a$1_1@newsprd01...
I want to get the actual filename of the attached xref in a drawing, not
the xref "name"
In my case the actual filename and xref name is different. How can I get
this info?
The structure of my code is basically:
Dim xref As AcadBlock
Dim strXRefFileName As String
For Each xref In ThisDrawing.Blocks
If xref.IsXRef Then
strXRefFileName = [Need to get xref filename here]
End If
Next
Thank you for the help.
Edward
|
|
|
| Back to top |
|
 |
|
|
|
|