GetObject selects SubD Objects when filtered for Brep still selects SubD

When using GetObject with a filter set to select only Breps GetObject will still select SubD objects.
Is this intentional, if so how do I filter for breps and breps alone?

Code to reproduce:

// #! csharp
using System;
using Rhino.Geometry;
using Rhino.Input.Custom;
using Rhino.DocObjects;
GetObject getObject = new GetObject()
{
    GeometryFilter = ObjectType.Brep
};

getObject.GetMultiple(0,1);

Hi @Cristopher_Russ,

Yes. If the object can be converted to the filter type it will be selected.

Something like this should work:

// #! csharp
using System;
using Rhino;
using Rhino.Commands;
using Rhino.DocObjects;
using Rhino.Geometry;
using Rhino.Input;
using Rhino.Input.Custom;

var test = new Test();
test.Main();

public class Test 
{
    public void Main() 
    {
        GetObject go = new GetObject();
        go.SetCommandPrompt("Select surface or polysurface");
        go.SetCustomGeometryFilter((obj, geometry, ci) =>
        {
            return geometry is Surface || geometry is Brep;
        });
        go.Get();
        if (go.CommandResult() != Result.Success)
            return;
        // TODO...
    }
}

– Dale

Hey Dale,

Thanks for answering, your solution works great.