C# - List of selected grips on a mesh

Hi,

How do I get a list over selected grips on a mesh using C#?
In Python this works : selectedList = rs.SelectedObjectGrips(mesh_id)
How do I do this in C#?

Regards
Ove

You can look at the source of the function to see how it’s done:

Starting in line 325

Thank you Lando,

But I have a Python script that works, but I want to do this in C#.
What is the equivalent of
selectedList = rs.SelectedObjectGrips(mesh_id)

using RhinoCommon and C#.

Regards

Ove

Yes, the source code shows you what rhinocommon methods are used to get the behaviour of rs.SelectedObjectGrips. If you can’t translate python to C# I can do it for you. Maybe try it first and post here if you get stuck

Thank you Lando,

Your document have a lot of interesting functions, so I wish I was able to convert them to C#.
If you could post the C# code for UnselectObjectGrips - ( the last function) it sure will be a great help.

To my original problem - list selected grips - I made this function:

        GripObject[] arrGrips = obj.GetGrips();
        if (arrGrips == null || arrGrips.Length == 0)
            return Result.Failure;

        Global.lstGrpIndex.Clear();

        foreach (GripObject grip in arrGrips)
        {
            if (grip.IsSelected(true) == 2)
            {
                Global.lstGrpIndex.Add(grip.Index);
             }
        }

All advice and improvements are received with thanks!

Regards

Ove

Yes can do, I’m on vacation right now so it will take some time before I’m touching a computer again though