You can use the VBA to repath to a relative directory structure.
Make a dialog box in VBA with two Textboxes. One named "OldXrefPath",
and the other "NewXrefPath", and an commad button named "ReplacePaths".
Then the following code will automatically update your xrefpaths as needed.
If you want a relative directories you'll just have to be clever with the
path
replacements. i.e.
if the drawing you editing is in C:\projectABC\arch, then you type in
C:\project\arch\ in the first field, and nothing in the second and your
xrefs should now be defined relatively. You won't be able to see this
in a xref manager, but if you copy all the files over to a different
directory, they should pick up the new location automatically.
Private Sub ReplacePaths_Click()
Dim objXref As AcadExternalReference
Dim objSelSet As AcadSelectionSet
Dim objSelCol As AcadSelectionSets
Dim objBlk As AcadBlock
Dim objBlks As AcadBlocks
Dim intType(0) As Integer
Dim varData(0) As Variant
Dim objBlkRef As Object
Dim strFile As String
On Error GoTo Err_Control
Set objBlks = ThisDrawing.Blocks
Set objSelCol = ThisDrawing.SelectionSets
For Each objSelSet In objSelCol
If objSelSet.Name = "repathxrefs" Then
objSelSet.Delete
Exit For
End If
Next
Set objSelSet = _
ThisDrawing.SelectionSets.Add("repathxrefs")
intType(0) = 0
varData(0) = "INSERT"
objSelSet.Select acSelectionSetAll, _
filtertype:=intType, filterdata:=varData
For Each objBlkRef In objSelSet
If TypeOf objBlkRef Is AcadExternalReference Then
Set objXref = objBlkRef
strFile = objXref.Path
If UCase(Left(strFile, Len(OldXrefPath))) = UCase(OldXrefPath)
Then
newstrFile = NewXrefPath & Mid(strFile, Len(OldXrefPath) +
1, Len(strFile) - Len(OldXrefPath))
objXref.Path = newstrFile
Set objBlk = objBlks(objBlkRef.Name)
objBlk.Reload
End If
End If
Next objBlkRef
objSelSet.Delete
Exit_Here:
Exit Sub
Err_Control:
Select Case Err.Number
'Add your Case selections here
Case Else
MsgBox Err.Description
Resume Exit_Here
End Select
End Sub
"Steven Craig Basham" wrote in
message news:406089c9$1_2@newsprd01...
> Okay, maybe you have an idea of how to go about what I'd like to do. I'm
> looking to change the xref path to a relative path based on the drawing
path
> the xref'd drawing is inserted into. Manually, I can use the Xref Manager
> to modify this value. Do you know of a way to programmatically modify
this
> value?
>
>
> "R. Robert Bell" wrote in message
> news:40608688$1_3@newsprd01...
> > The Path property is only available in the ExternalReference object (the
> > actual inserted object, not the definition).
> >
> >
> > --
> > R. Robert Bell
> >
> >
> > "Steven Craig Basham" wrote in
> > message news:40608579$1_1@newsprd01...
> > How do I find an Xref's drawing location/path programmatically?
> >
> > I didn't see anything in the xref blocks that definitively told me this
> > path.
> >
> > Thanks for your help!
> >
> > Steven Craig Basham
> >
> >
> >
> >
>
>