Solid Edge Framework Type Library
GetSmartCodes Method
This is two dimensional array. Each row contains data per document. Each column will contain in and out information.
Description
Gets Smart Codes from server
Syntax
Visual Basic
Public Sub GetSmartCodes( _
   ByRef pvarSmartCodesInfo As Variant _
) 
Parameters
pvarSmartCodesInfo
This is two dimensional array. Each row contains data per document. Each column will contain in and out information.
Remarks
ST2 provides smart code support. This API will return smart codes information such as Smart Code Number, revision, container wise properties in XML string format required for field set and unget information in XML string format required for resetting assigned smart codes. Caller should provide unique ID (it can be document name) and item type to this API. This API will show smart code dialog. Caller should create two dimensional array with 6 columns otherwise API fails with invalid argument. For a document, First column represents unique ID. (in) This is mandatory.Second column represents item type. (in) This is mandatory.Third column represents Smart Code Number. (out)Fourth column represents revision. (out)Fifth column represents container wise properties in XML string required for field set. (out)Sixth column represents unget XML string required for resetting assigned smart code.
Example
Option Explicit

Sub Example()
    Dim objApplication As SolidEdgeFramework.Application
    Dim objTCE As SolidEdgeFramework.SolidEdgeTCE
    'Example takes two dimensional array with two rows ( two documents) and 6 columns
    Dim SmartCodesInfo(1, 5) As Object
    'Example extracts return info for one row i.e. one document
    Dim sSmartCode As String
    Dim sRevision As String
    Dim sContainerWiseXML As String
    Dim sUngetXML As String

    Set objApplication = GetObject(, "SolidEdge.Application")
    Set objTCE = objApplication.SolidEdgeTCE

    SmartCodesInfo(0, 0) = "Assign1"    'Input - Unique ID
    SmartCodesInfo(0, 1) = "Item"       'Input - Item Type
    SmartCodesInfo(0, 2) = Nothing      'Output ? Smart Code Number
    SmartCodesInfo(0, 3) = Nothing      'Output - Revision
    SmartCodesInfo(0, 4) = Nothing      'Output ? Container wise props in XML string
    SmartCodesInfo(0, 5) = Nothing      'Output ? Unget info in XML string

    SmartCodesInfo(1, 0) = "Assign2"    'Unique ID
    SmartCodesInfo(1, 1) = "Item"       'Item Type
    SmartCodesInfo(1, 2) = Nothing
    SmartCodesInfo(1, 3) = Nothing
    SmartCodesInfo(1, 4) = Nothing
    SmartCodesInfo(1, 5) = Nothing

    Call objTCE.GetSmartCodes(SmartCodesInfo)

    sSmartCode = SmartCodesInfo(0, 2)           'Smart Code Number
    sRevision = SmartCodesInfo(0, 3)            'Revision
    sContainerWiseXML = SmartCodesInfo(0, 4)    'Containerwise property XML string
    sUngetXML = SmartCodesInfo(0, 5)            'Ungetinfo XML string

    If Not objApplication Is Nothing Then
        Call objApplication.Quit
    End If
    
    Set objTCE = Nothing
    Set objApplication = Nothing
End Sub
See Also

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