GetTextRectangle - ends up at origin opposed to at text

I’m almost able to work with this but it would be helpful if the corners were the text’s actual corners. I also can’t find how to get the center/middle of these points (in one step). That would also be helpful.

I’m creating a script that adds Revit style leaders to dimensions. It’s working pretty good except it breaks in certain conditions. I’ve narrowed it down to mirrored objects (I think!!). There are so many ‘cases’ and uncertainties. I should just let it not work in rare conditions opposed to wasting my time, but I’ve gotten so close to having it perfect that it’s hard to leave it alone.

Something that might help would be if I can tell if the object was mirrored or not. But what I really need is to try and get the real center of the text (and/or it’s corners). The issue is that the points relative to that origin (I’m assuming it’s the object’s plane’s origin) are centered on it where the only text point I currently know how to get is underneath it.

Hi Keith, below is some code i used in the past to get the corner points and center point.

KCS_GetTextRectangle.py (1.5 KB)

_

c.

Thank-you!! I’ll have a look at this and incorporate it into the (functional) mess of a code I’ve created. This would cap it off.