Rhinoscriptsyntax polysurface filter also accepts single surfaces

If I run the following:

rs.GetObjects("Select a polysurface",rs.filter.polysurface)

it will also select a single surface object. The mechanism is clear, in selection.py we have:

image

Type 16 is a polysurface - but the filter accepts any brep, including a single face.

This is NOT the case with VB Rhinoscript, a type 16 excludes single faced breps.

Currently, if I want to filter correctly for a polysurface, I need to add a custom filter:

def real_ps_filt(rhino_object, geometry, component_index):
    if geometry.Faces.Count>1: return True

rs.GetObjects("Select a polysurface",rs.filter.polysurface,custom_filter=real_ps_filt)

Methinks this needs ‘adjustment’…

Hi Mitch,
Thanks for noticing that.
It’s been logged.