How to get the minimum distance with API

Please tell me.

I want to measure the shortest distance between parts with VBA, like the attached capture.

It's easy to do with SOLIDWORKS commands, but I don't know how to calculate the minimum distance using the VBA API.

Even if I record a macro, it doesn't record correctly, which is a problem.

I'm looking at help but I don't understand.

Please let me know if you have a good sample.

Thank you.

SolidworksApi/macros
Answers 2
AT
AT 2021-04-08 Best Answer
YA
YA 2021-04-08

Best answer.
Thank you very much.

I didn't notice the "IMeasure Interface".
It was helpful.