public Result Execute(ExternalCommandData commandData,ref string message,ElementSet elements)
{
UIApplication uiapp = commandData.Application;
UIDocument uidoc = uiapp.ActiveUIDocument;
var app = uiapp.Application;
Document doc = uidoc.Document;
// Access current selection
Selection sel = uidoc.Selection;
sel.PickObject(ObjectType.Element);
FilteredElementCollector fec = new FilteredElementCollector(doc);
var schedule = fec.OfCategory(BuiltInCategory.OST_Schedules).Where(x => x.Name == "df").FirstOrDefault();
var viewSchedule = schedule as ViewSchedule;
var tabledata = viewSchedule.GetTableData();
var sectiondata = tabledata.GetSectionData(SectionType.Body);
TableCellStyle tcs = new TableCellStyle();
TableCellStyleOverrideOptions overrideOptions = tcs.GetCellStyleOverrideOptions();
overrideOptions.TextOrientation = true;
tcs.SetCellStyleOverrideOptions(overrideOptions);
Transaction tr = new Transaction(doc, "set");
tr.Start();
sectiondata.SetRowHeight(1, 20);
tr.Commit();
return Result.Succeeded;
}
for examble that is my code for setting height for a row in the body