设置字体的样式,大小,宽度系数
Transaction tr = new Transaction(doc, "text");
tr.Start();
IList<Element> listNote = new FilteredElementCollector(doc).OfClass(typeof(TextNoteType)).ToElements();
TextNoteType tny = listNote[0] as TextNoteType;
tny.get_Parameter(BuiltInParameter.TEXT_FONT).Set("宋体");
tny.get_Parameter(BuiltInParameter.TEXT_SIZE).Set(5/304.8);//注意要转换为英尺
IList<Parameter> pList = tny.GetParameters("宽度系数");
foreach (Parameter pl in pList)
{
pl.Set(1.0);
}
XYZ xyz = uidoc.Selection.PickPoint();
TextNote.Create(doc, doc.ActiveView.Id, xyz, "test", tny.Id);
tr.Commit();