but the bounding box has zero height and width
I have to add the text to the Rhino document and get back its TextEntity object to get a working bounding box
Is this expected behaviour ?
Or am I making mistakes in building the object ?
I don’t see any change when trying Emilio’s script, so looks like it hasn’t been fixed yet. @stevebaer I also didn’t find any bugtrack item for it, but maybe I missed something.
I also faced the exact same problem…
The trick I used to go around it is to explode the textentity, get all control points and construct a box from that, with the plane you used to create your textentity…
Not sure the BB of the control points will give you the correct BB of the objects themselves - better to get the BB of the exploded curves directly… no? --Mitch
I was of course digging into this first with GeometryBase.GetBoundingBox() but I got stuck because I thought there is no way you can have an array/list as a GeometryBase. Any hint on this?
It is also not clear in the SDK how to construct a GeometryBase from scratch.
If you want to get the combined bounding box of multiple objects you need to use the Union(BoundingBox, BoundingBox) method, you march through the list and union each succeeding item with the result of the union of the preceding items. Have a look at how the rhinoscriptsyntax rs.BoundingBox() method is written…