Change data in Key schedule

Change data in Key schedule

pmazzoni123
Participant Participant
719 Views
0 Replies
Message 1 of 1

Change data in Key schedule

pmazzoni123
Participant
Participant

I'm trying to bring in some text from an Excel file and use it to populate a key schedule I already have created in Revit.  The key schedule that I want to modify will be the active view when I use this command.  I've figured out how to access and store the Excel data but I can't figure out how to push it into the schedule. 

 

This is what I have so far:

 

            
            //List to store each class object associated with the RowData class 
//which in turn holds the data from each row in the Excel file. List<RowData> rowList = new List<RowData>(); for (int r = 1; r <= rowCount; r++) { //This addds the new instance of the class RowData to the list rowList. rowList.Add(new RowData()); rowList[r - 1].NoteNumber = xlRange.Cells[r, 1].Value2; rowList[r - 1].NoteText = xlRange.Cells[r, 2].Value2; }
UIDocument uiDocument = commandData.Application.ActiveUIDocument; Document document = uiDocument.Document; View activeView = uiDocument.ActiveView; Transaction t = new Transaction(document, "Import Schedule Footer Notes"); t.Start(); //I want to go through the key schedule row by row and update the first 2 cells in that row. foreach (RowData n in rowList) { //I'm not sure what to put here to change the text in the cell.
//current row first cell = n.NoteNumber;
//current row second cell = n.NoteText; } t.Commit();

I am new to the api and relatively new to programming so an example would help but an explanation of the example would be even better.  I'm trying to learn.

0 Likes
720 Views
0 Replies
Replies (0)