GetObject can´t select only curves


I try to select only curves with a GetObject( ) using GeometryFilter = ObjectType.Curve but the edges of a mesh are included in at the possibilities os selection.
How can I select only Curves?


Hello - you can turn off sub-objects for GetObject()


I looked at this, but suppose you do want to be able to select sub-objects that are curves - such as brep edges - but not include mesh wires. I tried for awhile to figure out a way to exclude that particular class of object from ObjectType.Curve, but it looks like my programming skills are not good enough. Either they selected anyway or it threw some fairly cryptic error messages.

Hi Mitch - you can do this with a custom filter - this ought to work…

    def EdgeFilter( rhino_object, geometry, component_index):
        if component_index.ComponentIndexType == Rhino.Geometry.ComponentIndexType.BrepeEdge:
            return False
        return True
   go.SetCustomGeometryFilter (EdgeFilter)

But leave sub-objects on in this case.


OK, thanks Pascal, I’ll look at that - I played with the custom filter in fact, but I wasn’t using ComponentIndexType but rather via geometry which was probably why it failed.