Get the dimension of part

Hello,

i'm trying to determine the dimension of part ( length and diameter) in SolidWorks using VB.net. but, i don't find the right algorithm.

can you help me please? i'm waiting and thank you.

SolidworksApi/macros