Class RsPathProcedure
An RsPathProcedure is a sequence of move and action instructions. Paths are used to make the robot move along a sequence of targets. An RsPathsProcedure corresponds to a to RAPID procedure and is synchronized to the virtual controller.
Implements
Inherited Members
Namespace: ABB.Robotics.RobotStudio.Stations
Assembly: ABB.Robotics.RobotStudio.Stations.dll
Syntax
sistent("PathProcedureDeclaration")]
public sealed class RsPathProcedure : ProjectObject, ISupportCopy, IGfxObject, IDeclaration
Examples
RsPathProcedure example.
// NOTE: This example requires a station containing an IRB_140 and a running VC.
Project.UndoContext.BeginUndoStep("RsPathProcedureExample");
try
{
Station station = Station.ActiveStation;
// Create a PathProcedure.
RsPathProcedure myPath = new RsPathProcedure("myPath");
// Add the path to the ActiveTask.
station.ActiveTask.PathProcedures.Add(myPath);
myPath.ModuleName = "MyModule";
myPath.ShowName = true;
myPath.Synchronize = true;
myPath.Visible = true;
// Create the first RobTarget.
RsRobTarget target1 = new RsRobTarget();
// Set the name of the RobTarget.
target1.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
// Set the position and rotation of the RobTarget.
target1.Frame.X = 0.50629;
target1.Frame.Y = 0;
target1.Frame.Z = 0.67950;
target1.Frame.RX = Globals.DegToRad(180); // From ABB.Robotics.Math
target1.Frame.RY = Globals.DegToRad(60);
target1.Frame.RZ = Globals.DegToRad(180);
// Add the RobTarget to the DataDeclarations of the ActiveTask.
station.ActiveTask.DataDeclarations.Add(target1);
// Create an RsTarget for the RobTarget.
RsTarget homeRsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target1);
homeRsTarget.Name = target1.Name;
// Add it to the ActiveTask.
station.ActiveTask.Targets.Add(homeRsTarget);
// Create a MoveInstruction for the RobTarget.
RsMoveInstruction homeInstr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target1.Name, "tool0");
// Add it to myPath.
myPath.Instructions.Add(homeInstr);
// Create the second RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target2 = new RsRobTarget();
target2.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target2.Frame.X = 0.500;
target2.Frame.Y = 0.125;
target2.Frame.Z = 0.700;
target2.Frame.RX = Globals.DegToRad(180);
target2.Frame.RY = Globals.DegToRad(60);
target2.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target2);
RsTarget trg1RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target2);
trg1RsTarget.Name = target2.Name;
station.ActiveTask.Targets.Add(trg1RsTarget);
RsMoveInstruction trg1Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target2.Name, "tool0");
myPath.Instructions.Add(trg1Instr);
// Create the third RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target3 = new RsRobTarget();
target3.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target3.Frame.X = 0.500;
target3.Frame.Y = 0.125;
target3.Frame.Z = 0.500;
target3.Frame.RX = Globals.DegToRad(180);
target3.Frame.RY = Globals.DegToRad(60);
target3.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target3);
RsTarget trg2RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target3);
trg2RsTarget.Name = target3.Name;
station.ActiveTask.Targets.Add(trg2RsTarget);
RsMoveInstruction trg2Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target3.Name, "tool0");
myPath.Instructions.Add(trg2Instr);
// Create the fourth RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target4 = new RsRobTarget();
target4.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target4.Frame.X = 0.500;
target4.Frame.Y = 0.200;
target4.Frame.Z = 0.500;
target4.Frame.RX = Globals.DegToRad(180);
target4.Frame.RY = Globals.DegToRad(60);
target4.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target4);
RsTarget trg3RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target4);
trg3RsTarget.Name = target4.Name;
station.ActiveTask.Targets.Add(trg3RsTarget);
RsMoveInstruction trg3Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target4.Name, "tool0");
myPath.Instructions.Add(trg3Instr);
// Create the fifth RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target5 = new RsRobTarget();
target5.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target5.Frame.X = 0.500;
target5.Frame.Y = 0.400;
target5.Frame.Z = 0.500;
target5.Frame.RX = Globals.DegToRad(180);
target5.Frame.RY = Globals.DegToRad(60);
target5.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target5);
RsTarget trg4RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target5);
trg4RsTarget.Name = target5.Name;
station.ActiveTask.Targets.Add(trg4RsTarget);
RsMoveInstruction trg4Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target5.Name, "tool0");
myPath.Instructions.Add(trg4Instr);
// Create the sixth RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target6 = new RsRobTarget();
target6.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target6.Frame.X = 0.500;
target6.Frame.Y = 0.400;
target6.Frame.Z = 0.700;
target6.Frame.RX = Globals.DegToRad(180);
target6.Frame.RY = Globals.DegToRad(60);
target6.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target6);
RsTarget trg5RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target6);
trg5RsTarget.Name = target6.Name;
station.ActiveTask.Targets.Add(trg5RsTarget);
RsMoveInstruction trg5Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target6.Name, "tool0");
myPath.Instructions.Add(trg5Instr);
// Move along the path.
if (await myPath.MoveAlongAsync(null))
{
Logger.AddMessage(new LogMessage("Move along path '" + myPath.Name + "' succeded!"));
}
else
{
Logger.AddMessage(new LogMessage("Move along path '" + myPath.Name + "' failed!"));
}
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
Constructors
RsPathProcedure(String)
Creates and initializes a new RsPathProcedure object.
Declaration
public RsPathProcedure(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the RsPathProcedure to create. |
Examples
Create RsPathProcedure.
// NOTE: This example requires a station containing an IRB_140 and a running VC.
Project.UndoContext.BeginUndoStep("RsPathProcedureExample");
try
{
Station station = Station.ActiveStation;
// Create a PathProcedure.
RsPathProcedure myPath = new RsPathProcedure("myPath");
// Add the path to the ActiveTask.
station.ActiveTask.PathProcedures.Add(myPath);
myPath.ModuleName = "MyModule";
myPath.ShowName = true;
myPath.Synchronize = true;
myPath.Visible = true;
// Create the first RobTarget.
RsRobTarget target1 = new RsRobTarget();
// Set the name of the RobTarget.
target1.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
// Set the position and rotation of the RobTarget.
target1.Frame.X = 0.50629;
target1.Frame.Y = 0;
target1.Frame.Z = 0.67950;
target1.Frame.RX = Globals.DegToRad(180); // From ABB.Robotics.Math
target1.Frame.RY = Globals.DegToRad(60);
target1.Frame.RZ = Globals.DegToRad(180);
// Add the RobTarget to the DataDeclarations of the ActiveTask.
station.ActiveTask.DataDeclarations.Add(target1);
// Create an RsTarget for the RobTarget.
RsTarget homeRsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target1);
homeRsTarget.Name = target1.Name;
// Add it to the ActiveTask.
station.ActiveTask.Targets.Add(homeRsTarget);
// Create a MoveInstruction for the RobTarget.
RsMoveInstruction homeInstr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target1.Name, "tool0");
// Add it to myPath.
myPath.Instructions.Add(homeInstr);
// Create the second RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target2 = new RsRobTarget();
target2.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target2.Frame.X = 0.500;
target2.Frame.Y = 0.125;
target2.Frame.Z = 0.700;
target2.Frame.RX = Globals.DegToRad(180);
target2.Frame.RY = Globals.DegToRad(60);
target2.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target2);
RsTarget trg1RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target2);
trg1RsTarget.Name = target2.Name;
station.ActiveTask.Targets.Add(trg1RsTarget);
RsMoveInstruction trg1Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target2.Name, "tool0");
myPath.Instructions.Add(trg1Instr);
// Create the third RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target3 = new RsRobTarget();
target3.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target3.Frame.X = 0.500;
target3.Frame.Y = 0.125;
target3.Frame.Z = 0.500;
target3.Frame.RX = Globals.DegToRad(180);
target3.Frame.RY = Globals.DegToRad(60);
target3.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target3);
RsTarget trg2RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target3);
trg2RsTarget.Name = target3.Name;
station.ActiveTask.Targets.Add(trg2RsTarget);
RsMoveInstruction trg2Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target3.Name, "tool0");
myPath.Instructions.Add(trg2Instr);
// Create the fourth RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target4 = new RsRobTarget();
target4.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target4.Frame.X = 0.500;
target4.Frame.Y = 0.200;
target4.Frame.Z = 0.500;
target4.Frame.RX = Globals.DegToRad(180);
target4.Frame.RY = Globals.DegToRad(60);
target4.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target4);
RsTarget trg3RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target4);
trg3RsTarget.Name = target4.Name;
station.ActiveTask.Targets.Add(trg3RsTarget);
RsMoveInstruction trg3Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target4.Name, "tool0");
myPath.Instructions.Add(trg3Instr);
// Create the fifth RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target5 = new RsRobTarget();
target5.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target5.Frame.X = 0.500;
target5.Frame.Y = 0.400;
target5.Frame.Z = 0.500;
target5.Frame.RX = Globals.DegToRad(180);
target5.Frame.RY = Globals.DegToRad(60);
target5.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target5);
RsTarget trg4RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target5);
trg4RsTarget.Name = target5.Name;
station.ActiveTask.Targets.Add(trg4RsTarget);
RsMoveInstruction trg4Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target5.Name, "tool0");
myPath.Instructions.Add(trg4Instr);
// Create the sixth RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target6 = new RsRobTarget();
target6.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target6.Frame.X = 0.500;
target6.Frame.Y = 0.400;
target6.Frame.Z = 0.700;
target6.Frame.RX = Globals.DegToRad(180);
target6.Frame.RY = Globals.DegToRad(60);
target6.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target6);
RsTarget trg5RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target6);
trg5RsTarget.Name = target6.Name;
station.ActiveTask.Targets.Add(trg5RsTarget);
RsMoveInstruction trg5Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target6.Name, "tool0");
myPath.Instructions.Add(trg5Instr);
// Move along the path.
if (await myPath.MoveAlongAsync(null))
{
Logger.AddMessage(new LogMessage("Move along path '" + myPath.Name + "' succeded!"));
}
else
{
Logger.AddMessage(new LogMessage("Move along path '" + myPath.Name + "' failed!"));
}
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
Properties
DisplayName
Declaration
public override string DisplayName { get; }
Property Value
Type | Description |
---|---|
String |
Overrides
Instructions
Gets the collection of RsInstructionCollection objects.
Declaration
public RsInstructionCollection Instructions { get; }
Property Value
Type | Description |
---|---|
RsInstructionCollection |
Examples
Get Instructions.
// NOTE: This example requires a station containing an IRB_140 and a running VC.
Project.UndoContext.BeginUndoStep("RsPathProcedureExample");
try
{
Station station = Station.ActiveStation;
// Create a PathProcedure.
RsPathProcedure myPath = new RsPathProcedure("myPath");
// Add the path to the ActiveTask.
station.ActiveTask.PathProcedures.Add(myPath);
myPath.ModuleName = "MyModule";
myPath.ShowName = true;
myPath.Synchronize = true;
myPath.Visible = true;
// Create the first RobTarget.
RsRobTarget target1 = new RsRobTarget();
// Set the name of the RobTarget.
target1.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
// Set the position and rotation of the RobTarget.
target1.Frame.X = 0.50629;
target1.Frame.Y = 0;
target1.Frame.Z = 0.67950;
target1.Frame.RX = Globals.DegToRad(180); // From ABB.Robotics.Math
target1.Frame.RY = Globals.DegToRad(60);
target1.Frame.RZ = Globals.DegToRad(180);
// Add the RobTarget to the DataDeclarations of the ActiveTask.
station.ActiveTask.DataDeclarations.Add(target1);
// Create an RsTarget for the RobTarget.
RsTarget homeRsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target1);
homeRsTarget.Name = target1.Name;
// Add it to the ActiveTask.
station.ActiveTask.Targets.Add(homeRsTarget);
// Create a MoveInstruction for the RobTarget.
RsMoveInstruction homeInstr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target1.Name, "tool0");
// Add it to myPath.
myPath.Instructions.Add(homeInstr);
// Create the second RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target2 = new RsRobTarget();
target2.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target2.Frame.X = 0.500;
target2.Frame.Y = 0.125;
target2.Frame.Z = 0.700;
target2.Frame.RX = Globals.DegToRad(180);
target2.Frame.RY = Globals.DegToRad(60);
target2.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target2);
RsTarget trg1RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target2);
trg1RsTarget.Name = target2.Name;
station.ActiveTask.Targets.Add(trg1RsTarget);
RsMoveInstruction trg1Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target2.Name, "tool0");
myPath.Instructions.Add(trg1Instr);
// Create the third RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target3 = new RsRobTarget();
target3.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target3.Frame.X = 0.500;
target3.Frame.Y = 0.125;
target3.Frame.Z = 0.500;
target3.Frame.RX = Globals.DegToRad(180);
target3.Frame.RY = Globals.DegToRad(60);
target3.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target3);
RsTarget trg2RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target3);
trg2RsTarget.Name = target3.Name;
station.ActiveTask.Targets.Add(trg2RsTarget);
RsMoveInstruction trg2Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target3.Name, "tool0");
myPath.Instructions.Add(trg2Instr);
// Create the fourth RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target4 = new RsRobTarget();
target4.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target4.Frame.X = 0.500;
target4.Frame.Y = 0.200;
target4.Frame.Z = 0.500;
target4.Frame.RX = Globals.DegToRad(180);
target4.Frame.RY = Globals.DegToRad(60);
target4.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target4);
RsTarget trg3RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target4);
trg3RsTarget.Name = target4.Name;
station.ActiveTask.Targets.Add(trg3RsTarget);
RsMoveInstruction trg3Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target4.Name, "tool0");
myPath.Instructions.Add(trg3Instr);
// Create the fifth RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target5 = new RsRobTarget();
target5.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target5.Frame.X = 0.500;
target5.Frame.Y = 0.400;
target5.Frame.Z = 0.500;
target5.Frame.RX = Globals.DegToRad(180);
target5.Frame.RY = Globals.DegToRad(60);
target5.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target5);
RsTarget trg4RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target5);
trg4RsTarget.Name = target5.Name;
station.ActiveTask.Targets.Add(trg4RsTarget);
RsMoveInstruction trg4Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target5.Name, "tool0");
myPath.Instructions.Add(trg4Instr);
// Create the sixth RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target6 = new RsRobTarget();
target6.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target6.Frame.X = 0.500;
target6.Frame.Y = 0.400;
target6.Frame.Z = 0.700;
target6.Frame.RX = Globals.DegToRad(180);
target6.Frame.RY = Globals.DegToRad(60);
target6.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target6);
RsTarget trg5RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target6);
trg5RsTarget.Name = target6.Name;
station.ActiveTask.Targets.Add(trg5RsTarget);
RsMoveInstruction trg5Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target6.Name, "tool0");
myPath.Instructions.Add(trg5Instr);
// Move along the path.
if (await myPath.MoveAlongAsync(null))
{
Logger.AddMessage(new LogMessage("Move along path '" + myPath.Name + "' succeded!"));
}
else
{
Logger.AddMessage(new LogMessage("Move along path '" + myPath.Name + "' failed!"));
}
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
Local
Gets if the RsPathProcedue is declared local in a module. (Corresponds to the LOCAL keyword in RAPID).
Declaration
public bool Local { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
ModuleName
Gets or sets the RAPID module name that he RsPathProcedue will have when its syncronized to the VC
Declaration
public string ModuleName { get; set; }
Property Value
Type | Description |
---|---|
String |
Examples
Get/Set ModuleName.
// NOTE: This example requires a station containing an IRB_140 and a running VC.
Project.UndoContext.BeginUndoStep("RsPathProcedureExample");
try
{
Station station = Station.ActiveStation;
// Create a PathProcedure.
RsPathProcedure myPath = new RsPathProcedure("myPath");
// Add the path to the ActiveTask.
station.ActiveTask.PathProcedures.Add(myPath);
myPath.ModuleName = "MyModule";
myPath.ShowName = true;
myPath.Synchronize = true;
myPath.Visible = true;
// Create the first RobTarget.
RsRobTarget target1 = new RsRobTarget();
// Set the name of the RobTarget.
target1.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
// Set the position and rotation of the RobTarget.
target1.Frame.X = 0.50629;
target1.Frame.Y = 0;
target1.Frame.Z = 0.67950;
target1.Frame.RX = Globals.DegToRad(180); // From ABB.Robotics.Math
target1.Frame.RY = Globals.DegToRad(60);
target1.Frame.RZ = Globals.DegToRad(180);
// Add the RobTarget to the DataDeclarations of the ActiveTask.
station.ActiveTask.DataDeclarations.Add(target1);
// Create an RsTarget for the RobTarget.
RsTarget homeRsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target1);
homeRsTarget.Name = target1.Name;
// Add it to the ActiveTask.
station.ActiveTask.Targets.Add(homeRsTarget);
// Create a MoveInstruction for the RobTarget.
RsMoveInstruction homeInstr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target1.Name, "tool0");
// Add it to myPath.
myPath.Instructions.Add(homeInstr);
// Create the second RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target2 = new RsRobTarget();
target2.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target2.Frame.X = 0.500;
target2.Frame.Y = 0.125;
target2.Frame.Z = 0.700;
target2.Frame.RX = Globals.DegToRad(180);
target2.Frame.RY = Globals.DegToRad(60);
target2.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target2);
RsTarget trg1RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target2);
trg1RsTarget.Name = target2.Name;
station.ActiveTask.Targets.Add(trg1RsTarget);
RsMoveInstruction trg1Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target2.Name, "tool0");
myPath.Instructions.Add(trg1Instr);
// Create the third RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target3 = new RsRobTarget();
target3.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target3.Frame.X = 0.500;
target3.Frame.Y = 0.125;
target3.Frame.Z = 0.500;
target3.Frame.RX = Globals.DegToRad(180);
target3.Frame.RY = Globals.DegToRad(60);
target3.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target3);
RsTarget trg2RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target3);
trg2RsTarget.Name = target3.Name;
station.ActiveTask.Targets.Add(trg2RsTarget);
RsMoveInstruction trg2Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target3.Name, "tool0");
myPath.Instructions.Add(trg2Instr);
// Create the fourth RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target4 = new RsRobTarget();
target4.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target4.Frame.X = 0.500;
target4.Frame.Y = 0.200;
target4.Frame.Z = 0.500;
target4.Frame.RX = Globals.DegToRad(180);
target4.Frame.RY = Globals.DegToRad(60);
target4.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target4);
RsTarget trg3RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target4);
trg3RsTarget.Name = target4.Name;
station.ActiveTask.Targets.Add(trg3RsTarget);
RsMoveInstruction trg3Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target4.Name, "tool0");
myPath.Instructions.Add(trg3Instr);
// Create the fifth RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target5 = new RsRobTarget();
target5.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target5.Frame.X = 0.500;
target5.Frame.Y = 0.400;
target5.Frame.Z = 0.500;
target5.Frame.RX = Globals.DegToRad(180);
target5.Frame.RY = Globals.DegToRad(60);
target5.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target5);
RsTarget trg4RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target5);
trg4RsTarget.Name = target5.Name;
station.ActiveTask.Targets.Add(trg4RsTarget);
RsMoveInstruction trg4Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target5.Name, "tool0");
myPath.Instructions.Add(trg4Instr);
// Create the sixth RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target6 = new RsRobTarget();
target6.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target6.Frame.X = 0.500;
target6.Frame.Y = 0.400;
target6.Frame.Z = 0.700;
target6.Frame.RX = Globals.DegToRad(180);
target6.Frame.RY = Globals.DegToRad(60);
target6.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target6);
RsTarget trg5RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target6);
trg5RsTarget.Name = target6.Name;
station.ActiveTask.Targets.Add(trg5RsTarget);
RsMoveInstruction trg5Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target6.Name, "tool0");
myPath.Instructions.Add(trg5Instr);
// Move along the path.
if (await myPath.MoveAlongAsync(null))
{
Logger.AddMessage(new LogMessage("Move along path '" + myPath.Name + "' succeded!"));
}
else
{
Logger.AddMessage(new LogMessage("Move along path '" + myPath.Name + "' failed!"));
}
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
Name
Gets or Set the name of the PathProcedure.
Declaration
public override string Name { get; set; }
Property Value
Type | Description |
---|---|
String |
Overrides
Examples
Get/Set name.
// NOTE: This example requires a station containing an IRB_140 and a running VC.
Project.UndoContext.BeginUndoStep("RsPathProcedureExample");
try
{
Station station = Station.ActiveStation;
// Create a PathProcedure.
RsPathProcedure myPath = new RsPathProcedure("myPath");
// Add the path to the ActiveTask.
station.ActiveTask.PathProcedures.Add(myPath);
myPath.ModuleName = "MyModule";
myPath.ShowName = true;
myPath.Synchronize = true;
myPath.Visible = true;
// Create the first RobTarget.
RsRobTarget target1 = new RsRobTarget();
// Set the name of the RobTarget.
target1.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
// Set the position and rotation of the RobTarget.
target1.Frame.X = 0.50629;
target1.Frame.Y = 0;
target1.Frame.Z = 0.67950;
target1.Frame.RX = Globals.DegToRad(180); // From ABB.Robotics.Math
target1.Frame.RY = Globals.DegToRad(60);
target1.Frame.RZ = Globals.DegToRad(180);
// Add the RobTarget to the DataDeclarations of the ActiveTask.
station.ActiveTask.DataDeclarations.Add(target1);
// Create an RsTarget for the RobTarget.
RsTarget homeRsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target1);
homeRsTarget.Name = target1.Name;
// Add it to the ActiveTask.
station.ActiveTask.Targets.Add(homeRsTarget);
// Create a MoveInstruction for the RobTarget.
RsMoveInstruction homeInstr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target1.Name, "tool0");
// Add it to myPath.
myPath.Instructions.Add(homeInstr);
// Create the second RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target2 = new RsRobTarget();
target2.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target2.Frame.X = 0.500;
target2.Frame.Y = 0.125;
target2.Frame.Z = 0.700;
target2.Frame.RX = Globals.DegToRad(180);
target2.Frame.RY = Globals.DegToRad(60);
target2.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target2);
RsTarget trg1RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target2);
trg1RsTarget.Name = target2.Name;
station.ActiveTask.Targets.Add(trg1RsTarget);
RsMoveInstruction trg1Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target2.Name, "tool0");
myPath.Instructions.Add(trg1Instr);
// Create the third RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target3 = new RsRobTarget();
target3.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target3.Frame.X = 0.500;
target3.Frame.Y = 0.125;
target3.Frame.Z = 0.500;
target3.Frame.RX = Globals.DegToRad(180);
target3.Frame.RY = Globals.DegToRad(60);
target3.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target3);
RsTarget trg2RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target3);
trg2RsTarget.Name = target3.Name;
station.ActiveTask.Targets.Add(trg2RsTarget);
RsMoveInstruction trg2Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target3.Name, "tool0");
myPath.Instructions.Add(trg2Instr);
// Create the fourth RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target4 = new RsRobTarget();
target4.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target4.Frame.X = 0.500;
target4.Frame.Y = 0.200;
target4.Frame.Z = 0.500;
target4.Frame.RX = Globals.DegToRad(180);
target4.Frame.RY = Globals.DegToRad(60);
target4.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target4);
RsTarget trg3RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target4);
trg3RsTarget.Name = target4.Name;
station.ActiveTask.Targets.Add(trg3RsTarget);
RsMoveInstruction trg3Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target4.Name, "tool0");
myPath.Instructions.Add(trg3Instr);
// Create the fifth RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target5 = new RsRobTarget();
target5.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target5.Frame.X = 0.500;
target5.Frame.Y = 0.400;
target5.Frame.Z = 0.500;
target5.Frame.RX = Globals.DegToRad(180);
target5.Frame.RY = Globals.DegToRad(60);
target5.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target5);
RsTarget trg4RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target5);
trg4RsTarget.Name = target5.Name;
station.ActiveTask.Targets.Add(trg4RsTarget);
RsMoveInstruction trg4Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target5.Name, "tool0");
myPath.Instructions.Add(trg4Instr);
// Create the sixth RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target6 = new RsRobTarget();
target6.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target6.Frame.X = 0.500;
target6.Frame.Y = 0.400;
target6.Frame.Z = 0.700;
target6.Frame.RX = Globals.DegToRad(180);
target6.Frame.RY = Globals.DegToRad(60);
target6.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target6);
RsTarget trg5RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target6);
trg5RsTarget.Name = target6.Name;
station.ActiveTask.Targets.Add(trg5RsTarget);
RsMoveInstruction trg5Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target6.Name, "tool0");
myPath.Instructions.Add(trg5Instr);
// Move along the path.
if (await myPath.MoveAlongAsync(null))
{
Logger.AddMessage(new LogMessage("Move along path '" + myPath.Name + "' succeded!"));
}
else
{
Logger.AddMessage(new LogMessage("Move along path '" + myPath.Name + "' failed!"));
}
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
ShowName
Gets or sets a value indicating whether the name of the path will be displayed in the graphics
Declaration
public bool ShowName { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Examples
Get/Set ShowName.
// NOTE: This example requires a station containing an IRB_140 and a running VC.
Project.UndoContext.BeginUndoStep("RsPathProcedureExample");
try
{
Station station = Station.ActiveStation;
// Create a PathProcedure.
RsPathProcedure myPath = new RsPathProcedure("myPath");
// Add the path to the ActiveTask.
station.ActiveTask.PathProcedures.Add(myPath);
myPath.ModuleName = "MyModule";
myPath.ShowName = true;
myPath.Synchronize = true;
myPath.Visible = true;
// Create the first RobTarget.
RsRobTarget target1 = new RsRobTarget();
// Set the name of the RobTarget.
target1.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
// Set the position and rotation of the RobTarget.
target1.Frame.X = 0.50629;
target1.Frame.Y = 0;
target1.Frame.Z = 0.67950;
target1.Frame.RX = Globals.DegToRad(180); // From ABB.Robotics.Math
target1.Frame.RY = Globals.DegToRad(60);
target1.Frame.RZ = Globals.DegToRad(180);
// Add the RobTarget to the DataDeclarations of the ActiveTask.
station.ActiveTask.DataDeclarations.Add(target1);
// Create an RsTarget for the RobTarget.
RsTarget homeRsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target1);
homeRsTarget.Name = target1.Name;
// Add it to the ActiveTask.
station.ActiveTask.Targets.Add(homeRsTarget);
// Create a MoveInstruction for the RobTarget.
RsMoveInstruction homeInstr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target1.Name, "tool0");
// Add it to myPath.
myPath.Instructions.Add(homeInstr);
// Create the second RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target2 = new RsRobTarget();
target2.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target2.Frame.X = 0.500;
target2.Frame.Y = 0.125;
target2.Frame.Z = 0.700;
target2.Frame.RX = Globals.DegToRad(180);
target2.Frame.RY = Globals.DegToRad(60);
target2.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target2);
RsTarget trg1RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target2);
trg1RsTarget.Name = target2.Name;
station.ActiveTask.Targets.Add(trg1RsTarget);
RsMoveInstruction trg1Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target2.Name, "tool0");
myPath.Instructions.Add(trg1Instr);
// Create the third RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target3 = new RsRobTarget();
target3.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target3.Frame.X = 0.500;
target3.Frame.Y = 0.125;
target3.Frame.Z = 0.500;
target3.Frame.RX = Globals.DegToRad(180);
target3.Frame.RY = Globals.DegToRad(60);
target3.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target3);
RsTarget trg2RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target3);
trg2RsTarget.Name = target3.Name;
station.ActiveTask.Targets.Add(trg2RsTarget);
RsMoveInstruction trg2Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target3.Name, "tool0");
myPath.Instructions.Add(trg2Instr);
// Create the fourth RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target4 = new RsRobTarget();
target4.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target4.Frame.X = 0.500;
target4.Frame.Y = 0.200;
target4.Frame.Z = 0.500;
target4.Frame.RX = Globals.DegToRad(180);
target4.Frame.RY = Globals.DegToRad(60);
target4.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target4);
RsTarget trg3RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target4);
trg3RsTarget.Name = target4.Name;
station.ActiveTask.Targets.Add(trg3RsTarget);
RsMoveInstruction trg3Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target4.Name, "tool0");
myPath.Instructions.Add(trg3Instr);
// Create the fifth RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target5 = new RsRobTarget();
target5.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target5.Frame.X = 0.500;
target5.Frame.Y = 0.400;
target5.Frame.Z = 0.500;
target5.Frame.RX = Globals.DegToRad(180);
target5.Frame.RY = Globals.DegToRad(60);
target5.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target5);
RsTarget trg4RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target5);
trg4RsTarget.Name = target5.Name;
station.ActiveTask.Targets.Add(trg4RsTarget);
RsMoveInstruction trg4Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target5.Name, "tool0");
myPath.Instructions.Add(trg4Instr);
// Create the sixth RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target6 = new RsRobTarget();
target6.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target6.Frame.X = 0.500;
target6.Frame.Y = 0.400;
target6.Frame.Z = 0.700;
target6.Frame.RX = Globals.DegToRad(180);
target6.Frame.RY = Globals.DegToRad(60);
target6.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target6);
RsTarget trg5RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target6);
trg5RsTarget.Name = target6.Name;
station.ActiveTask.Targets.Add(trg5RsTarget);
RsMoveInstruction trg5Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target6.Name, "tool0");
myPath.Instructions.Add(trg5Instr);
// Move along the path.
if (await myPath.MoveAlongAsync(null))
{
Logger.AddMessage(new LogMessage("Move along path '" + myPath.Name + "' succeded!"));
}
else
{
Logger.AddMessage(new LogMessage("Move along path '" + myPath.Name + "' failed!"));
}
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
ShowSpeeds
Gets or sets if speed data for instructions is visualized.
Declaration
public bool ShowSpeeds { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
ShowZones
Declaration
olete("Use ZoneVisualization instead")]
public bool ShowZones { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Synchronize
Gets or sets a value indicating whether the RsPathProcedure should be syncronized to the VC
Declaration
public bool Synchronize { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Examples
Get/Set Syncronize.
// NOTE: This example requires a station containing an IRB_140 and a running VC.
Project.UndoContext.BeginUndoStep("RsPathProcedureExample");
try
{
Station station = Station.ActiveStation;
// Create a PathProcedure.
RsPathProcedure myPath = new RsPathProcedure("myPath");
// Add the path to the ActiveTask.
station.ActiveTask.PathProcedures.Add(myPath);
myPath.ModuleName = "MyModule";
myPath.ShowName = true;
myPath.Synchronize = true;
myPath.Visible = true;
// Create the first RobTarget.
RsRobTarget target1 = new RsRobTarget();
// Set the name of the RobTarget.
target1.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
// Set the position and rotation of the RobTarget.
target1.Frame.X = 0.50629;
target1.Frame.Y = 0;
target1.Frame.Z = 0.67950;
target1.Frame.RX = Globals.DegToRad(180); // From ABB.Robotics.Math
target1.Frame.RY = Globals.DegToRad(60);
target1.Frame.RZ = Globals.DegToRad(180);
// Add the RobTarget to the DataDeclarations of the ActiveTask.
station.ActiveTask.DataDeclarations.Add(target1);
// Create an RsTarget for the RobTarget.
RsTarget homeRsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target1);
homeRsTarget.Name = target1.Name;
// Add it to the ActiveTask.
station.ActiveTask.Targets.Add(homeRsTarget);
// Create a MoveInstruction for the RobTarget.
RsMoveInstruction homeInstr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target1.Name, "tool0");
// Add it to myPath.
myPath.Instructions.Add(homeInstr);
// Create the second RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target2 = new RsRobTarget();
target2.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target2.Frame.X = 0.500;
target2.Frame.Y = 0.125;
target2.Frame.Z = 0.700;
target2.Frame.RX = Globals.DegToRad(180);
target2.Frame.RY = Globals.DegToRad(60);
target2.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target2);
RsTarget trg1RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target2);
trg1RsTarget.Name = target2.Name;
station.ActiveTask.Targets.Add(trg1RsTarget);
RsMoveInstruction trg1Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target2.Name, "tool0");
myPath.Instructions.Add(trg1Instr);
// Create the third RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target3 = new RsRobTarget();
target3.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target3.Frame.X = 0.500;
target3.Frame.Y = 0.125;
target3.Frame.Z = 0.500;
target3.Frame.RX = Globals.DegToRad(180);
target3.Frame.RY = Globals.DegToRad(60);
target3.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target3);
RsTarget trg2RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target3);
trg2RsTarget.Name = target3.Name;
station.ActiveTask.Targets.Add(trg2RsTarget);
RsMoveInstruction trg2Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target3.Name, "tool0");
myPath.Instructions.Add(trg2Instr);
// Create the fourth RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target4 = new RsRobTarget();
target4.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target4.Frame.X = 0.500;
target4.Frame.Y = 0.200;
target4.Frame.Z = 0.500;
target4.Frame.RX = Globals.DegToRad(180);
target4.Frame.RY = Globals.DegToRad(60);
target4.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target4);
RsTarget trg3RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target4);
trg3RsTarget.Name = target4.Name;
station.ActiveTask.Targets.Add(trg3RsTarget);
RsMoveInstruction trg3Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target4.Name, "tool0");
myPath.Instructions.Add(trg3Instr);
// Create the fifth RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target5 = new RsRobTarget();
target5.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target5.Frame.X = 0.500;
target5.Frame.Y = 0.400;
target5.Frame.Z = 0.500;
target5.Frame.RX = Globals.DegToRad(180);
target5.Frame.RY = Globals.DegToRad(60);
target5.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target5);
RsTarget trg4RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target5);
trg4RsTarget.Name = target5.Name;
station.ActiveTask.Targets.Add(trg4RsTarget);
RsMoveInstruction trg4Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target5.Name, "tool0");
myPath.Instructions.Add(trg4Instr);
// Create the sixth RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target6 = new RsRobTarget();
target6.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target6.Frame.X = 0.500;
target6.Frame.Y = 0.400;
target6.Frame.Z = 0.700;
target6.Frame.RX = Globals.DegToRad(180);
target6.Frame.RY = Globals.DegToRad(60);
target6.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target6);
RsTarget trg5RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target6);
trg5RsTarget.Name = target6.Name;
station.ActiveTask.Targets.Add(trg5RsTarget);
RsMoveInstruction trg5Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target6.Name, "tool0");
myPath.Instructions.Add(trg5Instr);
// Move along the path.
if (await myPath.MoveAlongAsync(null))
{
Logger.AddMessage(new LogMessage("Move along path '" + myPath.Name + "' succeded!"));
}
else
{
Logger.AddMessage(new LogMessage("Move along path '" + myPath.Name + "' failed!"));
}
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
Visible
Gets or sets a value indicating whether the RsPathProcedure will be displayed in the graphics
Declaration
public bool Visible { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Examples
Get/Set Visible.
// NOTE: This example requires a station containing an IRB_140 and a running VC.
Project.UndoContext.BeginUndoStep("RsPathProcedureExample");
try
{
Station station = Station.ActiveStation;
// Create a PathProcedure.
RsPathProcedure myPath = new RsPathProcedure("myPath");
// Add the path to the ActiveTask.
station.ActiveTask.PathProcedures.Add(myPath);
myPath.ModuleName = "MyModule";
myPath.ShowName = true;
myPath.Synchronize = true;
myPath.Visible = true;
// Create the first RobTarget.
RsRobTarget target1 = new RsRobTarget();
// Set the name of the RobTarget.
target1.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
// Set the position and rotation of the RobTarget.
target1.Frame.X = 0.50629;
target1.Frame.Y = 0;
target1.Frame.Z = 0.67950;
target1.Frame.RX = Globals.DegToRad(180); // From ABB.Robotics.Math
target1.Frame.RY = Globals.DegToRad(60);
target1.Frame.RZ = Globals.DegToRad(180);
// Add the RobTarget to the DataDeclarations of the ActiveTask.
station.ActiveTask.DataDeclarations.Add(target1);
// Create an RsTarget for the RobTarget.
RsTarget homeRsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target1);
homeRsTarget.Name = target1.Name;
// Add it to the ActiveTask.
station.ActiveTask.Targets.Add(homeRsTarget);
// Create a MoveInstruction for the RobTarget.
RsMoveInstruction homeInstr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target1.Name, "tool0");
// Add it to myPath.
myPath.Instructions.Add(homeInstr);
// Create the second RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target2 = new RsRobTarget();
target2.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target2.Frame.X = 0.500;
target2.Frame.Y = 0.125;
target2.Frame.Z = 0.700;
target2.Frame.RX = Globals.DegToRad(180);
target2.Frame.RY = Globals.DegToRad(60);
target2.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target2);
RsTarget trg1RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target2);
trg1RsTarget.Name = target2.Name;
station.ActiveTask.Targets.Add(trg1RsTarget);
RsMoveInstruction trg1Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target2.Name, "tool0");
myPath.Instructions.Add(trg1Instr);
// Create the third RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target3 = new RsRobTarget();
target3.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target3.Frame.X = 0.500;
target3.Frame.Y = 0.125;
target3.Frame.Z = 0.500;
target3.Frame.RX = Globals.DegToRad(180);
target3.Frame.RY = Globals.DegToRad(60);
target3.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target3);
RsTarget trg2RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target3);
trg2RsTarget.Name = target3.Name;
station.ActiveTask.Targets.Add(trg2RsTarget);
RsMoveInstruction trg2Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target3.Name, "tool0");
myPath.Instructions.Add(trg2Instr);
// Create the fourth RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target4 = new RsRobTarget();
target4.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target4.Frame.X = 0.500;
target4.Frame.Y = 0.200;
target4.Frame.Z = 0.500;
target4.Frame.RX = Globals.DegToRad(180);
target4.Frame.RY = Globals.DegToRad(60);
target4.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target4);
RsTarget trg3RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target4);
trg3RsTarget.Name = target4.Name;
station.ActiveTask.Targets.Add(trg3RsTarget);
RsMoveInstruction trg3Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target4.Name, "tool0");
myPath.Instructions.Add(trg3Instr);
// Create the fifth RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target5 = new RsRobTarget();
target5.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target5.Frame.X = 0.500;
target5.Frame.Y = 0.400;
target5.Frame.Z = 0.500;
target5.Frame.RX = Globals.DegToRad(180);
target5.Frame.RY = Globals.DegToRad(60);
target5.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target5);
RsTarget trg4RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target5);
trg4RsTarget.Name = target5.Name;
station.ActiveTask.Targets.Add(trg4RsTarget);
RsMoveInstruction trg4Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target5.Name, "tool0");
myPath.Instructions.Add(trg4Instr);
// Create the sixth RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target6 = new RsRobTarget();
target6.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target6.Frame.X = 0.500;
target6.Frame.Y = 0.400;
target6.Frame.Z = 0.700;
target6.Frame.RX = Globals.DegToRad(180);
target6.Frame.RY = Globals.DegToRad(60);
target6.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target6);
RsTarget trg5RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target6);
trg5RsTarget.Name = target6.Name;
station.ActiveTask.Targets.Add(trg5RsTarget);
RsMoveInstruction trg5Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target6.Name, "tool0");
myPath.Instructions.Add(trg5Instr);
// Move along the path.
if (await myPath.MoveAlongAsync(null))
{
Logger.AddMessage(new LogMessage("Move along path '" + myPath.Name + "' succeded!"));
}
else
{
Logger.AddMessage(new LogMessage("Move along path '" + myPath.Name + "' failed!"));
}
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
ZoneVisualization
Gets or sets how zone data for move instructions is visualized.
Declaration
public ZoneVisualization ZoneVisualization { get; set; }
Property Value
Type | Description |
---|---|
ZoneVisualization |
Methods
AfterLoad(PimDocument)
Declaration
protected override void AfterLoad(PimDocument doc)
Parameters
Type | Name | Description |
---|---|---|
RobotStudio.API.Persistence.PimDocument | doc |
Overrides
Copy()
Creates a deep copy of the RsPathProcedure
Declaration
public ProjectObject Copy()
Returns
Type | Description |
---|---|
ProjectObject | The new RsPathProcedure object |
Examples
Copy PathProcedure.
// NOTE: This example requires a station containing an IRB_140 and a running VC.
Project.UndoContext.BeginUndoStep("RsPathProcedureExample");
try
{
Station station = Station.ActiveStation;
// Create a PathProcedure.
RsPathProcedure myPath = new RsPathProcedure("myPath");
// Add the path to the ActiveTask.
station.ActiveTask.PathProcedures.Add(myPath);
myPath.ModuleName = "MyModule";
myPath.ShowName = true;
myPath.Synchronize = true;
myPath.Visible = true;
// Create the first RobTarget.
RsRobTarget target1 = new RsRobTarget();
// Set the name of the RobTarget.
target1.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
// Set the position and rotation of the RobTarget.
target1.Frame.X = 0.50629;
target1.Frame.Y = 0;
target1.Frame.Z = 0.67950;
target1.Frame.RX = Globals.DegToRad(180); // From ABB.Robotics.Math
target1.Frame.RY = Globals.DegToRad(60);
target1.Frame.RZ = Globals.DegToRad(180);
// Add the RobTarget to the DataDeclarations of the ActiveTask.
station.ActiveTask.DataDeclarations.Add(target1);
// Create an RsTarget for the RobTarget.
RsTarget homeRsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target1);
homeRsTarget.Name = target1.Name;
// Add it to the ActiveTask.
station.ActiveTask.Targets.Add(homeRsTarget);
// Create a MoveInstruction for the RobTarget.
RsMoveInstruction homeInstr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target1.Name, "tool0");
// Add it to myPath.
myPath.Instructions.Add(homeInstr);
// Create the second RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target2 = new RsRobTarget();
target2.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target2.Frame.X = 0.500;
target2.Frame.Y = 0.125;
target2.Frame.Z = 0.700;
target2.Frame.RX = Globals.DegToRad(180);
target2.Frame.RY = Globals.DegToRad(60);
target2.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target2);
RsTarget trg1RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target2);
trg1RsTarget.Name = target2.Name;
station.ActiveTask.Targets.Add(trg1RsTarget);
RsMoveInstruction trg1Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target2.Name, "tool0");
myPath.Instructions.Add(trg1Instr);
// Create the third RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target3 = new RsRobTarget();
target3.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target3.Frame.X = 0.500;
target3.Frame.Y = 0.125;
target3.Frame.Z = 0.500;
target3.Frame.RX = Globals.DegToRad(180);
target3.Frame.RY = Globals.DegToRad(60);
target3.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target3);
RsTarget trg2RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target3);
trg2RsTarget.Name = target3.Name;
station.ActiveTask.Targets.Add(trg2RsTarget);
RsMoveInstruction trg2Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target3.Name, "tool0");
myPath.Instructions.Add(trg2Instr);
// Create the fourth RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target4 = new RsRobTarget();
target4.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target4.Frame.X = 0.500;
target4.Frame.Y = 0.200;
target4.Frame.Z = 0.500;
target4.Frame.RX = Globals.DegToRad(180);
target4.Frame.RY = Globals.DegToRad(60);
target4.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target4);
RsTarget trg3RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target4);
trg3RsTarget.Name = target4.Name;
station.ActiveTask.Targets.Add(trg3RsTarget);
RsMoveInstruction trg3Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target4.Name, "tool0");
myPath.Instructions.Add(trg3Instr);
// Create the fifth RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target5 = new RsRobTarget();
target5.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target5.Frame.X = 0.500;
target5.Frame.Y = 0.400;
target5.Frame.Z = 0.500;
target5.Frame.RX = Globals.DegToRad(180);
target5.Frame.RY = Globals.DegToRad(60);
target5.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target5);
RsTarget trg4RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target5);
trg4RsTarget.Name = target5.Name;
station.ActiveTask.Targets.Add(trg4RsTarget);
RsMoveInstruction trg4Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target5.Name, "tool0");
myPath.Instructions.Add(trg4Instr);
// Create the sixth RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target6 = new RsRobTarget();
target6.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target6.Frame.X = 0.500;
target6.Frame.Y = 0.400;
target6.Frame.Z = 0.700;
target6.Frame.RX = Globals.DegToRad(180);
target6.Frame.RY = Globals.DegToRad(60);
target6.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target6);
RsTarget trg5RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target6);
trg5RsTarget.Name = target6.Name;
station.ActiveTask.Targets.Add(trg5RsTarget);
RsMoveInstruction trg5Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target6.Name, "tool0");
myPath.Instructions.Add(trg5Instr);
// Move along the path.
if (await myPath.MoveAlongAsync(null))
{
Logger.AddMessage(new LogMessage("Move along path '" + myPath.Name + "' succeded!"));
}
else
{
Logger.AddMessage(new LogMessage("Move along path '" + myPath.Name + "' failed!"));
}
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
MoveAlong()
Declaration
olete("Use MoveAlongAsync instead")]
public bool MoveAlong()
Returns
Type | Description |
---|---|
Boolean |
MoveAlong(ArrayList)
Declaration
olete("Use MoveAlongAsync instead")]
public bool MoveAlong(ArrayList logMessageList)
Parameters
Type | Name | Description |
---|---|---|
ArrayList | logMessageList |
Returns
Type | Description |
---|---|
Boolean |
MoveAlong(List<SyncLogMessage>)
Declaration
olete("Use MoveAlongAsync instead")]
public bool MoveAlong(List<SyncLogMessage> logMessageList)
Parameters
Type | Name | Description |
---|---|---|
List<SyncLogMessage> | logMessageList |
Returns
Type | Description |
---|---|
Boolean |
MoveAlongAsync()
Moves the mechanism, of corresponding task, along the path procedure by creating a temporary RAPID program on the controller and executing it.
Declaration
public Task MoveAlongAsync()
Returns
Type | Description |
---|---|
Task |
Remarks
The returned Task will be marked as complete when the motion is finished.
MoveAlongAsync(List<SyncLogMessage>)
Moves the mechanism, of corresponding task, along the path procedure by creating a temporary RAPID program on the controller and executing it. The temporary RAPID program is created by using RapidSync. The synchronization log is returned from this overload.
Declaration
public Task<bool> MoveAlongAsync(List<SyncLogMessage> logMessageList)
Parameters
Type | Name | Description |
---|---|---|
List<SyncLogMessage> | logMessageList | RAPID synchronization log. Can be null. |
Returns
Type | Description |
---|---|
Task<Boolean> | True if the operation succeeded, false if there was an error executing the RAPID program. Any other error will raise an exception. |
Remarks
The returned Task will be marked as complete when the motion is finished.
Examples
MoveAlong Path.
// NOTE: This example requires a station containing an IRB_140 and a running VC.
Project.UndoContext.BeginUndoStep("RsPathProcedureExample");
try
{
Station station = Station.ActiveStation;
// Create a PathProcedure.
RsPathProcedure myPath = new RsPathProcedure("myPath");
// Add the path to the ActiveTask.
station.ActiveTask.PathProcedures.Add(myPath);
myPath.ModuleName = "MyModule";
myPath.ShowName = true;
myPath.Synchronize = true;
myPath.Visible = true;
// Create the first RobTarget.
RsRobTarget target1 = new RsRobTarget();
// Set the name of the RobTarget.
target1.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
// Set the position and rotation of the RobTarget.
target1.Frame.X = 0.50629;
target1.Frame.Y = 0;
target1.Frame.Z = 0.67950;
target1.Frame.RX = Globals.DegToRad(180); // From ABB.Robotics.Math
target1.Frame.RY = Globals.DegToRad(60);
target1.Frame.RZ = Globals.DegToRad(180);
// Add the RobTarget to the DataDeclarations of the ActiveTask.
station.ActiveTask.DataDeclarations.Add(target1);
// Create an RsTarget for the RobTarget.
RsTarget homeRsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target1);
homeRsTarget.Name = target1.Name;
// Add it to the ActiveTask.
station.ActiveTask.Targets.Add(homeRsTarget);
// Create a MoveInstruction for the RobTarget.
RsMoveInstruction homeInstr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target1.Name, "tool0");
// Add it to myPath.
myPath.Instructions.Add(homeInstr);
// Create the second RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target2 = new RsRobTarget();
target2.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target2.Frame.X = 0.500;
target2.Frame.Y = 0.125;
target2.Frame.Z = 0.700;
target2.Frame.RX = Globals.DegToRad(180);
target2.Frame.RY = Globals.DegToRad(60);
target2.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target2);
RsTarget trg1RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target2);
trg1RsTarget.Name = target2.Name;
station.ActiveTask.Targets.Add(trg1RsTarget);
RsMoveInstruction trg1Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target2.Name, "tool0");
myPath.Instructions.Add(trg1Instr);
// Create the third RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target3 = new RsRobTarget();
target3.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target3.Frame.X = 0.500;
target3.Frame.Y = 0.125;
target3.Frame.Z = 0.500;
target3.Frame.RX = Globals.DegToRad(180);
target3.Frame.RY = Globals.DegToRad(60);
target3.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target3);
RsTarget trg2RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target3);
trg2RsTarget.Name = target3.Name;
station.ActiveTask.Targets.Add(trg2RsTarget);
RsMoveInstruction trg2Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target3.Name, "tool0");
myPath.Instructions.Add(trg2Instr);
// Create the fourth RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target4 = new RsRobTarget();
target4.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target4.Frame.X = 0.500;
target4.Frame.Y = 0.200;
target4.Frame.Z = 0.500;
target4.Frame.RX = Globals.DegToRad(180);
target4.Frame.RY = Globals.DegToRad(60);
target4.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target4);
RsTarget trg3RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target4);
trg3RsTarget.Name = target4.Name;
station.ActiveTask.Targets.Add(trg3RsTarget);
RsMoveInstruction trg3Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target4.Name, "tool0");
myPath.Instructions.Add(trg3Instr);
// Create the fifth RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target5 = new RsRobTarget();
target5.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target5.Frame.X = 0.500;
target5.Frame.Y = 0.400;
target5.Frame.Z = 0.500;
target5.Frame.RX = Globals.DegToRad(180);
target5.Frame.RY = Globals.DegToRad(60);
target5.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target5);
RsTarget trg4RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target5);
trg4RsTarget.Name = target5.Name;
station.ActiveTask.Targets.Add(trg4RsTarget);
RsMoveInstruction trg4Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target5.Name, "tool0");
myPath.Instructions.Add(trg4Instr);
// Create the sixth RobTarget. See description for the first one.
// The steps are identical.
RsRobTarget target6 = new RsRobTarget();
target6.Name = station.ActiveTask.GetValidRapidName("Target", "_", 10);
target6.Frame.X = 0.500;
target6.Frame.Y = 0.400;
target6.Frame.Z = 0.700;
target6.Frame.RX = Globals.DegToRad(180);
target6.Frame.RY = Globals.DegToRad(60);
target6.Frame.RZ = Globals.DegToRad(180);
station.ActiveTask.DataDeclarations.Add(target6);
RsTarget trg5RsTarget = new RsTarget(station.ActiveTask.ActiveWorkObject, target6);
trg5RsTarget.Name = target6.Name;
station.ActiveTask.Targets.Add(trg5RsTarget);
RsMoveInstruction trg5Instr = new RsMoveInstruction(station.ActiveTask, "Move", "Default", MotionType.Linear, "wobj0", target6.Name, "tool0");
myPath.Instructions.Add(trg5Instr);
// Move along the path.
if (await myPath.MoveAlongAsync(null))
{
Logger.AddMessage(new LogMessage("Move along path '" + myPath.Name + "' succeded!"));
}
else
{
Logger.AddMessage(new LogMessage("Move along path '" + myPath.Name + "' failed!"));
}
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
OnCreatingObject()
Declaration
protected override void OnCreatingObject()