StructureEditor Namespace
SetReplaceSelected Method
The Item Id of the item which is to be replaced.
The Revision of the item which is to be replaced.
The filename of the item which is to be replaced.
The Item Id of the item by which item will be replaced.
The Revision of the item by which item will be replaced.
The filename of the item by which item will be replaced.
The revision rule to be applied on the document.
The Item ID of the parent from which item will be replaced.
The Revision of the parent from which item will be replaced.
The filename of the parent from which item will be replaced.
The FOA member name of the file which is to be replaced.
The FOA member name of the file by which item will be replaced.
Description
This API is used to replace the existing item with new item.
Syntax
Visual Basic
Public Function SetReplaceSelected( _
   ByVal bstrSourceItemId As String, _
   ByVal bstrSourceItemRev As String, _
   ByVal bstrSourceDataSetFileName As String, _
   ByVal bstrTargetItemId As String, _
   ByVal bstrTargetItemRev As String, _
   ByVal bstrTargetDataSetFileName As String, _
   ByVal bstrRevisionRule As String, _
   ByVal bstrParentItemId As String, _
   ByVal bstrParentItemRev As String, _
   ByVal bstrParentDataSetFileName As String, _
   ByVal bstrSrcFOAMemberName As String, _
   ByVal bstrTgtFOAMemberName As String _
) As Long
Parameters
bstrSourceItemId
The Item Id of the item which is to be replaced.
bstrSourceItemRev
The Revision of the item which is to be replaced.
bstrSourceDataSetFileName
The filename of the item which is to be replaced.
bstrTargetItemId
The Item Id of the item by which item will be replaced.
bstrTargetItemRev
The Revision of the item by which item will be replaced.
bstrTargetDataSetFileName
The filename of the item by which item will be replaced.
bstrRevisionRule
The revision rule to be applied on the document.
bstrParentItemId
The Item ID of the parent from which item will be replaced.
bstrParentItemRev
The Revision of the parent from which item will be replaced.
bstrParentDataSetFileName
The filename of the parent from which item will be replaced.
bstrSrcFOAMemberName
The FOA member name of the file which is to be replaced.
bstrTgtFOAMemberName
The FOA member name of the file by which item will be replaced.
Remarks
Call this API after calling open () API. Because for calling this API a solid edge file needs to be opened in the structure editor application. If the action is set without opening a solid edge file in the application then nothing will happen. If user wants to replace multiple files then the above code needs to be called multiple times.
Example
Imports System.IO
Imports System.Runtime.InteropServices

Module Example
    <STAThread()> _
    Sub Main()
        Dim objApplication As StructureEditor.Application = Nothing
        Dim objStructureEditor As StructureEditor.SEECStructureEditor = Nothing
        Dim strUserName As String
        Dim strPassword As String
        Dim strGroup As String
        Dim strRole As String
        Dim strURL As String
        'Dim strItemId As String
        'Dim strItemRev As String
        'Dim strFileName As String
        Dim strRevisionRule As String
        Dim strFolderName As String
        Dim strSrcItemId As String
        Dim strSrcItemRev As String
        Dim strSrcFileName As String
        Dim strTgtItemId As String
        Dim strTgtItemRev As String
        Dim strTgtFileName As String
        'Dim RevisionRule As String
        Dim strPrntItemId As String
        Dim strPrntItemRev As String
        Dim strPrntFileName As String
        Dim strSrcFOAMember As String
        Dim strTgtFOAMember As String

        Try
            OleMessageFilter.Register()

            ' Start structure editor application
            objApplication = Activator.CreateInstance(Type.GetTypeFromProgID("StructureEditor.Application"))
            objStructureEditor = objApplication.SEECStructureEditor
            objApplication.Visible = True

            strUserName = "Username"
            strPassword = ""
            strGroup = ""
            strRole = ""
            strURL = "http://Servername:8085/tc"

            If objStructureEditor.ValidateLogin(strUserName, strPassword, strGroup, strRole, strURL) = 0 Then
                strPrntItemId = "081691"
                strPrntItemRev = "A"
                strPrntFileName = "a.asm"
                strRevisionRule = "Latest Working"
                strFolderName = ""

                If objStructureEditor.Open(strPrntItemId, strPrntItemRev, strPrntFileName, strRevisionRule, strFolderName) = 0 Then
                    strSrcItemId = "219350"
                    strSrcItemRev = "A"
                    strSrcFileName = "219350.par"
                    strSrcFOAMember = Nothing
                    strTgtItemId = "222777"
                    strTgtItemRev = "A"
                    strTgtFileName = "222777.par"
                    strTgtFOAMember = Nothing

                    objStructureEditor.SetReplaceSelected(strSrcItemId, _
                                                          strSrcItemRev, _
                                                          strSrcFileName, _
                                                          strTgtItemId, _
                                                          strTgtItemRev, _
                                                          strTgtFileName, _
                                                          strRevisionRule, _
                                                          strPrntItemId, _
                                                          strPrntItemRev, _
                                                          strPrntFileName, _
                                                          strSrcFOAMember, _
                                                          strTgtFOAMember)
                End If
            End If
        Catch ex As Exception
            Console.WriteLine(ex.Message)
        Finally
            If Not objApplication Is Nothing Then
                ' Kill the instance of structure editor created
                objApplication.Quit()
            End If

            OleMessageFilter.Revoke()
        End Try
    End Sub
End Module
See Also

ISEECStructureEditor Object  | ISEECStructureEditor Members  | Solid Edge ST2 - What's New