Click or drag to resize
SelectionModes Enumeration
Specifies values to indicate the type of objects which will be selectable by picking

Namespace:  ABB.Robotics.RobotStudio.Stations.Forms
Assembly:  ABB.Robotics.RobotStudio.Stations (in ABB.Robotics.RobotStudio.Stations.dll) Version: 7.0.8747.636
Syntax
C#
[FlagsAttribute]
public enum SelectionModes
Members
  Member nameValueDescription
Disable0 No selection.
Mechanism1Mechanism selection.
Assembly2GraphicComponentGroup selection.
Part4Part selection.
Entity8Body selection.
Surface16Face selection.
Curve32Wire selection.
Frame64Frame, RsTarget, RsWorkObject or RsToolData selection.
Path128RsPathProcedure selection.
Instruction256RsMoveInstruction selection.
Examples
Set Selection Mode Example
public void SetSelectionModeExample()
{
    Project.UndoContext.BeginUndoStep("Set Selection Mode");
    try
    {
        // Add a ToolWindow where we can put some buttons.
        ToolWindow tw = new ToolWindow();
        tw.Caption = "New ToolWindow";
        // Add it docked to the right of the screen.
        UIEnvironment.Windows.AddDocked(tw, DockStyle.Right);

        // Create the buttons.
        Button btn = new Button();
        // Set the text of the button.
        btn.Text = "Select surface";
        // Set the size of the button.
        btn.Size = new Size(190, 40);
        // Set the location of the button (pixels from top left corner).
        btn.Location = new Point(5, 5);
        // Add an event handler to the button.
        btn.Click += new EventHandler(btn1_clicked);
        // Add the button to the ToolWindow.
        tw.Control.Controls.Add(btn);

        // Create a new button.
        Button btn2 = new Button();
        btn2.Text = "Select part";
        btn2.Size = new Size(190, 40);
        btn2.Location = new Point(5, 50);
        btn2.Click += new EventHandler(btn2_clicked);
        tw.Control.Controls.Add(btn2);

        // And one more button.
        Button btn3 = new Button();
        btn3.Text = "Select mechanism";
        btn3.Size = new Size(190, 40);
        btn3.Location = new Point(5, 95);
        btn3.Click += new EventHandler(btn3_clicked);
        tw.Control.Controls.Add(btn3);

        // And yet another button.
        Button btn4 = new Button();
        btn4.Text = "Select disabled";
        btn4.Size = new Size(190, 40);
        btn4.Location = new Point(5, 140);
        btn4.Click += new EventHandler(btn4_clicked);
        tw.Control.Controls.Add(btn4);
    }
    catch
    {
        Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
        throw;
    }
    finally
    {
        Project.UndoContext.EndUndoStep();
    }
}

// The event handler for the first button.
static void btn1_clicked(object sender, EventArgs e)
{
    // Call the method that sets the SelectionMode.
    // See further down for this method.
    SetSelectionMode(SelectionModes.Surface);
}

// The event handler for the second button.
static void btn2_clicked(object sender, EventArgs e)
{
    // Call the method that sets the SelectionMode.
    // See further down for this method.
    SetSelectionMode(SelectionModes.Part);
}

// The event handler for the third button.
static void btn3_clicked(object sender, EventArgs e)
{
    // Call the method that sets the SelectionMode.
    // See further down for this method.
    SetSelectionMode(SelectionModes.Mechanism);
}

// The event handler for the fourth button.
static void btn4_clicked(object sender, EventArgs e)
{
    // Call the method that sets the SelectionMode.
    // See further down for this method.
    SetSelectionMode(SelectionModes.Disable);
}

// This method sets the selection level.
static void SetSelectionMode(SelectionModes mode)
{
    // Go through all present windows.
    foreach (Window w in UIEnvironment.Windows)
    {
        // If there is a DocumentWindow that contains a GraphicControl
        if ((w is DocumentWindow) && (w.Control is GraphicControl))
        {
            // Set the SelectionMode.
            GraphicControl gc = w.Control as GraphicControl;
            if (gc != null)
                gc.Picker.SelectionMode = mode;
        }
    }
}
Version Information

Supported in: 1.0.0.0
See Also