Show / Hide Table of Contents

Target Properties

Target Properties

This example provides information on using the properties of RsTarget.

RsTargets can be shown or hidden from graphical view, targets can made as Local or INLINE. To take a closer look at the RsTargets you can jump to target. The modifications to properties of RsTarget can be viewed either from graphical window or Path and Targets tool window.

Solution

  1. Showing targets

    target.Visible = true;
    
  2. Set target to LOCAL

    target.RobTarget.Local = true;
    target.RobTarget.ModuleName = "Module1";
    
  3. Jump to target

    target.JumpTo(station.ActiveTask.ActiveTool);
    
  4. Hiding Targets

    target.Visible = false;
    

Example

This example provides information on using the properties of RsTarget.

private static void UpdateTargetProperties(RsTargetCollection existingTargets)
{
    //Begin UndoStep
    Project.UndoContext.BeginUndoStep("UpdateProperties");
    try
    {
        Station station = Project.ActiveProject as Station;
        foreach (RsTarget target in existingTargets)
        {
            //Setting the Visible property of target would show or hide the targets
            //SHOW targets
            target.Visible = true;
            
            //Set target to LOCAL
            target.RobTarget.Local = true;
            //When making target to LOCAL, target module name and PathProcedure module name must be same 
            target.RobTarget.ModuleName = "Module1";
            
            // Jump to the target. Requires an active tool in the station and a running VC.
            target.JumpTo(station.ActiveTask.ActiveTool);

            //Setting the Visible property of target would show or hide the targets
            //HIDING targets
            target.Visible = false;
        }

    }
    catch (Exception ex)
    {
        Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
        Logger.AddMessage(new LogMessage(ex.Message.ToString()));
    }
    finally
    {
        //End UndoStep
        Project.UndoContext.EndUndoStep();
    }
}

Required Namespaces

ABB.Robotics.RobotStudio.Environment

ABB.Robotics.RobotStudio.Stations.Forms

ABB.Robotics.RobotStudio.Stations

ABB.Robotics.Math

See Also

  • Deleting Targets
  • Aligning Targets
In this article
Back to top Copyright © 2024 ABB