StructureEditor Namespace
AddItemToGivenProjects Method
The Item Id which is to add in given projects.
The revision of Item of which is to add in given projects.
The File name of the item of which is to add in given projects.
The Projects in which the given item to be added.
Description
This API is used to add the Item to given projects.
Syntax
Visual Basic
Public Function AddItemToGivenProjects( _
   ByVal bstrItemId As String, _
   ByVal bstrItemRev As String, _
   ByVal bstrDataSetFileName As String, _
   ByVal bstrUserProjects As String _
) As Long
Parameters
bstrItemId
The Item Id which is to add in given projects.
bstrItemRev
The revision of Item of which is to add in given projects.
bstrDataSetFileName
The File name of the item of which is to add in given projects.
bstrUserProjects
The Projects in which the given item to be added.
Remarks
This API will take the multiple projects as Input, which are separated by semicolon. To Add the Item to the projects with the help of this API, user has to first open the given Item Id, Set save As selected, Assign All and then this API should called. And finally perform action should gets called. When we do Save As selected on given Item by default projects of given item are assigned to new item. With the help of this API user will get privileged to add the new item in the projects he wants and not the default ones of parent item.
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 strProjects 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
                strItemId = "002262"
                strItemRev = "A"
                strFileName = "002262.par"
                strProjects = "1987;1996;2000"

                objStructureEditor.AddItemToGivenProjects(strItemId, strItemRev, strFileName, strProjects)
            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 ST3 - What's New