I'm working on a material collection project in Revit right now. Part of this collection hinges on obtaining a plus-minus report that lists all elements and their properties for each 'option set' in the house.
Revit has a 'DesignOption' field for each element, whether it be a system family or a custom family, that defaults to 'Main Model.' Once the item is placed into a design option, this is obviously changed to the design option id in the database. Here I get an IList<T> of the walls in the main model:
/*Walls in Main Model*/ BuiltInParameter bip = BuiltInParameter.DESIGN_OPTION_PARAM; ParameterValueProvider provider = new ParameterValueProvider(new ElementId(bip)); FilterStringRuleEvaluator evaluator = new FilterStringEquals(); FilterRule rule = new FilterStringRule(provider, evaluator, "Main Model", false); ElementParameterFilter filter = new ElementParameterFilter(rule); FilteredElementCollector collectorCoreWalls = new FilteredElementCollector(m_doc).OfClass(typeof(Wall)).WherePasses(filter); IList<Element> coreWalls = collectorCoreWalls.ToElements();
The same can be done for Floors (Floor), Roofs (RoofBase), Ceilings and Floors (CeilingAndFloor) and others.
Next post I'll show how to loop through Design Option Elements.