See this post: (Get max dimensions of parts)
To create a bounding box:
To create a bill of materials with API:
To insert the maximum dimensions in the BOM you need to create custom properties with the values of the maximum dimensions.
You can use the workinig macro MainDim which will be found on my homepage and I will copy it here too.
This indeed does a lot more but also - if nothing else is wanted or defined - creates the range box of a part and writes it into the property table
The explanations in the xml files should help You for a proper setup.
Everything can be defined within those 2 files
fine to hear that.
If there are any questions regarding how to use it, please don't hesitate to ask.
I hope that my explanations in the XML files are understandable and useful.
The basic idea behind that macro was to offer the possibility defining variables, dimensions for main dimensions as proeprties in a 3D docuemnt used by BOm, title block and so on.
If there are no dims defined as main dimensions, the surounding block is used as x,y,z main dim.