RsInstructionArgumentCollection Class |
Namespace: ABB.Robotics.RobotStudio.Stations
public class RsInstructionArgumentCollection : ICollection, IEnumerable, IEnumerable<RsInstructionArgument>
The RsInstructionArgumentCollection type exposes the following members.
Name | Description | |
---|---|---|
Count | ||
IsSynchronized | ||
ItemInt32 | ||
ItemString |
Gets the named item in the collection
| |
Parent | ||
SyncRoot |
Name | Description | |
---|---|---|
Add |
Add a RsInstructionArgument to the collection.
| |
Contains(String) |
Check to see if a named item is part of the collection.
| |
Contains(RsInstructionArgument) | ||
CopyTo(Array, Int32) | ||
CopyTo(RsInstructionArgument, Int32) | ||
Equals | (Inherited from Object.) | |
Finalize | (Inherited from Object.) | |
GetEnumerator | ||
GetHashCode | (Inherited from Object.) | |
GetType | (Inherited from Object.) | |
MemberwiseClone | (Inherited from Object.) | |
Remove |
Removes a RsInstructionArgument from the collection.
| |
ToArray | ||
ToString | (Inherited from Object.) | |
TryGetInstructionArgument | Gets the argument with the specified name. |
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(); }