var viewSchedule = new FilteredElementCollector(document) .OfClass(typeof(ViewSchedule)) .FirstOrDefault(e => e.Name == "MyScheduleName") as ViewSchedule;