if you change "Standard" + "YourTextstyleName" to what you need
this changes the styles
[CommandMethod("tts")]
public static void TableStyleTest()
{
Document doc = acadApp.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
Database db = doc.Database;
string tableStyleName = "Standard";
string textStyleName = "YourTextstyleName";
using (Transaction tr = db.TransactionManager.StartTransaction())
{
TextStyleTable tstyles = tr.GetObject
(db.TextStyleTableId, OpenMode.ForRead) as TextStyleTable;
if (!tstyles.Has(textStyleName)) return;
ObjectId newId = tstyles[textStyleName];
if (newId == ObjectId.Null) return;
DBDictionary dic = tr.GetObject(db.TableStyleDictionaryId, OpenMode.ForRead) as DBDictionary;
foreach (DictionaryEntry eDict in dic)
{
TableStyle tableStyle = tr.GetObject
((ObjectId)eDict.Value, OpenMode.ForRead) as TableStyle;
if (tableStyle.Name == tableStyleName)
{
tableStyle.UpgradeOpen();
foreach (RowType rt in Enum.GetValues(typeof(RowType)))
{
if (rt == RowType.UnknownRow) continue;
//if (rt = RowType.DataRow) yadayada;
ed.WriteMessage("\n" + rt.ToString() + " textstyle is "
+(tr.GetObject(tableStyle.TextStyle(rt),OpenMode.ForRead)
as TextStyleTableRecord).Name);
ObjectId idv = tableStyle.TextStyle(rt);
tableStyle.SetTextStyle(newId, (int)rt);
}
}
}
tr.Commit();
}
} // end TableStyleTest