Click or drag to resize
RsWorkObject Class
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.
Inheritance Hierarchy

Namespace:  ABB.Robotics.RobotStudio.Stations
Assembly:  ABB.Robotics.RobotStudio.Stations (in ABB.Robotics.RobotStudio.Stations.dll) Version: 7.0.8747.636
Syntax
C#
public sealed class RsWorkObject : RsDataDeclaration, 
	IAttachableChild

The RsWorkObject type exposes the following members.

Constructors
  NameDescription
Public methodCode exampleRsWorkObject
Initializes a new instance of the RsWorkObject class.
Top
Properties
  NameDescription
Public propertyAttributes
Returns a collection of dynamic attributes attached to the object
(Inherited from ProjectObject.)
Public propertyChildren
Enumerates all child objects.
(Inherited from ProjectObject.)
Public propertyContainingProject
Returns the Project that this object is a part of, or null if it is not part of a Project.
(Inherited from ProjectObject.)
Public propertyCode exampleDataType
Gets the RAPID data type of the Data Declaration.
(Inherited from RsDataDeclaration.)
Public propertyDisplayName (Inherited from RsDataDeclaration.)
Public propertyCode exampleFrameSize
Gets or set the size of the user and object frames in the graphics.
Public propertyLocal
Gets or sets if the DataDeclaration is declared local in a module. (Corresponds to the LOCAL keyword in RAPID).
(Inherited from RsDataDeclaration.)
Public propertyModuleName
Gets or sets the name of the RAPID module that the DataDeclaration will be synchronized to.
(Inherited from RsDataDeclaration.)
Public propertyName
Gets or sets the name of the object
(Overrides RsDataDeclarationName.)
Public propertyCode exampleObjectFrame
Gets a Transform that corresponds to the object frame of the work object.
Public propertyParent
Returns the objects parent, if it has one.
(Inherited from ProjectObject.)
Public propertyCode exampleRobotHold
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.
Public propertyCode exampleShowName
Gets or sets whether the name of the workobject will be displayed in the graphics
Public propertyStorageType
Gets or sets the RapidStorageType of the DataDeclaration
(Inherited from RsDataDeclaration.)
Public propertySynchronize
Gets or sets whether the DataDeclaration should be synchronized to the VC when the referencing RsPathProcedure is.
(Inherited from RsDataDeclaration.)
Public propertyTypeDisplayName
Gets a localized name for the type of this object.
(Inherited from ProjectObject.)
Public propertyUIVisible
Gets or sets a value that indicates if this object should be displayed in GUI such as an object browser.
(Inherited from ProjectObject.)
Public propertyUniqueId
Gets a persisted, globally unique identifier for this object, that can be used to find the object using the GetObjectFromUniqueId(String) method.
(Inherited from ProjectObject.)
Public propertyCode exampleUserFrame
Gets a Transform that corresponds to the user frame of the work object.
Public propertyCode exampleUserFrameMechanicalUnit
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).
Public propertyCode exampleUserFrameProgrammed
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.
Public propertyCode exampleVisible
Gets or sets whether the user and object frames should be displayed in the graphics.
Top
Methods
  NameDescription
Public methodCopy (Overrides RsDataDeclarationCopy.)
Public methodEquals (Inherited from Object.)
Public methodFindObjects
Recursively finds object that satisfy a condition.
(Inherited from ProjectObject.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetReferencingInstructions
Returns all RsInstructions that are referencing this DataDeclaration.
(Inherited from RsDataDeclaration.)
Public methodGetType (Inherited from Object.)
Public methodToString (Inherited from ProjectObject.)
Top
Examples
RsWorkObject Example.
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();
}
Version Information

Supported in: 1.0.0.0
See Also