Use the GetCommands
method to retrieve a list of all available commands on an object. Additionally use the ToList()
method to display any information associated with the object. When you send a command, use the command.CommandId
parameter. The command.Items
property lists all of these values including their title and type.
Library method name |
GetCommands
|
---|---|
Description | Get all commands on an object. |
Method signature |
IEnumerable<Command> GetCommands(Guid id);
|
Method input parameters |
id : the object GUID the method targets to obtain a list of possible commands. |
Return value | A collection of Command objects. |
The following .NET C# code is an example of a successful response to get commands:
List<Command> commands = client.GetCommands(objectId).ToList();
Command command = commands.FindById("Adjust"); // Adjust
Console.WriteLine(command);
/*
{
"Title": "Adjust",
"TitleEnumerationKey": "commandIdEnumSet.adjustCommand",
"CommandId": "Adjust",
"Items": [
{
"Title": "Value",
"Type": "number",
"EnumerationValues": null,
"Minimum": null,
"Maximum": null
}
]
}
*/