Class RsToolData
Tooldata is used to describe the characteristics of a tool. It corresponds to the 'tooldata' data type in RAPID.
Implements
Inherited Members
Namespace: ABB.Robotics.RobotStudio.Stations
Assembly: ABB.Robotics.RobotStudio.Stations.dll
Syntax
public sealed class RsToolData : RsDataDeclaration, ISupportCopy, IDeclaration, IGfxObject
Examples
Create RsToolData.
Project.UndoContext.BeginUndoStep("RsToolDataExample");
try
{
Station station = Station.ActiveStation;
// Create a gripper tool using sample data from the RAPID manual.
RsToolData myTool = new RsToolData();
// Get a valid RAPID name and assign it.
myTool.Name = station.ActiveTask.GetValidRapidName("gripper", "_", 1);
// The robot is holding the tool.
myTool.RobotHold = true;
// Set the TCP, expressed in the wrist coordinate system.
myTool.Frame.X = 0.0974;
myTool.Frame.Y = 0;
myTool.Frame.Z = 0.2231;
myTool.Frame.RX = Globals.DegToRad(45);
myTool.Frame.RY = 0;
myTool.Frame.RZ = Globals.DegToRad(45);
// Create the load data for the tool.
RsLoadData myloadData = new RsLoadData();
// Set mass.
myloadData.Mass = 5;
// Set center of gravity.
myloadData.Cog = new Vector3(0.023, 0, 0.075);
// Set the axis of moment.
myloadData.Aom = new Quaternion(1, 0, 0, 0);
// The load can be considered a point mass in this example, i.e. without any moment of inertia.
myloadData.Inertia = new Vector3(0, 0, 0);
// Att the load data to the tool.
myTool.LoadData = myloadData;
// Show the name of the tool data in the graphics.
myTool.ShowName = true;
// Set the frame size to twice its default size.
myTool.FrameSize = myTool.FrameSize * 2;
// Show the tool data in the graphics.
myTool.Visible = true;
// Add the tool data to the ActiveTask.
station.ActiveTask.DataDeclarations.Add(myTool);
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
Constructors
RsToolData()
Initializes a new instance of the RsToolData class.
Declaration
public RsToolData()
Examples
Create RsToolData.
Project.UndoContext.BeginUndoStep("RsToolDataExample");
try
{
Station station = Station.ActiveStation;
// Create a gripper tool using sample data from the RAPID manual.
RsToolData myTool = new RsToolData();
// Get a valid RAPID name and assign it.
myTool.Name = station.ActiveTask.GetValidRapidName("gripper", "_", 1);
// The robot is holding the tool.
myTool.RobotHold = true;
// Set the TCP, expressed in the wrist coordinate system.
myTool.Frame.X = 0.0974;
myTool.Frame.Y = 0;
myTool.Frame.Z = 0.2231;
myTool.Frame.RX = Globals.DegToRad(45);
myTool.Frame.RY = 0;
myTool.Frame.RZ = Globals.DegToRad(45);
// Create the load data for the tool.
RsLoadData myloadData = new RsLoadData();
// Set mass.
myloadData.Mass = 5;
// Set center of gravity.
myloadData.Cog = new Vector3(0.023, 0, 0.075);
// Set the axis of moment.
myloadData.Aom = new Quaternion(1, 0, 0, 0);
// The load can be considered a point mass in this example, i.e. without any moment of inertia.
myloadData.Inertia = new Vector3(0, 0, 0);
// Att the load data to the tool.
myTool.LoadData = myloadData;
// Show the name of the tool data in the graphics.
myTool.ShowName = true;
// Set the frame size to twice its default size.
myTool.FrameSize = myTool.FrameSize * 2;
// Show the tool data in the graphics.
myTool.Visible = true;
// Add the tool data to the ActiveTask.
station.ActiveTask.DataDeclarations.Add(myTool);
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
Properties
Frame
Gets a Transform that corresponds to the TCP of the tool.
Declaration
public Transform Frame { get; }
Property Value
Type | Description |
---|---|
Transform |
Examples
Get Frame.
Project.UndoContext.BeginUndoStep("RsToolDataExample");
try
{
Station station = Station.ActiveStation;
// Create a gripper tool using sample data from the RAPID manual.
RsToolData myTool = new RsToolData();
// Get a valid RAPID name and assign it.
myTool.Name = station.ActiveTask.GetValidRapidName("gripper", "_", 1);
// The robot is holding the tool.
myTool.RobotHold = true;
// Set the TCP, expressed in the wrist coordinate system.
myTool.Frame.X = 0.0974;
myTool.Frame.Y = 0;
myTool.Frame.Z = 0.2231;
myTool.Frame.RX = Globals.DegToRad(45);
myTool.Frame.RY = 0;
myTool.Frame.RZ = Globals.DegToRad(45);
// Create the load data for the tool.
RsLoadData myloadData = new RsLoadData();
// Set mass.
myloadData.Mass = 5;
// Set center of gravity.
myloadData.Cog = new Vector3(0.023, 0, 0.075);
// Set the axis of moment.
myloadData.Aom = new Quaternion(1, 0, 0, 0);
// The load can be considered a point mass in this example, i.e. without any moment of inertia.
myloadData.Inertia = new Vector3(0, 0, 0);
// Att the load data to the tool.
myTool.LoadData = myloadData;
// Show the name of the tool data in the graphics.
myTool.ShowName = true;
// Set the frame size to twice its default size.
myTool.FrameSize = myTool.FrameSize * 2;
// Show the tool data in the graphics.
myTool.Visible = true;
// Add the tool data to the ActiveTask.
station.ActiveTask.DataDeclarations.Add(myTool);
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
FrameSize
Gets or set the size of the graphical representation of the TCP frame.
Declaration
public double FrameSize { get; set; }
Property Value
Type | Description |
---|---|
Double |
Examples
Get/Set FrameSize.
Project.UndoContext.BeginUndoStep("RsToolDataExample");
try
{
Station station = Station.ActiveStation;
// Create a gripper tool using sample data from the RAPID manual.
RsToolData myTool = new RsToolData();
// Get a valid RAPID name and assign it.
myTool.Name = station.ActiveTask.GetValidRapidName("gripper", "_", 1);
// The robot is holding the tool.
myTool.RobotHold = true;
// Set the TCP, expressed in the wrist coordinate system.
myTool.Frame.X = 0.0974;
myTool.Frame.Y = 0;
myTool.Frame.Z = 0.2231;
myTool.Frame.RX = Globals.DegToRad(45);
myTool.Frame.RY = 0;
myTool.Frame.RZ = Globals.DegToRad(45);
// Create the load data for the tool.
RsLoadData myloadData = new RsLoadData();
// Set mass.
myloadData.Mass = 5;
// Set center of gravity.
myloadData.Cog = new Vector3(0.023, 0, 0.075);
// Set the axis of moment.
myloadData.Aom = new Quaternion(1, 0, 0, 0);
// The load can be considered a point mass in this example, i.e. without any moment of inertia.
myloadData.Inertia = new Vector3(0, 0, 0);
// Att the load data to the tool.
myTool.LoadData = myloadData;
// Show the name of the tool data in the graphics.
myTool.ShowName = true;
// Set the frame size to twice its default size.
myTool.FrameSize = myTool.FrameSize * 2;
// Show the tool data in the graphics.
myTool.Visible = true;
// Add the tool data to the ActiveTask.
station.ActiveTask.DataDeclarations.Add(myTool);
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
LoadData
Gets or sets the RsLoadData of the tool.
Declaration
public RsLoadData LoadData { get; set; }
Property Value
Type | Description |
---|---|
RsLoadData |
Examples
Get/Set LoadData.
Project.UndoContext.BeginUndoStep("RsToolDataExample");
try
{
Station station = Station.ActiveStation;
// Create a gripper tool using sample data from the RAPID manual.
RsToolData myTool = new RsToolData();
// Get a valid RAPID name and assign it.
myTool.Name = station.ActiveTask.GetValidRapidName("gripper", "_", 1);
// The robot is holding the tool.
myTool.RobotHold = true;
// Set the TCP, expressed in the wrist coordinate system.
myTool.Frame.X = 0.0974;
myTool.Frame.Y = 0;
myTool.Frame.Z = 0.2231;
myTool.Frame.RX = Globals.DegToRad(45);
myTool.Frame.RY = 0;
myTool.Frame.RZ = Globals.DegToRad(45);
// Create the load data for the tool.
RsLoadData myloadData = new RsLoadData();
// Set mass.
myloadData.Mass = 5;
// Set center of gravity.
myloadData.Cog = new Vector3(0.023, 0, 0.075);
// Set the axis of moment.
myloadData.Aom = new Quaternion(1, 0, 0, 0);
// The load can be considered a point mass in this example, i.e. without any moment of inertia.
myloadData.Inertia = new Vector3(0, 0, 0);
// Att the load data to the tool.
myTool.LoadData = myloadData;
// Show the name of the tool data in the graphics.
myTool.ShowName = true;
// Set the frame size to twice its default size.
myTool.FrameSize = myTool.FrameSize * 2;
// Show the tool data in the graphics.
myTool.Visible = true;
// Add the tool data to the ActiveTask.
station.ActiveTask.DataDeclarations.Add(myTool);
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
Name
Gets or sets the name of the object
Declaration
public override string Name { get; set; }
Property Value
Type | Description |
---|---|
String |
Overrides
RobotHold
Gets or sets a values specifying whether or not the robot is holding the tool: True if the robot is holding the tool, false otherwise.
Declaration
public bool RobotHold { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Examples
Get/Set RobotHold.
Project.UndoContext.BeginUndoStep("RsToolDataExample");
try
{
Station station = Station.ActiveStation;
// Create a gripper tool using sample data from the RAPID manual.
RsToolData myTool = new RsToolData();
// Get a valid RAPID name and assign it.
myTool.Name = station.ActiveTask.GetValidRapidName("gripper", "_", 1);
// The robot is holding the tool.
myTool.RobotHold = true;
// Set the TCP, expressed in the wrist coordinate system.
myTool.Frame.X = 0.0974;
myTool.Frame.Y = 0;
myTool.Frame.Z = 0.2231;
myTool.Frame.RX = Globals.DegToRad(45);
myTool.Frame.RY = 0;
myTool.Frame.RZ = Globals.DegToRad(45);
// Create the load data for the tool.
RsLoadData myloadData = new RsLoadData();
// Set mass.
myloadData.Mass = 5;
// Set center of gravity.
myloadData.Cog = new Vector3(0.023, 0, 0.075);
// Set the axis of moment.
myloadData.Aom = new Quaternion(1, 0, 0, 0);
// The load can be considered a point mass in this example, i.e. without any moment of inertia.
myloadData.Inertia = new Vector3(0, 0, 0);
// Att the load data to the tool.
myTool.LoadData = myloadData;
// Show the name of the tool data in the graphics.
myTool.ShowName = true;
// Set the frame size to twice its default size.
myTool.FrameSize = myTool.FrameSize * 2;
// Show the tool data in the graphics.
myTool.Visible = true;
// Add the tool data to the ActiveTask.
station.ActiveTask.DataDeclarations.Add(myTool);
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
ShowName
Gets or sets whether the name of the tooldata will be displayed in the graphics.
Declaration
public bool ShowName { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Examples
Get/Set ShowName.
Project.UndoContext.BeginUndoStep("RsToolDataExample");
try
{
Station station = Station.ActiveStation;
// Create a gripper tool using sample data from the RAPID manual.
RsToolData myTool = new RsToolData();
// Get a valid RAPID name and assign it.
myTool.Name = station.ActiveTask.GetValidRapidName("gripper", "_", 1);
// The robot is holding the tool.
myTool.RobotHold = true;
// Set the TCP, expressed in the wrist coordinate system.
myTool.Frame.X = 0.0974;
myTool.Frame.Y = 0;
myTool.Frame.Z = 0.2231;
myTool.Frame.RX = Globals.DegToRad(45);
myTool.Frame.RY = 0;
myTool.Frame.RZ = Globals.DegToRad(45);
// Create the load data for the tool.
RsLoadData myloadData = new RsLoadData();
// Set mass.
myloadData.Mass = 5;
// Set center of gravity.
myloadData.Cog = new Vector3(0.023, 0, 0.075);
// Set the axis of moment.
myloadData.Aom = new Quaternion(1, 0, 0, 0);
// The load can be considered a point mass in this example, i.e. without any moment of inertia.
myloadData.Inertia = new Vector3(0, 0, 0);
// Att the load data to the tool.
myTool.LoadData = myloadData;
// Show the name of the tool data in the graphics.
myTool.ShowName = true;
// Set the frame size to twice its default size.
myTool.FrameSize = myTool.FrameSize * 2;
// Show the tool data in the graphics.
myTool.Visible = true;
// Add the tool data to the ActiveTask.
station.ActiveTask.DataDeclarations.Add(myTool);
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
Visible
Gets or set whether the TCP frame should be displayed in the graphics.
Declaration
public bool Visible { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Examples
Get/Set Visible.
Project.UndoContext.BeginUndoStep("RsToolDataExample");
try
{
Station station = Station.ActiveStation;
// Create a gripper tool using sample data from the RAPID manual.
RsToolData myTool = new RsToolData();
// Get a valid RAPID name and assign it.
myTool.Name = station.ActiveTask.GetValidRapidName("gripper", "_", 1);
// The robot is holding the tool.
myTool.RobotHold = true;
// Set the TCP, expressed in the wrist coordinate system.
myTool.Frame.X = 0.0974;
myTool.Frame.Y = 0;
myTool.Frame.Z = 0.2231;
myTool.Frame.RX = Globals.DegToRad(45);
myTool.Frame.RY = 0;
myTool.Frame.RZ = Globals.DegToRad(45);
// Create the load data for the tool.
RsLoadData myloadData = new RsLoadData();
// Set mass.
myloadData.Mass = 5;
// Set center of gravity.
myloadData.Cog = new Vector3(0.023, 0, 0.075);
// Set the axis of moment.
myloadData.Aom = new Quaternion(1, 0, 0, 0);
// The load can be considered a point mass in this example, i.e. without any moment of inertia.
myloadData.Inertia = new Vector3(0, 0, 0);
// Att the load data to the tool.
myTool.LoadData = myloadData;
// Show the name of the tool data in the graphics.
myTool.ShowName = true;
// Set the frame size to twice its default size.
myTool.FrameSize = myTool.FrameSize * 2;
// Show the tool data in the graphics.
myTool.Visible = true;
// Add the tool data to the ActiveTask.
station.ActiveTask.DataDeclarations.Add(myTool);
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
Methods
AfterLoad(PimDocument)
Declaration
protected override void AfterLoad(PimDocument doc)
Parameters
Type | Name | Description |
---|---|---|
RobotStudio.API.Persistence.PimDocument | doc |
Overrides
Copy()
Declaration
public override ProjectObject Copy()
Returns
Type | Description |
---|---|
ProjectObject |
Overrides
IsValid(RsToolData)
Declaration
olete("not used")]
public static bool IsValid(RsToolData toolData)
Parameters
Type | Name | Description |
---|---|---|
RsToolData | toolData |
Returns
Type | Description |
---|---|
Boolean |