rhinoscriptsyntax.BoundingBox not accepting python sets

Hi,

@stevebaer I suppose:

I just found that a python set object is not accepted as itterable in rhinoscriptsyntax.BoundingBox

geometry.py starting at line 343:

    bbox = Rhino.Geometry.BoundingBox.Empty
    if type(objects) is list or type(objects) is tuple:
        for object in objects:
            objectbbox = __objectbbox(object, xform)
            bbox = Rhino.Geometry.BoundingBox.Union(bbox,objectbbox)
    else:
        objectbbox = __objectbbox(objects, xform)
        bbox = Rhino.Geometry.BoundingBox.Union(bbox,objectbbox)

.
.
as utility.py coerceguidlist does successfully coerces a list from a set this could better read:

utility.py coerceguidlist does not handle sets , I think it would be a valuable addition to also accept sets and use it at BoundingBox like below

    bbox = Rhino.Geometry.BoundingBox.Empty
    objectlist = rhutil.coerceguidlist(objects)
    if not objectlist: return scriptcontext.errorhandler()
    for object in objectlist:
        objectbbox = __objectbbox(object, xform)
        bbox = Rhino.Geometry.BoundingBox.Union(bbox,objectbbox)

P.S. @stevebaer I now see the use of object as variable all over the modules yet that is a buildin python type…

-Willem

2 Likes

Right, ob or obj would be much better.

I logged https://mcneel.myjetbrains.com/youtrack/issue/RH-54962