How to select a dimension and have it show up in a textbox

Is there anyway that you can select a dimension in solidworks click it and have it show up in a textbox? Any help would be greatly appreciated

SolidworksApi macros