Click or drag to resize
RsInstructionArgument Constructor
Creates and initializes a new RsInstructionArgument object.

Namespace:  ABB.Robotics.RobotStudio.Stations
Assembly:  ABB.Robotics.RobotStudio.Stations (in ABB.Robotics.RobotStudio.Stations.dll) Version: 7.0.8747.636
Syntax
C#
public RsInstructionArgument(
	string name,
	string value
)

Parameters

name
Type: SystemString
The name of the RsInstructionArgument to create.
value
Type: SystemString
The value of the RsInstructionArgument to create.

Return Value

Type: 
The new RsInstructionArgument object.
Examples
Create RsInstructionArgument.
RsInstructionArgument Example
Project.UndoContext.BeginUndoStep("RsInstructionArgumentExample");
try
{
    Station station = Station.ActiveStation;

    // Create a RsPathProcedure and add it to the ActiveTask.
    RsPathProcedure myPath = new RsPathProcedure("myPath");
    station.ActiveTask.PathProcedures.Add(myPath);

    // Create a new RobTarget and add it to the ActiveTask.
    RsRobTarget myRobTarget = new RsRobTarget();
    myRobTarget.Name = station.ActiveTask.GetValidRapidName("myRobTarget", "_", 1);
    station.ActiveTask.DataDeclarations.Add(myRobTarget);

    // Create a linear move instruction using the move definition and the default template.
    RsMoveInstruction myMoveL = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", myRobTarget.Name, "tool0");
    myPath.Instructions.Add(myMoveL);

    // Output some information regarding the MoveInstruction to the logger.
    Logger.AddMessage(new LogMessage("The MoveInstruction'" + myMoveL.Name + "' has the following InstructionArguments"));

    foreach (RsInstructionArgument instrArg in myMoveL.InstructionArguments)
    {
        Logger.AddMessage(new LogMessage("The InstructionArgument '" + instrArg.Name +
                                         "' has value = '" + instrArg.Value +
                                         "' and is enabled:'" + instrArg.Enabled.ToString() + "'"));
    }

    if (myMoveL.InstructionArguments.Contains("ToPoint"))
    {
        Logger.AddMessage(new LogMessage("The collection contains the ToPoint argument!"));
    }
    else
    {
        Logger.AddMessage(new LogMessage("The collection does not contain the ToPoint argument!"));
    }

    RsInstructionArgument myInstrArg;
    if (myMoveL.InstructionArguments.TryGetInstructionArgument("ToPoint", out myInstrArg))
    {
        Logger.AddMessage(new LogMessage("The value of the ToPoint argument is: '" + myInstrArg.Value + "'"));
    }
    else
    {
        Logger.AddMessage(new LogMessage("Could not get the ToPoint argument!"));
    }
}
catch
{
    Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
    throw;
}
finally
{
    Project.UndoContext.EndUndoStep();
}
Version Information

Supported in: 1.0.0.0
See Also