FindByCrossingWindowRegion bug

Hi @dale,

there seems to be a bug in the FindByCrossingWindowRegion method in V5 and V6. If the region contains a group, objects are found multiple times. To reproduce, please run below code with the file attached:

import Rhino
import scriptcontext

def DoSomething():
    p = Rhino.Geometry.Plane.WorldXY
    r = Rhino.Geometry.Rectangle3d(p, 20, 20).ToPolyline()
    v = scriptcontext.doc.Views.ActiveView.ActiveViewport
    f = Rhino.DocObjects.ObjectType.Curve
    rc = scriptcontext.doc.Objects.FindByCrossingWindowRegion(v, r, True, f)
    print "Found {} curves".format(rc.Count)

If finds 5 curves, but only 4 are in the file. If the 4 curves are ungrouped, it works OK. Additionally please select the objects (grouped or ungrouped) and then run the code snipped again. It does not find any curve.

FindByCrossingWindowRegion.3dm (45.8 KB)


Hi @clement,

Yes I can see that.

– Dale