Selection count objects different?

Using the code below i’m getting a different count for selection.It looks like the missing obj is the one with property Name = “reference”. So how can i get the same result from GetSelectedObjects? Or how can i select that “reference” object?

private void OnSelectionObjects(object sender, Rhino.DocObjects.RhinoObjectSelectionEventArgs e)
{
IEnumerable<Rhino.DocObjects.RhinoObject> selectedRhinoObjs = Rhino.RhinoDoc.ActiveDoc.Objects.GetSelectedObjects(true, true);
int countObjects = selectedRhinoObjs.Count();
int countObjectsFromParameter = e.RhinoObjects.Count();
}

Probably some objects are hidden maybe?

Then you need to add a filter:

Dim filter = New ObjectEnumeratorSettings()
filter.NormalObjects = True
filter.LockedObjects = True
filter.ActiveObjects = True
filter.ReferenceObjects = True

yes it is! thx! i didn’t know about the method GetObjectList(ObjectEnumeratorSettings settings);
i’m new of rhinocommon :smiley:

thx a lot.

No problem, good luck exploring :slight_smile: