I don't like to sound discouraging, but that seems like a near-impossible task to automate.
The only way I can even start to think about how to do it would be to have a routine run an 'IntersectWith function on each piece of Text in comparison with each of the Block's perimeter Polylines, to find out whether it overlaps any of them. Where it does, presumably it would have to compare the intersection locations with the Block's overall extents to figure out which way to Move the Text. It would Move it a little, try again, and repeat until it no longer intersects with that boundary object.
But several complications arise:
In the case of the "1" at the top-most "peak" of the ST2 Block, the X direction that would get the Text closer in its X coordinate to the X coordinate of the Block's middle would be leftward, so it would presumably Move it in the wrong direction, and end up with it outside the boundary when it finally doesn't intersect that edge any more.
If it can somehow [and I don't have any idea how yet] be made to figure out a way to go in the right direction, in similar situations [not quite true here] it could easily Move a piece of Text until it clears the one edge, but then it could intersect another edge. So it would have to compare the Text to every edge again, and presumably Move it [in this case] downward a little [closer to the Block midpoint's Y coordinate] and go through the whole exercise again, hoping that eventually it will get it clear of one edge without crossing another one.
Then there's the fact that the IntersectWith method works with the rectangular bounding box of the Text. Again, in the case of that "1", because of the angle of the boundary where it intersects it, if a routine Moves it to the right, it would have to Move it farther to get no intersection than is necessary for the character itself to clear the boundary. So it could end up Moving it more than is really required, and causing an intersection with another boundary object unnecessarily.
And what if a Text object is originally fully outside the boundary, and doesn't intersect any edge? How would a routine know it had to be Moved at all, let alone in what direction? That might be possible if the boundary of each Block was one Polyline [there are routines around here to determine whether or not a location is inside a closed Polyline], but when they're separate pieces like this, some of them concave and some convex in relation to the overall shape, it's really hard to imagine how a determination could be made.
I'm stumped.... I think the time it would take you go do it manually, even on a pretty large number of such Blocks, would be far less than the time it would take someone to come up with code to do it automatically.
Kent Cooper, AIA