How to get nested split schedules

I have found a solution:

My mistake was that I was trying to get the split schedule elements themselves to then place on a sheet. I later realized that the Create method used for creating an instance of a schedule on a sheet has an additional fifth argument segmentIndex As Integer, which is exactly what I needed in order to place the segments of the original schedule on a sheet.

for s in sheets:
    schedule_instance = get_cut_list(s)
    schedule_view = doc.GetElement(schedule_instance.ScheduleId)
    default_point = schedule_instance.Point
    shifted_point = XYZ(default_point.X + .2, default_point.Y, default_point.Z)

    with revit.Transaction('Delete Cut List Instance', doc):
        doc.Delete(schedule_instance.Id)

    with revit.Transaction('Split Cut List', doc):
        schedule_view.Split(2)

    with revit.Transaction('Place Cut List Segments', doc):
        ScheduleSheetInstance.Create(doc, s.Id, schedule_view.Id, default_point, 0)
        ScheduleSheetInstance.Create(doc, s.Id, schedule_view.Id, shifted_point, 1)
3 Likes