Revit Schedule - Title/headers

Revit Schedule - Title/headers

travis_cadnetics
Enthusiast Enthusiast
8,702 Views
13 Replies
Message 1 of 14

Revit Schedule - Title/headers

travis_cadnetics
Enthusiast
Enthusiast

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).

0 Likes
Accepted solutions (1)
8,703 Views
13 Replies
Replies (13)
Message 2 of 14

jeremytammik
Autodesk
Autodesk

Dear Tjohnson,

 

Thank you for your query.

 

I am discussing it with the development team.

 

I hope this helps.

 

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 14

jeremytammik
Autodesk
Autodesk
Accepted solution

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,



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 4 of 14

travis_cadnetics
Enthusiast
Enthusiast
That makes sense to me. As someone who is new to Coding and the Revit API, I just wanted to be sure I was understanding the results that I was getting. I assume that this was the case when I searched the SDK Documentation received results for either the Panel Schedule or the regular schedule data. Thanks for the clarification.
Message 5 of 14

Anonymous
Not applicable

I need to change all schedule header text to upper case. Is this possible?

 

Thanks in advance,

 

Scott

Message 6 of 14

Anonymous
Not applicable
Do you have an example of how to modify the header (insert in line and columns and inserting text in the cells)?
Greetings Håkon Frank
0 Likes
Message 7 of 14

RustyHyde
Explorer
Explorer

I know this is very old but I need an answer to this as well.

0 Likes
Message 8 of 14

Anonymous
Not applicable

Thanks, I got it to work.

0 Likes
Message 9 of 14

Anonymous
Not applicable

How? I also need to modify the headers based on our standard schedule.

0 Likes
Message 10 of 14

zhounnin
Advocate
Advocate

is it possible to modify text inside header?

0 Likes
Message 11 of 14

brownbr2VHQE
Contributor
Contributor
Care to share your method?
0 Likes
Message 12 of 14

H.echeva
Advocate
Advocate

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));
		}

 

 

 

Message 13 of 14

jeremy_tammik
Alumni
Alumni

Thank you for kindly sharing your implementation, Hernan! I hope that will help resolve the4 issue for all the others above.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 14 of 14

ekaterina.kudelina93H47
Explorer
Explorer

There is a possibility to rename column header within Body section using ScheduleDefinition.ColumnHeading, the property has setter as well. Conserning getting value of a Body section cell, from my experience, it is to use method GetCellText of class ViewSchedule rather than the same method of class SectionData (the second one always returned me empty string). Also for complex headers (merged/groupped) I played around with methods ViewSection.GroupHeaders/UngroupHeaders (it allows to set new text) and SectionData.GetMergedCell to detect if a cell is a part of merging.