Solid Edge User want to call a code on click of Assign All button on Teamcenter Save-As

2021-10-06T23:59:00Z
PART/SHEETMETAL

Summary


Details

User want to call a code on click of Assign All button on Teamcenter Save-As

Solution

We have published API with name AssignAll() that need to call in custom code as below,

Sub Main()
        Dim objApplication As StructureEditor.Application = Nothing
        Dim objStructureEditor As StructureEditor.SEECStructureEditor = Nothing
        Dim strItemId As String
        Dim strItemRev As String
        Dim strFileName As String
        Dim strRevisionRule As String
        Dim strFolderName As String

        Try
            OleMessageFilter.Register()

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

            strItemId = "081691"
            strItemRev = "A"
            strFileName = "a.asm"
            strRevisionRule = "Latest Working"
            strFolderName = ""

            If objStructureEditor.Open(strItemId, strItemRev, strFileName, strRevisionRule, strFolderName) = 0 Then
                If objStructureEditor.SetReviseSelected(strItemId, strItemRev, strFileName) = 0 Then
                    objStructureEditor.AssignAll()
                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

Hardware/Software Configuration

Platform: AMD64
OS: windows
OS Version: 1064
Product: SOLID_EDGE
Application: AUTOMATION
Version: V221.0
Function: API_DOCUMENT

Ref: 002-8565082

KB Article ID# PL8565082

Contents

SummaryDetails

Associated Components

PART/SHEETMETAL: FEATURES