The Autodesk.Revit.DB.Structure.StructuralWallUsageFilter
class is a filter used to select walls based on their structural usage. This filter is available in Revit's API through the ElementParameterFilter
class.
This filter has the following properties:
StructuralUsage
- an enumeration that lists the different types of structural usage that a wall can have. This property can be used to filter walls based on their usage, such as structural or non-structural.The Autodesk.Revit.DB.Structure.StructuralWallUsageFilter
class has the following constructor:
StructuralWallUsageFilter(StructuralWallUsage usage)
- creates a filter based on the specified structural wall usage.The following example code snippet shows how to use the Autodesk.Revit.DB.Structure.StructuralWallUsageFilter
class to select all walls that have a structural usage:
// Create a filter for walls with a structural usage
ElementParameterFilter filter = new ElementParameterFilter(
new StructuralWallUsageFilter(StructuralWallUsage.Structural)
);
// Get all walls that match the filter
IList<Element> matchingWalls = new FilteredElementCollector(doc)
.OfCategory(BuiltInCategory.OST_Walls)
.WherePasses(filter)
.ToList();
Using filters to select elements in Revit can greatly simplify the process of manipulating model elements through the API. The Autodesk.Revit.DB.Structure.StructuralWallUsageFilter
class is just one example of the many filters available in Revit's API.