link dimensions macro or vb script

Can anyone please advise me on how to create a macro or vbscript to link dimensions by clicking on the dimension I want tolink to rather than the usual long handed way?
TIA

NigelSolidworksApi macros