Editing Schedule

Editing Schedule

ahmedsherif9220
Contributor Contributor
209 Views
1 Reply
Message 1 of 2

Editing Schedule

ahmedsherif9220
Contributor
Contributor

Hello All ,

I want to ask about some thing if it is applicable to do using Revit API or not I tried to make edit in the body of the schedule but it always throws an exception that i can't make it ?

I want to move the text header for the sorting group from left to right 

thank you in advance .

move.png

210 Views
1 Reply
Reply (1)
Message 2 of 2

ahmedsherif9220
Contributor
Contributor

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 

 

0 Likes