I altered a python get text height node and then found a text height node and was testing with both of those on already made text. It works however if I try to add it to a script that creates text notes and place it after the node that sets the text width it only returns 0.
if isinstance(IN[0], list):
textInput = UnwrapElement(IN[0])
else:
textInput = [UnwrapElement(IN[0])]
My next warning I got was this:
Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed.
Traceback (most recent call last):
File “”, line 29, in
File “”, line 19, in CloseAllTransactionAndRegenerateDocument
Exception: Modification of the document is forbidden. Typically, this is because there is no open transaction; consult documentation for Document.IsModified for other possible causes.
EDIT:
I think perhaps the issue isn’t with the get height python node I created because the built-in TextNote.Height is returning 0 as well.
The Revit.Elements.TextNote element I’m getting is straight from a node that sets the widths so the notes should have differing values. Even if it didn’t work it should at least return the height for one line of text rather than 0.
Figures, sometimes the transaction aint committed, thats why you arent able to query the new data generated, no matter what kind of methodology you used. thats why i suggested the force close any on-going transaction before query any new elements generated.
but still, glad that you are able to solve it
EDIT: Sorry for the code error typo there, everything was typed on the fly without checking
In their node, they called the exact same method as i do, except for the last line where dynamo uses UIDocument.RefreshActiveView(Revit API) rather than Document.Regenerate(Revit API)
Maybe you can try it out in the python script and let us know?
EDIT: Incase you know which line to replace, just replace doc.Regenerate() with DocumentManager.Instance.CurrentUIDocument.RefreshActiveView() in the CloseAllTransactionAndRegenerateDocument() method in the python script