Show / Hide Table of Contents

Class Frame

Represents a simple modelling frame.

Inheritance
object
ProjectObject
Frame
Implements
IHasTransform
IAttachableChild
IAttachableParent
ISupportCopy
Inherited Members
ProjectObject.FindObjects(Predicate<ProjectObject>, Predicate<ProjectObject>)
ProjectObject.ToString()
ProjectObject.DisplayName
ProjectObject.ContainingProject
ProjectObject.Attributes
ProjectObject.UIVisible
ProjectObject.TypeDisplayName
ProjectObject.UniqueId
ProjectObject.Children
ProjectObject.DisplayNameChanged
ProjectObject.ProjectObjectChanged
ProjectObject.InternalEvent
Namespace: ABB.Robotics.RobotStudio.Stations
Assembly: ABB.Robotics.RobotStudio.Stations.dll
Syntax
[Persistent("Frame")]
public sealed class Frame : ProjectObject, IHasTransform, IAttachableChild, IAttachableParent, ISupportCopy
Examples

Frame Example.

Project.UndoContext.BeginUndoStep("FrameProperties");
try
{
Station station = Station.ActiveStation;
            // Create a frame.
            Frame myFrame = new Frame();
            myFrame.Name = "MyFrame_1";

            // Add the frame to the station.
            station.Frames.Add(myFrame);

            // Make the frame twice as big.
            myFrame.FrameSize = myFrame.FrameSize * 2;

            // Make sure the name of the frame and the frame itself is displayed in the graphics.
            myFrame.ShowName = true;
            myFrame.Visible = true;

            // Move the frame 100 mm along the X-axis.
            myFrame.Transform.X = myFrame.Transform.X + 0.1;

            // Output the transform of the frame.
            Logger.AddMessage(new LogMessage("Transform: x:" + myFrame.Transform.X.ToString() +
                                                            " y:" + myFrame.Transform.Y.ToString() +
                                                            " z:" + myFrame.Transform.Z.ToString() +
                                                            " Rx:" + myFrame.Transform.RX.ToString() +
                                                            " Ry:" + myFrame.Transform.RY.ToString() +
                                                            " Rz:" + myFrame.Transform.RZ.ToString()));
        }
        catch
        {
            Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
            throw;
        }
        finally
        {
            Project.UndoContext.EndUndoStep();
        }</code></pre>

Constructors

View Source

Frame()

Initializes a new instance of the Frame class.

Declaration
public Frame()
Examples

Create Frame.

Project.UndoContext.BeginUndoStep("FrameProperties");
try
{
Station station = Station.ActiveStation;
            // Create a frame.
            Frame myFrame = new Frame();
            myFrame.Name = "MyFrame_1";

            // Add the frame to the station.
            station.Frames.Add(myFrame);

            // Make the frame twice as big.
            myFrame.FrameSize = myFrame.FrameSize * 2;

            // Make sure the name of the frame and the frame itself is displayed in the graphics.
            myFrame.ShowName = true;
            myFrame.Visible = true;

            // Move the frame 100 mm along the X-axis.
            myFrame.Transform.X = myFrame.Transform.X + 0.1;

            // Output the transform of the frame.
            Logger.AddMessage(new LogMessage("Transform: x:" + myFrame.Transform.X.ToString() +
                                                            " y:" + myFrame.Transform.Y.ToString() +
                                                            " z:" + myFrame.Transform.Z.ToString() +
                                                            " Rx:" + myFrame.Transform.RX.ToString() +
                                                            " Ry:" + myFrame.Transform.RY.ToString() +
                                                            " Rz:" + myFrame.Transform.RZ.ToString()));
        }
        catch
        {
            Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
            throw;
        }
        finally
        {
            Project.UndoContext.EndUndoStep();
        }</code></pre>

Properties

View Source

FrameSize

Gets or sets the size of the graphical frame.

Declaration
public double FrameSize { get; set; }
Property Value
Type Description
double
Examples

Get/Set FrameSize.

