C# - Manipulating Selected Mesh Vertices

Ok, so I’ve tried to access selected Mesh vertices (selected using SelBrushPoints) but the IsSelected status doesn’t seem to be valid. I get no result from the following code despite the vertices being selected in the Rhino Viewport:

```
// Check if grips (control points) are enabled for this mesh

            if (!rhinoObj.GripsOn)

                RhinoApp.WriteLine("Error #3 - No grips");

            else

            {

                var grips = rhinoObj.GetGrips();

                if (grips != null && grips.Length > 0)

                {

                    for (int i = 0; i < grips.Length; i++)

                    {

                        if (grips\[i\].ComponentStatus.IsSelected) // Check if this grip is selected

                        {

                            selectedPoints.Add(grips\[i\].CurrentLocation); // The Point3d position

                            selectedIndices.Add(grips\[i\].Index); // The index in mesh.Vertices

                        }

                    }

                }

            }

```

Any hints about how to access the already selected Mesh vertices?

//Rolf

ComponentStatus.IsSelected doesn’t work for checking grip selection.
Use IsSelected() on the grip instead.

foreach(var grip in grips)
    if(grip.IsSelected(false) == 2)
        selectedPoints.Add(grip.CurrentLocation);

Thank you, that worked well!