Bouding Box of a Mesh.

I am looking a borrowing lifting a section of code from a similar application that calculates the bounding box of a FreeCAD file as follows.

bbox = FreeCAD,BoundBox()
... Loops through file accessing via variable obj ....
   bbox.add(obj.Shape.BoundBox)

But I don’t think this works for a Mesh Object.

I might be wrong in that a Mesh object also has a BoundBox value and just needs to be accessed in the right way.
i.e.

if mesh
   bbox.add("Some value reference")
else
  bbox.add(obj.SHape.BoundBox)

But got the impression that some how FreeCAD has to calculate the boundary box of a mesh.

If so is there some function that I can use, rather than write ones own.

you may have a look at this thread
https://forum.freecadweb.org/viewtopic.php?f=3&t=31372#p261302
https://forum.freecadweb.org/viewtopic.php?f=3&t=31372#p261021

Thanks all sorted I just had to add a series of hasattr tests to the object to make the right boundBox call