Project.UndoContext.BeginUndoStep("FrameProperties");
try
{
Station station = Station.ActiveStation;
            // Create a frame.
            Frame myFrame = new Frame();
            myFrame.Name = "MyFrame_1";

            // Add the frame to the station.
            station.Frames.Add(myFrame);

            // Make the frame twice as big.
            myFrame.FrameSize = myFrame.FrameSize * 2;

            // Make sure the name of the frame and the frame itself is displayed in the graphics.
            myFrame.ShowName = true;
            myFrame.Visible = true;

            // Move the frame 100 mm along the X-axis.
            myFrame.Transform.X = myFrame.Transform.X + 0.1;

            // Output the transform of the frame.
            Logger.AddMessage(new LogMessage("Transform: x:" + myFrame.Transform.X.ToString() +
                                                            " y:" + myFrame.Transform.Y.ToString() +
                                                            " z:" + myFrame.Transform.Z.ToString() +
                                                            " Rx:" + myFrame.Transform.RX.ToString() +
                                                            " Ry:" + myFrame.Transform.RY.ToString() +
                                                            " Rz:" + myFrame.Transform.RZ.ToString()));
        }
        catch
        {
            Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
            throw;
        }
        finally
        {
            Project.UndoContext.EndUndoStep();
        }</code></pre>
View Source

FrameType

Gets or sets a value indicating how the frame is used.

Declaration
public FrameType FrameType { get; set; }
Property Value
Type Description
FrameType
View Source

Name

Gets or sets the name of the object

Declaration
public override string Name { get; set; }
Property Value
Type Description
string
Overrides
ProjectObject.Name
View Source

Parent

Returns a reference to the parent Station.

Declaration
public override ProjectObject Parent { get; }
Property Value
Type Description
ProjectObject

Returns a ProjectObject representing the current object's parent.

Overrides
ProjectObject.Parent
Remarks

You can use the Parent property to navigate up from the current object to the object one level higher.

Examples

Get Parent.

Project.UndoContext.BeginUndoStep("FrameProperties");
try
{
Station station = Station.ActiveStation;
            // Create a frame.
            Frame myFrame = new Frame();
            myFrame.Name = "MyFrame_1";

            // Add the frame to the station.
            station.Frames.Add(myFrame);

            // Make the frame twice as big.
            myFrame.FrameSize = myFrame.FrameSize * 2;

            // Make sure the name of the frame and the frame itself is displayed in the graphics.
            myFrame.ShowName = true;
            myFrame.Visible = true;

            // Move the frame 100 mm along the X-axis.
            myFrame.Transform.X = myFrame.Transform.X + 0.1;

            // Output the transform of the frame.
            Logger.AddMessage(new LogMessage("Transform: x:" + myFrame.Transform.X.ToString() +
                                                            " y:" + myFrame.Transform.Y.ToString() +
                                                            " z:" + myFrame.Transform.Z.ToString() +
                                                            " Rx:" + myFrame.Transform.RX.ToString() +
                                                            " Ry:" + myFrame.Transform.RY.ToString() +
                                                            " Rz:" + myFrame.Transform.RZ.ToString()));
        }
        catch
        {
            Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
            throw;
        }
        finally
        {
            Project.UndoContext.EndUndoStep();
        }</code></pre>
View Source

ShowName

Gets or sets a value indicating whether the name of the frame will be displayed in the graphics.

Declaration
public bool ShowName { get; set; }
Property Value
Type Description
bool
Examples

Get/Set ShowName.

Project.UndoContext.BeginUndoStep("FrameProperties");
try
{
Station station = Station.ActiveStation;
            // Create a frame.
            Frame myFrame = new Frame();
            myFrame.Name = "MyFrame_1";

            // Add the frame to the station.
            station.Frames.Add(myFrame);

            // Make the frame twice as big.
            myFrame.FrameSize = myFrame.FrameSize * 2;

            // Make sure the name of the frame and the frame itself is displayed in the graphics.
            myFrame.ShowName = true;
            myFrame.Visible = true;

            // Move the frame 100 mm along the X-axis.
            myFrame.Transform.X = myFrame.Transform.X + 0.1;

            // Output the transform of the frame.
            Logger.AddMessage(new LogMessage("Transform: x:" + myFrame.Transform.X.ToString() +
                                                            " y:" + myFrame.Transform.Y.ToString() +
                                                            " z:" + myFrame.Transform.Z.ToString() +
                                                            " Rx:" + myFrame.Transform.RX.ToString() +
                                                            " Ry:" + myFrame.Transform.RY.ToString() +
                                                            " Rz:" + myFrame.Transform.RZ.ToString()));
        }
        catch
        {
            Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
            throw;
        }
        finally
        {
            Project.UndoContext.EndUndoStep();
        }</code></pre>
View Source

Text

Gets or sets an extra text that is displayed next to the frame in the graphics.

Declaration
public string Text { get; set; }
Property Value
Type Description
string
View Source

Transform

Gets the transform of the Frame.

Declaration
public Transform Transform { get; }
Property Value
Type Description
Transform
Examples

Get Transform.

