Class RsWorkObject
A workobject is a coordinate system used to describe the position of a work piece. The workobject consists of two frames: a user frame and an object frame. All programed positions will be related to the object frame, which is related to the user frame, which is related to the world coordinate system. It corresponds to the 'workobject' data type in RAPID.
Inherited Members
Namespace: ABB.Robotics.RobotStudio.Stations
Assembly: ABB.Robotics.RobotStudio.Stations.dll
Syntax
public sealed class RsWorkObject : RsDataDeclaration, ISupportCopy, IDeclaration, IAttachableChild, IGfxObject
Examples
RsWorkObject Example.
Project.UndoContext.BeginUndoStep("RsWorkObjectExample");
try
{
Station station = Station.ActiveStation;
// Create a RsWorkObject.
RsWorkObject myWobj = new RsWorkObject();
// Get a valid RAPID name for the workobject and assign it.
myWobj.Name = station.ActiveTask.GetValidRapidName("myWobj", "_", 1);
// Set the frame size to twice the default size.
myWobj.FrameSize = myWobj.FrameSize * 2;
// Set the userframe to be a fixed coordinate system.
myWobj.UserFrameProgrammed = true;
// Translate the user frame.
myWobj.UserFrame.X = 0.5;
myWobj.UserFrame.Y = 0.2;
myWobj.UserFrame.Z = 0.2;
// Translate the object frame.
myWobj.ObjectFrame.X = 0.5;
myWobj.ObjectFrame.Y = 0.5;
myWobj.ObjectFrame.Z = 0.5;
// Rotate the object frame (pi radians around each axis).
myWobj.ObjectFrame.RX = System.Math.PI;
myWobj.ObjectFrame.RY = System.Math.PI;
myWobj.ObjectFrame.RZ = System.Math.PI;
// Display the wobj in the graphics.
myWobj.Visible = true;
// Display the name of the wobj in the graphics.
myWobj.ShowName = true;
// The wobj is not held by the robot.
myWobj.RobotHold = false;
// Add the wobj to the DataDeclarations of the ActiveTask.
station.ActiveTask.DataDeclarations.Add(myWobj);
// Set the wobj as the active workobject of the ActiveTask.
station.ActiveTask.ActiveWorkObject = (RsWorkObject)station.ActiveTask.FindDataDeclarationFromModuleScope(myWobj.Name, myWobj.ModuleName);
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
Constructors
RsWorkObject()
Initializes a new instance of the RsWorkObject class.
Declaration
public RsWorkObject()
Examples
Create RsWorkObject.
Project.UndoContext.BeginUndoStep("RsWorkObjectExample");
try
{
Station station = Station.ActiveStation;
// Create a RsWorkObject.
RsWorkObject myWobj = new RsWorkObject();
// Get a valid RAPID name for the workobject and assign it.
myWobj.Name = station.ActiveTask.GetValidRapidName("myWobj", "_", 1);
// Set the frame size to twice the default size.
myWobj.FrameSize = myWobj.FrameSize * 2;
// Set the userframe to be a fixed coordinate system.
myWobj.UserFrameProgrammed = true;
// Translate the user frame.
myWobj.UserFrame.X = 0.5;
myWobj.UserFrame.Y = 0.2;
myWobj.UserFrame.Z = 0.2;
// Translate the object frame.
myWobj.ObjectFrame.X = 0.5;
myWobj.ObjectFrame.Y = 0.5;
myWobj.ObjectFrame.Z = 0.5;
// Rotate the object frame (pi radians around each axis).
myWobj.ObjectFrame.RX = System.Math.PI;
myWobj.ObjectFrame.RY = System.Math.PI;
myWobj.ObjectFrame.RZ = System.Math.PI;
// Display the wobj in the graphics.
myWobj.Visible = true;
// Display the name of the wobj in the graphics.
myWobj.ShowName = true;
// The wobj is not held by the robot.
myWobj.RobotHold = false;
// Add the wobj to the DataDeclarations of the ActiveTask.
station.ActiveTask.DataDeclarations.Add(myWobj);
// Set the wobj as the active workobject of the ActiveTask.
station.ActiveTask.ActiveWorkObject = (RsWorkObject)station.ActiveTask.FindDataDeclarationFromModuleScope(myWobj.Name, myWobj.ModuleName);
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
Properties
FrameSize
Gets or set the size of the user and object frames in the graphics.
Declaration
public double FrameSize { get; set; }
Property Value
Type | Description |
---|---|
Double |
Examples
Get/Set FrameSize.
Project.UndoContext.BeginUndoStep("RsWorkObjectExample");
try
{
Station station = Station.ActiveStation;
// Create a RsWorkObject.
RsWorkObject myWobj = new RsWorkObject();
// Get a valid RAPID name for the workobject and assign it.
myWobj.Name = station.ActiveTask.GetValidRapidName("myWobj", "_", 1);
// Set the frame size to twice the default size.
myWobj.FrameSize = myWobj.FrameSize * 2;
// Set the userframe to be a fixed coordinate system.
myWobj.UserFrameProgrammed = true;
// Translate the user frame.
myWobj.UserFrame.X = 0.5;
myWobj.UserFrame.Y = 0.2;
myWobj.UserFrame.Z = 0.2;
// Translate the object frame.
myWobj.ObjectFrame.X = 0.5;
myWobj.ObjectFrame.Y = 0.5;
myWobj.ObjectFrame.Z = 0.5;
// Rotate the object frame (pi radians around each axis).
myWobj.ObjectFrame.RX = System.Math.PI;
myWobj.ObjectFrame.RY = System.Math.PI;
myWobj.ObjectFrame.RZ = System.Math.PI;
// Display the wobj in the graphics.
myWobj.Visible = true;
// Display the name of the wobj in the graphics.
myWobj.ShowName = true;
// The wobj is not held by the robot.
myWobj.RobotHold = false;
// Add the wobj to the DataDeclarations of the ActiveTask.
station.ActiveTask.DataDeclarations.Add(myWobj);
// Set the wobj as the active workobject of the ActiveTask.
station.ActiveTask.ActiveWorkObject = (RsWorkObject)station.ActiveTask.FindDataDeclarationFromModuleScope(myWobj.Name, myWobj.ModuleName);
}
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
ObjectFrame
Gets a Transform that corresponds to the object frame of the work object.
Declaration
public Transform ObjectFrame { get; }
Property Value
Type | Description |
---|---|
Transform |
Examples
Get ObjectFrame.
Project.UndoContext.BeginUndoStep("RsWorkObjectExample");
try
{
Station station = Station.ActiveStation;
// Create a RsWorkObject.
RsWorkObject myWobj = new RsWorkObject();
// Get a valid RAPID name for the workobject and assign it.
myWobj.Name = station.ActiveTask.GetValidRapidName("myWobj", "_", 1);
// Set the frame size to twice the default size.
myWobj.FrameSize = myWobj.FrameSize * 2;
// Set the userframe to be a fixed coordinate system.
myWobj.UserFrameProgrammed = true;
// Translate the user frame.
myWobj.UserFrame.X = 0.5;
myWobj.UserFrame.Y = 0.2;
myWobj.UserFrame.Z = 0.2;
// Translate the object frame.
myWobj.ObjectFrame.X = 0.5;
myWobj.ObjectFrame.Y = 0.5;
myWobj.ObjectFrame.Z = 0.5;
// Rotate the object frame (pi radians around each axis).
myWobj.ObjectFrame.RX = System.Math.PI;
myWobj.ObjectFrame.RY = System.Math.PI;
myWobj.ObjectFrame.RZ = System.Math.PI;
// Display the wobj in the graphics.
myWobj.Visible = true;
// Display the name of the wobj in the graphics.
myWobj.ShowName = true;
// The wobj is not held by the robot.
myWobj.RobotHold = false;
// Add the wobj to the DataDeclarations of the ActiveTask.
station.ActiveTask.DataDeclarations.Add(myWobj);
// Set the wobj as the active workobject of the ActiveTask.
station.ActiveTask.ActiveWorkObject = (RsWorkObject)station.ActiveTask.FindDataDeclarationFromModuleScope(myWobj.Name, myWobj.ModuleName);
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
RobotHold
Gets or sets a values specifying whether or not the robot is holding the work object: True if the robot is holding the workobject, false otherwise.
Declaration
public bool RobotHold { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Examples
Get/Set RobotHold.
Project.UndoContext.BeginUndoStep("RsWorkObjectExample");
try
{
Station station = Station.ActiveStation;
// Create a RsWorkObject.
RsWorkObject myWobj = new RsWorkObject();
// Get a valid RAPID name for the workobject and assign it.
myWobj.Name = station.ActiveTask.GetValidRapidName("myWobj", "_", 1);
// Set the frame size to twice the default size.
myWobj.FrameSize = myWobj.FrameSize * 2;
// Set the userframe to be a fixed coordinate system.
myWobj.UserFrameProgrammed = true;
// Translate the user frame.
myWobj.UserFrame.X = 0.5;
myWobj.UserFrame.Y = 0.2;
myWobj.UserFrame.Z = 0.2;
// Translate the object frame.
myWobj.ObjectFrame.X = 0.5;
myWobj.ObjectFrame.Y = 0.5;
myWobj.ObjectFrame.Z = 0.5;
// Rotate the object frame (pi radians around each axis).
myWobj.ObjectFrame.RX = System.Math.PI;
myWobj.ObjectFrame.RY = System.Math.PI;
myWobj.ObjectFrame.RZ = System.Math.PI;
// Display the wobj in the graphics.
myWobj.Visible = true;
// Display the name of the wobj in the graphics.
myWobj.ShowName = true;
// The wobj is not held by the robot.
myWobj.RobotHold = false;
// Add the wobj to the DataDeclarations of the ActiveTask.
station.ActiveTask.DataDeclarations.Add(myWobj);
// Set the wobj as the active workobject of the ActiveTask.
station.ActiveTask.ActiveWorkObject = (RsWorkObject)station.ActiveTask.FindDataDeclarationFromModuleScope(myWobj.Name, myWobj.ModuleName);
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
ShowName
Gets or sets whether the name of the workobject will be displayed in the graphics
Declaration
public bool ShowName { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Examples
Get/Set ShowName.
Project.UndoContext.BeginUndoStep("RsWorkObjectExample");
try
{
Station station = Station.ActiveStation;
// Create a RsWorkObject.
RsWorkObject myWobj = new RsWorkObject();
// Get a valid RAPID name for the workobject and assign it.
myWobj.Name = station.ActiveTask.GetValidRapidName("myWobj", "_", 1);
// Set the frame size to twice the default size.
myWobj.FrameSize = myWobj.FrameSize * 2;
// Set the userframe to be a fixed coordinate system.
myWobj.UserFrameProgrammed = true;
// Translate the user frame.
myWobj.UserFrame.X = 0.5;
myWobj.UserFrame.Y = 0.2;
myWobj.UserFrame.Z = 0.2;
// Translate the object frame.
myWobj.ObjectFrame.X = 0.5;
myWobj.ObjectFrame.Y = 0.5;
myWobj.ObjectFrame.Z = 0.5;
// Rotate the object frame (pi radians around each axis).
myWobj.ObjectFrame.RX = System.Math.PI;
myWobj.ObjectFrame.RY = System.Math.PI;
myWobj.ObjectFrame.RZ = System.Math.PI;
// Display the wobj in the graphics.
myWobj.Visible = true;
// Display the name of the wobj in the graphics.
myWobj.ShowName = true;
// The wobj is not held by the robot.
myWobj.RobotHold = false;
// Add the wobj to the DataDeclarations of the ActiveTask.
station.ActiveTask.DataDeclarations.Add(myWobj);
// Set the wobj as the active workobject of the ActiveTask.
station.ActiveTask.ActiveWorkObject = (RsWorkObject)station.ActiveTask.FindDataDeclarationFromModuleScope(myWobj.Name, myWobj.ModuleName);
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
UserFrame
Gets a Transform that corresponds to the user frame of the work object.
Declaration
public Transform UserFrame { get; }
Property Value
Type | Description |
---|---|
Transform |
Examples
Get UserFrame.
Project.UndoContext.BeginUndoStep("RsWorkObjectExample");
try
{
Station station = Station.ActiveStation;
// Create a RsWorkObject.
RsWorkObject myWobj = new RsWorkObject();
// Get a valid RAPID name for the workobject and assign it.
myWobj.Name = station.ActiveTask.GetValidRapidName("myWobj", "_", 1);
// Set the frame size to twice the default size.
myWobj.FrameSize = myWobj.FrameSize * 2;
// Set the userframe to be a fixed coordinate system.
myWobj.UserFrameProgrammed = true;
// Translate the user frame.
myWobj.UserFrame.X = 0.5;
myWobj.UserFrame.Y = 0.2;
myWobj.UserFrame.Z = 0.2;
// Translate the object frame.
myWobj.ObjectFrame.X = 0.5;
myWobj.ObjectFrame.Y = 0.5;
myWobj.ObjectFrame.Z = 0.5;
// Rotate the object frame (pi radians around each axis).
myWobj.ObjectFrame.RX = System.Math.PI;
myWobj.ObjectFrame.RY = System.Math.PI;
myWobj.ObjectFrame.RZ = System.Math.PI;
// Display the wobj in the graphics.
myWobj.Visible = true;
// Display the name of the wobj in the graphics.
myWobj.ShowName = true;
// The wobj is not held by the robot.
myWobj.RobotHold = false;
// Add the wobj to the DataDeclarations of the ActiveTask.
station.ActiveTask.DataDeclarations.Add(myWobj);
// Set the wobj as the active workobject of the ActiveTask.
station.ActiveTask.ActiveWorkObject = (RsWorkObject)station.ActiveTask.FindDataDeclarationFromModuleScope(myWobj.Name, myWobj.ModuleName);
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
UserFrameMechanicalUnit
Gets or sets the name of the mechanical unit with which the robot movements are coordinated. Only specified in the case of movable user coordinate systems (UserFrameProgrammed is False).
Declaration
public string UserFrameMechanicalUnit { get; set; }
Property Value
Type | Description |
---|---|
String |
Examples
Get/Set UserFrameMechanicalUnit.
Project.UndoContext.BeginUndoStep("RsWorkObjectExample");
try
{
Station station = Station.ActiveStation;
// Create a RsWorkObject.
RsWorkObject myWobj = new RsWorkObject();
// Get a valid RAPID name for the workobject and assign it.
myWobj.Name = station.ActiveTask.GetValidRapidName("myWobj", "_", 1);
// Set the frame size to twice the default size.
myWobj.FrameSize = myWobj.FrameSize * 2;
// Set the userframe to be a fixed coordinate system.
myWobj.UserFrameProgrammed = true;
// Translate the user frame.
myWobj.UserFrame.X = 0.5;
myWobj.UserFrame.Y = 0.2;
myWobj.UserFrame.Z = 0.2;
// Translate the object frame.
myWobj.ObjectFrame.X = 0.5;
myWobj.ObjectFrame.Y = 0.5;
myWobj.ObjectFrame.Z = 0.5;
// Rotate the object frame (pi radians around each axis).
myWobj.ObjectFrame.RX = System.Math.PI;
myWobj.ObjectFrame.RY = System.Math.PI;
myWobj.ObjectFrame.RZ = System.Math.PI;
// Display the wobj in the graphics.
myWobj.Visible = true;
// Display the name of the wobj in the graphics.
myWobj.ShowName = true;
// The wobj is not held by the robot.
myWobj.RobotHold = false;
// Add the wobj to the DataDeclarations of the ActiveTask.
station.ActiveTask.DataDeclarations.Add(myWobj);
// Set the wobj as the active workobject of the ActiveTask.
station.ActiveTask.ActiveWorkObject = (RsWorkObject)station.ActiveTask.FindDataDeclarationFromModuleScope(myWobj.Name, myWobj.ModuleName);
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
UserFrameProgrammed
Gets or sets a value that specifies whether or not the UserFrame is a fixed coordinate system or that it is moveable, i.e. by a coordinated external axis. True means that the UserFrame is fixed and False that its is moveable.
Declaration
public bool UserFrameProgrammed { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Examples
Get/Set UserFrameProgrammed.
Project.UndoContext.BeginUndoStep("RsWorkObjectExample");
try
{
Station station = Station.ActiveStation;
// Create a RsWorkObject.
RsWorkObject myWobj = new RsWorkObject();
// Get a valid RAPID name for the workobject and assign it.
myWobj.Name = station.ActiveTask.GetValidRapidName("myWobj", "_", 1);
// Set the frame size to twice the default size.
myWobj.FrameSize = myWobj.FrameSize * 2;
// Set the userframe to be a fixed coordinate system.
myWobj.UserFrameProgrammed = true;
// Translate the user frame.
myWobj.UserFrame.X = 0.5;
myWobj.UserFrame.Y = 0.2;
myWobj.UserFrame.Z = 0.2;
// Translate the object frame.
myWobj.ObjectFrame.X = 0.5;
myWobj.ObjectFrame.Y = 0.5;
myWobj.ObjectFrame.Z = 0.5;
// Rotate the object frame (pi radians around each axis).
myWobj.ObjectFrame.RX = System.Math.PI;
myWobj.ObjectFrame.RY = System.Math.PI;
myWobj.ObjectFrame.RZ = System.Math.PI;
// Display the wobj in the graphics.
myWobj.Visible = true;
// Display the name of the wobj in the graphics.
myWobj.ShowName = true;
// The wobj is not held by the robot.
myWobj.RobotHold = false;
// Add the wobj to the DataDeclarations of the ActiveTask.
station.ActiveTask.DataDeclarations.Add(myWobj);
// Set the wobj as the active workobject of the ActiveTask.
station.ActiveTask.ActiveWorkObject = (RsWorkObject)station.ActiveTask.FindDataDeclarationFromModuleScope(myWobj.Name, myWobj.ModuleName);
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
Visible
Gets or sets whether the user and object frames should be displayed in the graphics.
Declaration
public bool Visible { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Examples
Get/Set Visible.
Project.UndoContext.BeginUndoStep("RsWorkObjectExample");
try
{
Station station = Station.ActiveStation;
// Create a RsWorkObject.
RsWorkObject myWobj = new RsWorkObject();
// Get a valid RAPID name for the workobject and assign it.
myWobj.Name = station.ActiveTask.GetValidRapidName("myWobj", "_", 1);
// Set the frame size to twice the default size.
myWobj.FrameSize = myWobj.FrameSize * 2;
// Set the userframe to be a fixed coordinate system.
myWobj.UserFrameProgrammed = true;
// Translate the user frame.
myWobj.UserFrame.X = 0.5;
myWobj.UserFrame.Y = 0.2;
myWobj.UserFrame.Z = 0.2;
// Translate the object frame.
myWobj.ObjectFrame.X = 0.5;
myWobj.ObjectFrame.Y = 0.5;
myWobj.ObjectFrame.Z = 0.5;
// Rotate the object frame (pi radians around each axis).
myWobj.ObjectFrame.RX = System.Math.PI;
myWobj.ObjectFrame.RY = System.Math.PI;
myWobj.ObjectFrame.RZ = System.Math.PI;
// Display the wobj in the graphics.
myWobj.Visible = true;
// Display the name of the wobj in the graphics.
myWobj.ShowName = true;
// The wobj is not held by the robot.
myWobj.RobotHold = false;
// Add the wobj to the DataDeclarations of the ActiveTask.
station.ActiveTask.DataDeclarations.Add(myWobj);
// Set the wobj as the active workobject of the ActiveTask.
station.ActiveTask.ActiveWorkObject = (RsWorkObject)station.ActiveTask.FindDataDeclarationFromModuleScope(myWobj.Name, myWobj.ModuleName);
}
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 |