STK X Send comments on this topic.
ExecuteMultipleCommands Method (AgSTKXApplication)
See Also  Example
ConnectCommands
an array of Connect commands.
EAction
Bitmask specifies flags used to control the behavior of the method when an error occurs
while executing a command. Sometimes it is desirable to stop the batch processing immediatelly
or continue running the remaining commands in the batch.
Windows






Windows & Linux

Description

Allows the batch processing of multiple connect commands.

HRESULT ExecuteMultipleCommands(
[in] SAFEARRAY(VARIANT)* ConnectCommands,
[in] enum AgEExecMultiCmdResultAction eAction,
[out, retval] IAgExecMultiCmdResult** ppResult);

Syntax

[Visual Basic .NET]
Public Function ExecuteMultipleCommands( _
   ByRef ConnectCommands As System.Array, _
   ByVal EAction As AgEExecMultiCmdResultAction _
) As IAgExecMultiCmdResult

[C#]
public IAgExecMultiCmdResult ExecuteMultipleCommands(
ref System.Array ConnectCommands,
AgEExecMultiCmdResultAction EAction
);

[Managed C++]
public: IAgExecMultiCmdResult^ ExecuteMultipleCommands(
System::Array ^^ ConnectCommands,
AgEExecMultiCmdResultAction EAction
);

[Java]
public IAgExecMultiCmdResult executeMultipleCommands(
Object[] ConnectCommands,
AgEExecMultiCmdResultAction EAction
);

[Unmanaged C++]
public: HRESULT ExecuteMultipleCommands(
SAFEARRAY ** ConnectCommands,
AgEExecMultiCmdResultAction EAction,
IAgExecMultiCmdResult ** ReturnValue
);

Parameters

ConnectCommands
an array of Connect commands.
EAction
Member Value Description
eContinueOnError 0 Continue executing the remaining commands in the command batch.
eStopOnError 1 Terminate the execution of the command batch but do not throw an exception.
eExceptionOnError 2 Terminate the execution of the command batch and throw an exception.
eIgnoreExecCmdResult 32768 Ignore results returned by individual commands. The option must be used in combination with other flags.
Bitmask specifies flags used to control the behavior of the method when an error occurs
while executing a command. Sometimes it is desirable to stop the batch processing immediatelly
or continue running the remaining commands in the batch.

Return Type

ppResult - upon return, contains a pointer to the IAgExecMultiCmdResult object. Instances of IAgExecMultiCmdResult allow users to access the status and results of each command.

Example

[C#] Copy Code
System.Array commands = new object[]{ "New / */Satellite ERS1",
   "New / */Satellite/ERS1/Sensor sens1", "AllInstanceNames /" };
AGI.STKUtil.AgExecMultiCmdResult results =
   stkRoot.ExecuteMultipleCommands(ref commands,
   AGI.STKUtil.AgEExecMultiCmdResultAction.eContinueOnError);

for (int i = 0; i < results.Count; i++)
{
    Console.WriteLine("command " + i + " succeeded " +
       results[i].IsSucceeded);
}
[Visual Basic .NET] Copy Code
Dim commands(2)
commands(0) = "New / */Satellite ERS1"
commands(1) = "New / */Satellite/ERS1/Sensor sens1"
commands(2) = "AllInstancesNames /"

Dim results As AGI.STKUtil.AgExecMultiCmdResult
results = AgUiAxVOCntrl1.Application.ExecuteMultipleCommands(commands,
   AGI.STKUtil.AgEExecMultiCmdResultAction.eContinueOnError)

For Each res As AGI.STKUtil.AgExecCmdResult In results
   Console.Write("command succeeded: ")
   Console.WriteLine(res.IsSucceeded)
Next res

See Also

© 2017 Analytical Graphics, Inc. All Rights Reserved.

STK 11.2.1 Programming Interface