Get Schedule elements category

How get Category of elements (for example BuiltInCategory.OST_MEPSpaces… )included in ViewSchedule

this category we choose when schedule create
image

i want to get this category in Exist schedule
image

You can get the CategoryId from the schedule definition with Python.

1 Like

Many Thanks Nick_Boyts !

this example to filter category from any schedules

var All_schedules_Spaces = new FilteredElementCollector(doc).OfClass(typeof(ViewSchedule)).Where(x=> (x as ViewSchedule).Definition.CategoryId.IntegerValue == new ElementId(BuiltInCategory.OST_MEPSpaces).IntegerValue).Cast<ViewSchedule>();

1 Like