Show / Hide Table of Contents

Class RsInstructionTemplateCollection

A collection of RsInstructionTemplate objects.

Inheritance
object
RsInstructionTemplateCollection
Namespace: ABB.Robotics.RobotStudio.Stations
Assembly: ABB.Robotics.RobotStudio.Stations.dll
Syntax
public class RsInstructionTemplateCollection
Examples

RsInstructionTemplateCollection.

Project.UndoContext.BeginUndoStep("RsActionInstructionDescriptionExample");
try
{
Station station = Station.ActiveStation;
RsInstructionDescription myInstrDesc;
if (station.ActiveTask.InstructionDescriptions.TryGetInstructionDescription("ConfL", out myInstrDesc))
{
// Cast myInstrDesc to a RsActionInstructionDescription.
RsActionInstructionDescription myConfLDesc = (RsActionInstructionDescription)myInstrDesc;
                // Output to the logger.
                Logger.AddMessage(new LogMessage("The ActionInstructionDescription '" + myConfLDesc.Name + "' has the following property values:"));
                Logger.AddMessage(new LogMessage("InformationText: " + myConfLDesc.InformationText));
                if (myConfLDesc.ActiveTemplate != null)
                {
                    Logger.AddMessage(new LogMessage("ActiveTemplate: " + myConfLDesc.ActiveTemplate.Name));
                }
                Logger.AddMessage(new LogMessage("The following instruction parameters:"));
                int i = 1;
                foreach (RsInstructionParameterGroup rspg in myConfLDesc.InstructionParameterGroups)
                {
                    Logger.AddMessage(new LogMessage("In group " + i + ":"));
                    i++;
                    foreach (RsInstructionParameter rsip in rspg.InstructionParameters)
                    {
                        Logger.AddMessage(new LogMessage("Parameter Name: '" + rsip.Name
                                + "' Optional: '" + rsip.Optional.ToString()
                                + "' Pointtype: '" + rsip.PointType.ToString()
                                + "' SyncReferencedData: '" + rsip.SyncReferencedData.ToString() + "'"));
                    }

                }
                Logger.AddMessage(new LogMessage("The following instruction templates:"));
                foreach (RsInstructionTemplate rsit in myConfLDesc.InstructionTemplates)
                {
                    Logger.AddMessage(new LogMessage("Template '" + rsit.Name + "'"));
                    Logger.AddMessage(new LogMessage("Has the following InstructionArguments:"));
                    foreach (RsInstructionArgument rsia in rsit.InstructionArguments)
                    {
                        Logger.AddMessage(new LogMessage("Argument Name: '" + rsia.Name
                                + "' Enabled: '" + rsia.Enabled.ToString()
                                + "' Value: '" + rsia.Value + "'"));
                    }
                }
            }
            else
            {
                Logger.AddMessage(new LogMessage("Failed to get the IstructionDescription for 'ConfL'"));
            }
        }
        catch
        {
            Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
            throw;
        }
        finally
        {
            Project.UndoContext.EndUndoStep();
        }</code></pre>

Properties

View Source

Count

Declaration
public virtual int Count { get; }
Property Value
Type Description
int
View Source

IsSynchronized

Declaration
public virtual bool IsSynchronized { get; }
Property Value
Type Description
bool
View Source

this[int]

Declaration
public RsInstructionTemplate this[int index] { get; }
Parameters
Type Name Description
int index
Property Value
Type Description
RsInstructionTemplate
View Source

Parent

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

SyncRoot

Declaration
public virtual object SyncRoot { get; }
Property Value
Type Description
object

Methods

View Source

Add(RsInstructionTemplate)

Adds a RsInstructionTemplate object to the collection.

Declaration
public void Add(RsInstructionTemplate instructionTemplate)
Parameters
Type Name Description
RsInstructionTemplate instructionTemplate

The RsInstructionTemplate to add.

Examples

Add.

Project.UndoContext.BeginUndoStep("RsActionInstructionDescriptionExample");
try
{
Station station = Station.ActiveStation;
RsInstructionDescription myInstrDesc;
if (station.ActiveTask.InstructionDescriptions.TryGetInstructionDescription("ConfL", out myInstrDesc))
{
// Cast myInstrDesc to a RsActionInstructionDescription.
RsActionInstructionDescription myConfLDesc = (RsActionInstructionDescription)myInstrDesc;
                // Output to the logger.
                Logger.AddMessage(new LogMessage("The ActionInstructionDescription '" + myConfLDesc.Name + "' has the following property values:"));
                Logger.AddMessage(new LogMessage("InformationText: " + myConfLDesc.InformationText));
                if (myConfLDesc.ActiveTemplate != null)
                {
                    Logger.AddMessage(new LogMessage("ActiveTemplate: " + myConfLDesc.ActiveTemplate.Name));
                }
                Logger.AddMessage(new LogMessage("The following instruction parameters:"));
                int i = 1;
                foreach (RsInstructionParameterGroup rspg in myConfLDesc.InstructionParameterGroups)
                {
                    Logger.AddMessage(new LogMessage("In group " + i + ":"));
                    i++;
                    foreach (RsInstructionParameter rsip in rspg.InstructionParameters)
                    {
                        Logger.AddMessage(new LogMessage("Parameter Name: '" + rsip.Name
                                + "' Optional: '" + rsip.Optional.ToString()
                                + "' Pointtype: '" + rsip.PointType.ToString()
                                + "' SyncReferencedData: '" + rsip.SyncReferencedData.ToString() + "'"));
                    }

                }
                Logger.AddMessage(new LogMessage("The following instruction templates:"));
                foreach (RsInstructionTemplate rsit in myConfLDesc.InstructionTemplates)
                {
                    Logger.AddMessage(new LogMessage("Template '" + rsit.Name + "'"));
                    Logger.AddMessage(new LogMessage("Has the following InstructionArguments:"));
                    foreach (RsInstructionArgument rsia in rsit.InstructionArguments)
                    {
                        Logger.AddMessage(new LogMessage("Argument Name: '" + rsia.Name
                                + "' Enabled: '" + rsia.Enabled.ToString()
                                + "' Value: '" + rsia.Value + "'"));
                    }
                }
            }
            else
            {
                Logger.AddMessage(new LogMessage("Failed to get the IstructionDescription for 'ConfL'"));
            }
        }
        catch
        {
            Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
            throw;
        }
        finally
        {
            Project.UndoContext.EndUndoStep();
        }</code></pre>
