XREF PATH PROGRAMMITICALLY

XREF PATH PROGRAMMITICALLY

Anonymous
Not applicable
891 Views
10 Replies
Message 1 of 11

XREF PATH PROGRAMMITICALLY

Anonymous
Not applicable
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
0 Likes
892 Views
10 Replies
Replies (10)
Message 2 of 11

Anonymous
Not applicable
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
0 Likes
Message 3 of 11

Anonymous
Not applicable
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 > > > >
0 Likes
Message 4 of 11

Anonymous
Not applicable
Use a filtered selection set to get the ExternalReference objects that you need to change the Path property on. -- R. Robert Bell "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 > > > >
0 Likes
Message 5 of 11

Anonymous
Not applicable
You could also search this ng for code. What you want to do has been dicussed before. -- ---- Ed ---- "R. Robert Bell" wrote in message news:40608dea$1_2@newsprd01... > Use a filtered selection set to get the ExternalReference objects that you > need to change the Path property on. > > -- > R. Robert Bell > > > "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 > > > > > > > > > > >
0 Likes
Message 6 of 11

Anonymous
Not applicable
To do this using the filtered selection set wouldn't I have to go to each layout and create a selection set for all external references in model and paperspace in order to be sure to 'get' them all? Is this what Xref Manager does behind the scenes to collect the infomation into 1 nice and neat dialog box? "Ed Jobe" wrote in message news:4060911f_3@newsprd01... > You could also search this ng for code. What you want to do has been > dicussed before. > > -- > ---- > Ed > ---- > "R. Robert Bell" wrote in message > news:40608dea$1_2@newsprd01... > > Use a filtered selection set to get the ExternalReference objects that you > > need to change the Path property on. > > > > -- > > R. Robert Bell > > > > > > "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 > > > > > > > > > > > > > > > > > > > >
0 Likes
Message 7 of 11

Anonymous
Not applicable
Ed, I tried searching to no avail... do you have any links to messages I could review? Thank you so much! Steven Craig Basham "Ed Jobe" wrote in message news:4060911f_3@newsprd01... > You could also search this ng for code. What you want to do has been > dicussed before. > > -- > ---- > Ed > ---- > "R. Robert Bell" wrote in message > news:40608dea$1_2@newsprd01... > > Use a filtered selection set to get the ExternalReference objects that you > > need to change the Path property on. > > > > -- > > R. Robert Bell > > > > > > "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 > > > > > > > > > > > > > > > > > > > >
0 Likes
Message 8 of 11

Anonymous
Not applicable
One more thing... wouldn't this only allow me to edit only those xrefs that are loaded and inserted? Under the Xref manager there are xrefs that are 'known about' but are currently unloaded... I need to modify those paths as well... any further explations would be greatly appreciated! Thank you so much, Steven Craig Basham "R. Robert Bell" wrote in message news:40608dea$1_2@newsprd01... > Use a filtered selection set to get the ExternalReference objects that you > need to change the Path property on. > > -- > R. Robert Bell > > > "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 > > > > > > > > > > >
0 Likes
Message 9 of 11

Anonymous
Not applicable
http://tinyurl.com/26wbb -- ---- Ed ---- "Steven Craig Basham" wrote in message news:40609938_2@newsprd01... > Ed, > I tried searching to no avail... do you have any links to messages I > could review? > > Thank you so much! > Steven Craig Basham > > "Ed Jobe" wrote in message > news:4060911f_3@newsprd01... > > You could also search this ng for code. What you want to do has been > > dicussed before. > > > > -- > > ---- > > Ed > > ---- > > "R. Robert Bell" wrote in message > > news:40608dea$1_2@newsprd01... > > > Use a filtered selection set to get the ExternalReference objects that > you > > > need to change the Path property on. > > > > > > -- > > > R. Robert Bell > > > > > > > > > "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 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
0 Likes
Message 10 of 11

Anonymous
Not applicable
I would recommend using Reference Manager (external app available to 2004/2005, 2002 if you are a subscriber) for most such path issues. The only place you can get to the path in VBA is thru an inserted XRef. -- R. Robert Bell "Steven Craig Basham" wrote in message news:40609c05_1@newsprd01... One more thing... wouldn't this only allow me to edit only those xrefs that are loaded and inserted? Under the Xref manager there are xrefs that are 'known about' but are currently unloaded... I need to modify those paths as well... any further explations would be greatly appreciated! Thank you so much, Steven Craig Basham "R. Robert Bell" wrote in message news:40608dea$1_2@newsprd01... > Use a filtered selection set to get the ExternalReference objects that you > need to change the Path property on. > > -- > R. Robert Bell > > > "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 > > > > > > > > > > >
0 Likes
Message 11 of 11

Anonymous
Not applicable
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 > > > > > > > > > >
0 Likes