Click or drag to resize

RoutineTextRange Property

Gets the TextRange of the Routine.

Namespace:  ABB.Robotics.Controllers.RapidDomain
Assembly:  ABB.Robotics.Controllers (in ABB.Robotics.Controllers.dll) Version: 6.5.129.0
Syntax
C#
public TextRange TextRange { get; }

Property Value

Type: TextRange
Exceptions
ExceptionCondition
GeneralExceptionA General Exception has occurred.
Examples
This example uses the property TextRange to retrieve the start row of a specified RAPID routine. The start row is then used to create the RapidEditorInitData needed to launch the Program Editor at the specified routine.
public void ShowRoutine(ABB.Robotics.Tps.Taf.ITpsViewLaunchServices iTpsSite, string taskName, Module mod, string routineName)
{
  Routine routine = null;
  int startRow = 0;
  object cookie;
  try
  {
    routine = mod.GetRoutine(routineName);
    startRow = routine.TextRange.Begin.Row;
    ABB.Robotics.Tps.Taf.RapidEditorInitData initData = new ABB.Robotics.Tps.Taf.RapidEditorInitData(taskName, mod.Name, startRow);
    iTpsSite.LaunchView(ABB.Robotics.Tps.Taf.FpStandardView.RapidEditor, initData, true, out cookie);
  }
  catch (GeneralException ee)
  {
    // TODO: Add error handling
  }
  catch (System.Exception ee)
  {
    // TODO: Add error handling
  }
  finally
  {
    // Make sure the routine object is disposed
    if (routine != null)
    {
      routine.Dispose();
      routine = null;
    }
  }
}
See Also