OK - I found one method for an annotation or purely text string -
hdl = add_block(gcs, testString, 'Position', remotePos)
ob = get_param(hdl,'object')
bb = ob.getBounds;
wh = bb(3:4)-bb(1:2);
There's a couple wrinkles - need to strrep(...) any '/' chars in the string with '//' and any '\n' with char(10).
One problem this doesn't solve, however, is block annotations. Is there a method of getting the actual string that's displayed (after variable substitution?)
The 'AttributeFormatString" is just that, a format string. To estimate the bounding box, one needs to replace each format item %<ParamName> in the AttributesFormatString with the actual value of the parameter. Is this string available from the block via some method or parameter?
Or is it necessary for each Simulink user to write a snippet to identify instances of %<ParamName> in the AttributesFormatString and do the appropriate substitution? Tedious and introduces special cases - and, again - Simulink has already done this internally in order to display the block annotation text.