- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello;
I am using the Revit API to import text from MTEXT entities (Autocad) and create properly formatted TextNote objects in Revit.
For example, an Mtext string may have an embedded "\P" code in it indicating the start of a new paragraph (hard return). For use in Revit, I replace that code with a "\r". Python code looks like MtextStr = MtextStr.Replace ("\\P", "\r"). This is all well and good.
Now on to Newlines. A newline is way of continuing a paragraph on a new line without creating a new paragraph. For example, it can be used to create numbered list with a blank line in it as shown below:
1) Item
2) Next Item
Such a task can easily be done by a Revit user using shift-key + enter. However Revit API doc says "Newline characters ('\n') are not allowed." when creating a Text Note. By examining a user created text note with a new line added to it, I see the code "\x0b" embedded in the string.
Creating a TextNote using the api, shows that I can indeed create a Text Note with a newline by using the above code. This code however is not documented.
So the question is, what are the formatting codes allowed by Revit? I hope to avoid long hours of trial and error if the knowledge I seek is already out there.
Sincerely;
Michelle
Solved! Go to Solution.