Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Revit Schedule - Title/headers

12 REPLIES 12
SOLVED
Reply
Message 1 of 13
travis_cadnetics
4471 Views, 12 Replies

Revit Schedule - Title/headers

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

12 REPLIES 12
Message 2 of 13

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 13

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 13

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 13
spesci
in reply to: travis_cadnetics

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

 

Thanks in advance,

 

Scott

Message 6 of 13
hkba
in reply to: jeremytammik

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
Message 7 of 13
RustyHyde
in reply to: hkba

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

Message 8 of 13
spesci
in reply to: RustyHyde

Thanks, I got it to work.

Message 9 of 13
jeibbiej
in reply to: spesci

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

Message 10 of 13
zhounnin
in reply to: travis_cadnetics

is it possible to modify text inside header?

Message 11 of 13
brownbr2VHQE
in reply to: spesci

Care to share your method?
Message 12 of 13
H.echeva
in reply to: travis_cadnetics

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 13
jeremy_tammik
in reply to: H.echeva

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community