Solid Edge Revision Manager Object Library
SetPath Method
Specifies the new full path of a linked document.
Description
This method sets the full path of the referenced linked document object without changing the geometric version, thereby allowing files to be moved and stay up-to-date.
Syntax
Visual Basic
Public Function SetPath( _
   ByVal NewFileName As String _
) As Long
Parameters
NewFileName
Specifies the new full path of a linked document.
Example
Imports System.IO
Imports System.Runtime.InteropServices

Module Example

    Sub Main()
        Dim objApplication As RevisionManager.Application = Nothing
        Dim objDocument As RevisionManager.Document = Nothing
        Dim objLinkedDocuments As RevisionManager.LinkedDocuments = Nothing
        Dim objLinkedDocument As RevisionManager.Document = Nothing
        Dim objAssemblyFileInfo As FileInfo
        Dim objLinkedDocumentFileInfo As FileInfo

        Try
            objAssemblyFileInfo = New FileInfo("C:\Test\Asm1.asm")
            objApplication = New RevisionManager.Application
            objDocument = objApplication.Open(objAssemblyFileInfo.FullName)
            objLinkedDocuments = objDocument.LinkedDocuments

            For Each objLinkedDocument In objLinkedDocuments
                ' Get current path to linked document
                objLinkedDocumentFileInfo = New FileInfo(objLinkedDocument.FullName)
                ' Change path to new location
                objLinkedDocumentFileInfo = New FileInfo(Path.Combine("C:\Test\NewPath", objLinkedDocumentFileInfo.Name))
                ' Update link
                Call objLinkedDocument.SetPath(objLinkedDocumentFileInfo.FullName)

            Next

            objDocument.SaveAllLinks()
            objApplication.Quit()

        Catch ex As Exception
            Console.WriteLine(ex.Message)
        End Try
    End Sub

End Module
See Also

IDocAuto Object  | IDocAuto Members