View Source

Contains(RsInstructionTemplate)

Declaration
public bool Contains(RsInstructionTemplate obj)
Parameters
Type Name Description
RsInstructionTemplate obj
Returns
Type Description
bool
View Source

CopyTo(RsInstructionTemplate[], int)

Declaration
public void CopyTo(RsInstructionTemplate[] array, int index)
Parameters
Type Name Description
RsInstructionTemplate[] array
int index
View Source

CopyTo(Array, int)

Declaration
public virtual void CopyTo(Array array, int index)
Parameters
Type Name Description
Array array
int index
View Source

GetEnumerator()

Declaration
public virtual IEnumerator GetEnumerator()
Returns
Type Description
IEnumerator
View Source

Remove(RsInstructionTemplate)

Removes a RsInstructionTemplate object from the collection.

Declaration
public void Remove(RsInstructionTemplate instructionTemplate)
Parameters
Type Name Description
RsInstructionTemplate instructionTemplate

The RsInstructionTemplate to remove.

Examples

Remove.

Project.UndoContext.BeginUndoStep("RsActionInstructionDescriptionExample");
try
{
Station station = Station.ActiveStation;
RsInstructionDescription myInstrDesc;
if (station.ActiveTask.InstructionDescriptions.TryGetInstructionDescription("ConfL", out myInstrDesc))
{
// Cast myInstrDesc to a RsActionInstructionDescription.
RsActionInstructionDescription myConfLDesc = (RsActionInstructionDescription)myInstrDesc;
                // Output to the logger.
                Logger.AddMessage(new LogMessage("The ActionInstructionDescription '" + myConfLDesc.Name + "' has the following property values:"));
                Logger.AddMessage(new LogMessage("InformationText: " + myConfLDesc.InformationText));
                if (myConfLDesc.ActiveTemplate != null)
                {
                    Logger.AddMessage(new LogMessage("ActiveTemplate: " + myConfLDesc.ActiveTemplate.Name));
                }
                Logger.AddMessage(new LogMessage("The following instruction parameters:"));
                int i = 1;
                foreach (RsInstructionParameterGroup rspg in myConfLDesc.InstructionParameterGroups)
                {
                    Logger.AddMessage(new LogMessage("In group " + i + ":"));
                    i++;
                    foreach (RsInstructionParameter rsip in rspg.InstructionParameters)
                    {
                        Logger.AddMessage(new LogMessage("Parameter Name: '" + rsip.Name
                                + "' Optional: '" + rsip.Optional.ToString()
                                + "' Pointtype: '" + rsip.PointType.ToString()
                                + "' SyncReferencedData: '" + rsip.SyncReferencedData.ToString() + "'"));
                    }

                }
                Logger.AddMessage(new LogMessage("The following instruction templates:"));
                foreach (RsInstructionTemplate rsit in myConfLDesc.InstructionTemplates)
                {
                    Logger.AddMessage(new LogMessage("Template '" + rsit.Name + "'"));
                    Logger.AddMessage(new LogMessage("Has the following InstructionArguments:"));
                    foreach (RsInstructionArgument rsia in rsit.InstructionArguments)
                    {
                        Logger.AddMessage(new LogMessage("Argument Name: '" + rsia.Name
                                + "' Enabled: '" + rsia.Enabled.ToString()
                                + "' Value: '" + rsia.Value + "'"));
                    }
                }
            }
            else
            {
                Logger.AddMessage(new LogMessage("Failed to get the IstructionDescription for 'ConfL'"));
            }
        }
        catch
        {
            Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
            throw;
        }
        finally
        {
            Project.UndoContext.EndUndoStep();
        }</code></pre>
View Source

ToArray()

Declaration
public RsInstructionTemplate[] ToArray()
Returns
Type Description
RsInstructionTemplate[]
View Source

TryGetInstructionDescription(string, out RsInstructionTemplate)

Gets the template with the specified name.

Declaration
public bool TryGetInstructionDescription(string name, out RsInstructionTemplate instructionTemplate)
Parameters
Type Name Description
string name

The name of the template to get.

RsInstructionTemplate instructionTemplate

When this method returns, contains the template associated with the specified name, if the name is found; otherwise, null.

Returns
Type Description
bool

true if the RsInstructionTemplateCollection contains an element with the specified name; otherwise, false.

Exceptions
Type Condition
ArgumentException

name is a null reference.

  • View Source
In this article
Back to top Copyright © 2025 ABB