It would be great to be able to access the Bounding Box data about the part directly using API.
Please see the ER and go vote for it.
Text of the ER:
ER - 1-18088805035
Summary - Add API object to get data from the Geometry Bounding box
Description - Product Version in Use : SW2018
Explanation : Product Version in Use : SW2018
Explanation : Solidworks has had a weakness in that there has been no good way to get length, width and depth information from parts. In the past the best way (that I know) was to get the size info manually.
When a geometry bounding box is inserted it allows us to get far more accurate data on the length, width and depth of objects in the part. Our organization has literally thousands of parts on which we do not have size information. In order to get accurate part size information using API currently you have to open the part, iterate the faces, iterate all the tessellation triangles on those faces and record the min and max values of the points. This can take quite a bit of processing time depending on the complexity of the faces and number of faces. In contrast the Geometry Bounding Box seems very fast and accurate.
Please provide the Geometry Bounding Box feature data in API to be able to access the data from the bounding box. When you hover a Bounding Box feature in the feature tree you get:
Total Bounding Box Length
Total Bounding Box Width
Total Bounding Box Thickness
Total Bounding Box Volume
Bounding Box Type
Hidden Bodies Included
Surface Bodies Included
With this feature one could get the metadata of all stand alone parts as well as iterate through an assembly, extract the bounding box info of the contained parts and derive a bounding box of an assembly.