ICommandSystem.Create [Method]
- Last UpdatedJul 18, 2023
- 1 minute read
Creates a new Command object that is added to the CommandSystem.
Defined As
-
[VBA] object Create (commandID As String, buttonType As Integer, tooltip As String, iconPath As String, privilege As Integer)
-
[Cicode] OBJECT Create (STRING commandID, INT buttonType, STRING tooltip, STRING iconPath, INT Privilege)
-
[C++] HRESULT Create (BSTR commandID, ToolbarButtonType ButtonType, BSTR tooltip, BSTR iconPath, int privilege, ICommand** Val)
Parameters
commandID
[in] A unique identifier for this command (1-64 characters).
buttonType
[in] A value representing a button type.
-
ToolbarButtonType_Push = 0
-
ToolbarButtonType_Toggle = 1
-
ToolbarButtonType_Separator = 2
tooltip
[in] The text to be displayed as a tooltip for this command (1-64 characters).
iconPath
[in] The path to an icon file that will be used as this command's picture.
privilege
[in] A privilege value necessary by the Plant SCADA user to gain access to this command (0-8).
Execution Result
If the method succeeds, the return value is Success. If an argument is invalid or out of range, the return value is InvalidArgument. If the command was not created, the return value is GeneralFailure.
Remarks
The commandID cannot begin with the prefix "Citect_".
Calling Syntax
This example assumes there is a valid CommandSystem object as retrieved from a Process Analyst. (for example, VBA: ProcessAnalyst.CommandSystem).
[VBA]
Sub Example(CommandSystem As Object)
Dim command As Object
Set command = CommandSystem.Create("Custom_CommandID1", 0, "Some tooltip text", "c:\someicon.ico",
5)
End Sub
[Cicode]
FUNCTION Example(OBJECT hCommandSystem)
OBJECT hCommand = _ObjectCallMethod(hCommandSystem, "Create", "Custom_CommandID1",
0, "Some tooltip text", "c:\someicon.ico", 5);
END