RobotStudio event

RS SDK select targets from path

Hello,

i started my first addin with RS5.14 and i have some basic questions.

The first one is, what is the easiest way to select all targets from a path? for example from the active path.
My destination is blank or show selected targets from a path. 

Thanks for your help.

Comments

  • Maybe this will help you?
    example


    Then if it is a "real" selection you want, as in the blue highlight in the browser etc, then you add it to the ProjectSelection.
    link

     
     
    But do you really want the targets or do you actually want the instructions?
  • Hello John,

    this is my current solution:

    RsInstructionArgument myInstrArg;

    foreach (RsInstruction myRsInstruction in station.ActiveTask.ActivePathProcedure.Instructions)
    {
        if (myRsInstruction.InstructionArguments.Contains("ToPoint"))
        {
            myRsInstruction.InstructionArguments.TryGetInstructionArgument("ToPoint", out myInstrArg);

            foreach (RsTarget myRsTarget in station.ActiveTask.Targets)
            {
                if (myRsTarget.Name == myInstrArg.Value && myRsTarget.Visible == true)
                {
                    myRsTarget.Highlight(Color.Yellow);
                    break;
                }
            }
        }
    }


    Is there an another way? What i need is, all points that belonging to a path.

    Thanks