In Revit the Schedule defines specific areas by name. Title, Headers, Body.
The API does not seem to be consistant with this data. If you export api header data, Im getting schedule "Title". The schedule "Headers" are part of the body data.
Has anyone else come to the same conclusion?
The Enumneration for the sectionTypes seem likes it should be: None, Title, Headers, Body, Summary, Footer (and..there should even be a Grouping Header and a Grouping Footer, but thats not the point of this post).
Solved! Go to Solution.
Solved by jeremytammik. Go to Solution.
Dear Tjohnson,
Thank you for your query.
I am discussing it with the development team.
I hope this helps.
Best regards,
Jeremy
Dear Tjohnson,
I heard back from the development team, and they say:
It's complicated. Are you sitting down for this?
The TableView and related TableData classes are more generic than just regular view schedules. For example, they also support PanelViewSchedules for the electrical discipline, which are also a grid-like organization of data, text and images, but offer different options to layout and edit the contents.
Because this is a more generic framework than regular Revit schedules, and regular Revit schedules existed and were migrated into this framework, there are some design compromises in place and this question is centered around one of those design compromises. Specifically, the entire Revit-generated grid with the parameter content which makes up the 'schedule' has been placed in the Body section of the TableView. This includes the generated column headers and grouped headers, the generated text, and even the blank spaces in between 'sections' of the Revit schedule. So if you use the TableView and related APIs to iterate over the cell-by-cell contents of the Body, you get almost everything that is in the schedule.
In fact, regular schedules do have a separate section for the title, which is the Header section. Nominally when the schedule is created this is just the title in a single cell, but you have tools on the ribbon to insert new rows and columns, merge cells, insert images, etc. (And this is also possible using the API). So the header of a standard Revit schedule can contain much more than just the title, but it does not include the columns supplied by the information (e.g. the list of parameters) in the ScheduleDefinition.
I hope this helps.
Best regards,
I need to change all schedule header text to upper case. Is this possible?
Thanks in advance,
Scott
Hello,
I found this post which was very helpful, thank you @Anonymous for the info.
I have created a small example macro that gets the Header text (it is very basic and may need to be made safer). I hope this helps
/// <summary>
/// This macro gets the header text of the active Schedule View
/// </summary>
public void ScheduleHeader()
{
UIDocument uidoc = this.ActiveUIDocument;
Document doc = uidoc.Document;
ViewSchedule mySchedule = uidoc.ActiveView as ViewSchedule;
TableData myTableData = mySchedule.GetTableData();
TableSectionData myData = myTableData.GetSectionData(SectionType.Header);
TaskDialog.Show("Header Info", "The Header Text is: \n" +myData.GetCellText(0,0));
}
Thank you for kindly sharing your implementation, Hernan! I hope that will help resolve the4 issue for all the others above.