GefProcAction.SetToInvokeMethod (method)

Configures the action to invoke a method on an ActiveX control.
Syntax: object.SetToInvokeMethod ObjectName, MethodName, ResultPoint, ArgumentExprs, ArgumentSetpoints
Parameters:
ObjectName As String -
MethodName As String -
Optional ResultPoint As String -
Optional ArgumentExprs As SAFEARRAY(BSTR)* -
Optional ArgumentSetpoints As SAFEARRAY(VARIANT_BOOL)* -
Description: Changes the Type of the action to GefActionInvokeMethod.

The arguments correspond to the fields in the action panel of the Procedure Information dialog box.

The arrayArgumentExpressions parameter is an array of String values. The arrayArgumentSetpoints parameter is an array of Boolean values.

Example:

Sub GefProcAction_SetToInvokeMethod()
    Dim oCimObj As GefObject
    Dim oCimProceduresObj As GefProcedures
    Dim oCimProcedObj As GefProcedure
    Dim oCimProcActs As GefProcActions
    Dim oCimProcActNew As GefProcAction
    
    Set oCimObj = CimGetObject
    Set oCimProceduresObj = oCimObj.Procedures
    
    If oCimProceduresObj.Count > 0 Then
        Set oCimProcedObj = oCimProceduresObj.Item(0)
    
        Set oCimProcActs = oCimProcedObj.Actions
    
        Dim argExrArray As Variant
        Dim argSetptArray As Variant
    
        Set argExrArray = CimCreateSafeArray()
        Set argSetptArray = CimCreateSafeArray()
    
        argExrArray.CreateVector cimVString, 0, 2
        argSetptArray.CreateVector cimVBoolean, 0, 2
    
        argExrArray.SetVectorElement 0, """WT_Zone11"""
        argExrArray.SetVectorElement 1, """WT_Zone11"""
        argSetptArray.SetVectorElement 0, False
        argSetptArray.SetVectorElement 1, False
    
        Set oCimProcActNew = oCimProcActs.Add(gefActionInvokeMethod)
    
        oCimProcActNew.SetToInvokeMethod oCimObj.Name, "AddDynPointLine", "", argExrArray, argSetptArray
    
        Dim Args(0 To 0) As String
        Dim ArgDoSetPoints(0 To 0) As Boolean
    
        Args(0) ="""WT_Zone11"""
    
        ArgDoSetPoints(0) = False
    
        Set oCimProcActNew = oCimProcActs.Add(gefActionInvokeMethod)
        oCimProcActNew.SetToInvokeMethod oCimObj.Name, "DeleteTrendLine", "", Args, ArgDoSetPoints
    
    End If
End Sub
See Also: GetInvokeMethod