I have been working with creating text types for awhile.
I'm currently using C#: - Revit 2013
// Create a duplicate Element ele = textNote.TextNoteType.Duplicate(txtType); TextNoteType noteType = ele as TextNoteType;
I can easily change Font Type to Arial Narrow along with almost everything else.
noteType.get_Parameter("Text Font").Set("Arial Narrow");
I cannot find any information on the following:
Received info on Text Style Background.
// Text Background 1 = Transparent or 0 =Opaque
noteType.get_Parameter("Background").Set(1);
>>> How do I set Text Style Background?
In the previous update, you mentioned the mothod to call the line.
noteType.get_Parameter("Background").Set(1);
Actually this doesn't help. I checked that for any color, the text style object's "Background“ Parameter value is always 1. Revit API cannot set specific color as the text style back ground.
>>>How do I set Text Style Color?
Text color can be set by changing the text style object's "Color" parameter value. The color value in the RGB value in decimal.
for example: noteType.get_Parameter("Color").Set(16744448); //16744448 = (R=155 G=128 B=0)
>>>How do I set Text Style Keep Readable option?
Directly chang ethe text object's "Keep Readable" parameter value to 1. Note this parameter doesn't belong to the text type, but text element itself.
For example:
textnote.get_Parameter("Keep Readable").Set(1)
>>>How do I set Text Style Project Leader Arrowhead Style?
noteType.get_Parameter("Leader Arrowhead").set(headTypeElementId) //Here input the head type element's ElementId.
Ahh... you had me pulling my hair out until I realised that your colour value was incorrect!
Color(R=155, G=128, B=0) actually equals 32923 (and NOT 16744448)... this is confirmed with RevitLookup utlity in Revit 2013.
For those interested you can convert a "Color" object to the int that Revit requires with ColorTranslator.ToWin32(color)
Can't find what you're looking for? Ask the community or share your knowledge.