in the macro get the selection object of the document. you might also want to use selectelement2 (single selection) or SelectElement3 (multiple selections) in the macro to allow users to select a dimension if on is not already selected
Read the API documentation for these calls. and be careful of earlybinding / strong typing the selection object if you are going to use any of the calls that require an array of variant strings.
Very roughly something like the following (not tested)
Dim oDoc
Dim oSel
Dim vaFilter(0)
Dim sRet
Dim oObject
Set oDoc = CATIA.activeDocument
Set oSel = oDoc.Selection
vaFilter(0) = "DrawingDimension" 'not sure if this is the correct type name for a dimension object
sRet = oSel.SelectElement2(vaFilter,"Select Dimension", true) 'the true here allows preselection
if sRet = "Normal" then
set oObject = oSel.item(1).value
else
msgbox "Selection canceled"
end if