Project.UndoContext.BeginUndoStep("FrameProperties");
try
{
Station station = Station.ActiveStation;
            // Create a frame.
            Frame myFrame = new Frame();
            myFrame.Name = "MyFrame_1";

            // Add the frame to the station.
            station.Frames.Add(myFrame);

            // Make the frame twice as big.
            myFrame.FrameSize = myFrame.FrameSize * 2;

            // Make sure the name of the frame and the frame itself is displayed in the graphics.
            myFrame.ShowName = true;
            myFrame.Visible = true;

            // Move the frame 100 mm along the X-axis.
            myFrame.Transform.X = myFrame.Transform.X + 0.1;

            // Output the transform of the frame.
            Logger.AddMessage(new LogMessage("Transform: x:" + myFrame.Transform.X.ToString() +
                                                            " y:" + myFrame.Transform.Y.ToString() +
                                                            " z:" + myFrame.Transform.Z.ToString() +
                                                            " Rx:" + myFrame.Transform.RX.ToString() +
                                                            " Ry:" + myFrame.Transform.RY.ToString() +
                                                            " Rz:" + myFrame.Transform.RZ.ToString()));
        }
        catch
        {
            Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
            throw;
        }
        finally
        {
            Project.UndoContext.EndUndoStep();
        }</code></pre>
View Source

Visible

Gets or sets a value indicating whether the frame will be displayed in the graphics.

Declaration
public bool Visible { get; set; }
Property Value
Type Description
bool
Examples

Get/Set Visible.

Project.UndoContext.BeginUndoStep("FrameProperties");
try
{
Station station = Station.ActiveStation;
            // Create a frame.
            Frame myFrame = new Frame();
            myFrame.Name = "MyFrame_1";

            // Add the frame to the station.
            station.Frames.Add(myFrame);

            // Make the frame twice as big.
            myFrame.FrameSize = myFrame.FrameSize * 2;

            // Make sure the name of the frame and the frame itself is displayed in the graphics.
            myFrame.ShowName = true;
            myFrame.Visible = true;

            // Move the frame 100 mm along the X-axis.
            myFrame.Transform.X = myFrame.Transform.X + 0.1;

            // Output the transform of the frame.
            Logger.AddMessage(new LogMessage("Transform: x:" + myFrame.Transform.X.ToString() +
                                                            " y:" + myFrame.Transform.Y.ToString() +
                                                            " z:" + myFrame.Transform.Z.ToString() +
                                                            " Rx:" + myFrame.Transform.RX.ToString() +
                                                            " Ry:" + myFrame.Transform.RY.ToString() +
                                                            " Rz:" + myFrame.Transform.RZ.ToString()));
        }
        catch
        {
            Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
            throw;
        }
        finally
        {
            Project.UndoContext.EndUndoStep();
        }</code></pre>

Methods

View Source

AfterLoad(PimDocument)

Declaration
protected override void AfterLoad(PimDocument doc)
Parameters
Type Name Description
PimDocument doc
Overrides
ProjectObject.AfterLoad(PimDocument)
View Source

Attach(IAttachableChild, bool, Matrix4)

Attaches an IAttachableChild to this frame.

Declaration
public bool Attach(IAttachableChild child, bool mount, Matrix4 offset)
Parameters
Type Name Description
IAttachableChild child

The object to attach.

bool mount

True if the object should be moved to the frame.

Matrix4 offset

The offset from the frame (if mount is true).

Returns
Type Description
bool
View Source

CanAttachChild(IAttachableChild)

Checks if an IAttachableChild can be attached to this frame.

Declaration
public bool CanAttachChild(IAttachableChild child)
Parameters
Type Name Description
IAttachableChild child
Returns
Type Description
bool
View Source

Copy()

Creates a copy of the project object.

Declaration
public ProjectObject Copy()
Returns
Type Description
ProjectObject

The copied project object.

Remarks

Always refer to the documentation of the implementing object for a detailed description of the copy behavior.

View Source

Detach(IAttachableChild)

Detaches an attached object from this frame.

Declaration
public bool Detach(IAttachableChild child)
Parameters
Type Name Description
IAttachableChild child
Returns
Type Description
bool
View Source

Highlight()

Sets the highlight color of the frame to the default highlight color.

Declaration
public void Highlight()
View Source

Highlight(Color)

Sets the highlight color of the frame.

Declaration
public void Highlight(Color color)
Parameters
Type Name Description
Color color
View Source

ResetHighlight()

Resets the highlight color of the target to the default color.

Declaration
public void ResetHighlight()

Implements

IHasTransform
IAttachableChild
IAttachableParent
ISupportCopy
  • View Source
In this article
Back to top Copyright © 2025 ABB