Ranking bodies by "altitude"

Hello,

How can I find out which body in my part has the lowest "altitude"? For each body, I would like to detect the lowest z coordinate and compare these values in order to choose the body that has the lowest elevation. Is that possible with the API?

Thank you for your help!

Best regards.

SolidworksApi macros