Querying Schedules

In Revit API, Schedules are a type of view (DB.View) and are represented by the DB.ViewSchedule. Schedules have a different rendering method. Instead of showing the elements graphically, they list the element and their properties according to the schedule settings, and in a spreadsheet style

In Revit, Keynote Legends (although named Legend) are actually schedules. You can check whether a schedule is a keynote schedule by checking DB.ViewSchedule.IsInternalKeynoteSchedule property

Querying Schedules Types

Since schedules are actually views, we can use the same workflow as for Views, to work with schedules:

Find Specific Schedules Type

Querying Schedules by Type

Finding Specific Schedule