select dimension by mouse

I want to make program by add dimension special tolerance from comany database. so I want pick up the dimension from drawing and add this dimension into text box in a small form, after that,select tolreance by this dimension from database,then add to solidwork drawing. however, I do not how to pick up dimension from drawing. I use C# toprogram.

Thanks

SolidworksApi macros