How to automatically calculate the maximum diameter of a plane profile


How to automatically calculate the maximum diameter of a plane profile?
for example,as shown above,Circle the two plane Outlines, and then you can find the value with the largest diameter in both planes