* Not necessarily first drawing view.
If BOM was placed before drawing views, it will replace the BOM reference.
Model references are generally easier to replace using the UI functionality, but can be done through API using pball's method as well.
Sub Test()
Call ReplaceFileReference(ThisDoc.Document, "C:\PartA.ipt", "C:\PartB.ipt")
End Sub
Sub ReplaceFileReference(oDoc as Document, oRefToRemove As String, oRefToInclude As String)
For Each oFD In oDoc.File.ReferencedFileDescriptors
If oFD.FullFileName = oRefToRemove
oFD.ReplaceReference(oRefToInclude)
End if
Next
End Sub
--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.