04-10-2019
11:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
04-10-2019
11:18 AM
Hello,
Try the rule below:
oThisDoc = ThisDoc.Document
oThisFileName = ThisDoc.FileName(False) & ".ipt"
IPJ = ThisApplication.FileLocations.FileLocationsFile
IPJ_Folder_Location = Left(IPJ, Len(IPJ) - Len(IPJ_Name))
Dim Folder As New IO.DirectoryInfo(IPJ_Folder_Location)
Dim FileList As New List(Of String)
For Each File As IO.FileInfo In Folder.GetFiles(oThisFileName,IO.SearchOption.AllDirectories)
If File.FullName.Contains(oThisFileName) = True Then
FileList.Add(File.FullName)
NieuwFilePath = File.FullName
doc = ThisDoc.Document
'Change the Referenced File'
oFD = doc.ReferencedFileDescriptors(1).DocumentDescriptor.ReferencedFileDescriptor
oFD.ReplaceReference(NieuwFilePath)
Else
MsgBox("the file " & oThisFileName & " not found in this project!")
End If
Next
iLogicVb.UpdateWhenDone = True
InventorVb.DocumentUpdate()