After you select the objects the results are printed in the commandline/textscreen and not a table to be inserted in your drawing. That would require additional coding.
However, the results you are looking for do not match the text that is counted in your example drawing.
- If you count and add the numbers before 'A', the result will be 3, but you show 6
- For 'B' it's 12 but you show 24
- For 'C' it's 8, but you show 16
Considering the above you would say all numbers need to be multiplied by 2 to get the result you are looking for, but......
- For 'F' the result is 13, but you show 46
Where do those numbers come from? What are you counting exactly?
Your example drawing doesn't clarify enough what the relation between the texts (like '3-C') and the results you want are.
'2-B' and '1-B' in your drawing makes a total of 3x 'B', so where does the 6 come from?