Just the text, ma'am

I’m working on a script to identify when the upgrade to 2017 causes Text to Word-wrap.
Long discussion with more detail here

I’ve finally got it almost completely working, but now I’ve run into one more (last?) snag.
This whole thing is dependent on measuring the height of the Text Box and, while I’ve got it working for simple Text, I just found out that any Leaders are included in the Text Bounding Box.

Is there any way to measure the height of the actual Text Box WITHOUT Leaders?

Have you tried with the textElement.Height property?

Looks like these two got the same height output:

import clr

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

element = UnwrapElement(IN[0])

OUT = element.Height
4 Likes

turn them off, measure the box size, turn them back on. you might have to store the elbow position before you delete it so that you can set them to where they were afterwards.

I considered temporarily getting rid of them, but
a.) there are a LOT of permutations. Left/Right, Straight/Curved, not to mention multiple leaders from one Text.
b.) I’m talking about eventually running this on real projects, which could possibly have hundreds or thousands of Text Notes by the time you count all the Views, Legends, and Details

A quick experiment shows that the TextElement.Height might work.

Hmmm. Must have forgotten to post that previous one.
This is Brilliant!


All of the Notes in Magenta “gained” a word-wrap from the 2017 update but have now been corrected.
The Leader for first one in the upper left got messed up & switched to the top instread of the right, but I think this is going to go a LONG way to helping us get rolling on 2017.

Thanks for the help, guys!

1 Like

Hi Dave,

How did you get the text with leader work?

Sorry to tell you this Joel, but I did that manually after the fact.