The Autodesk.Revit.DB.Mechanical.SpaceTagFilter
is a class in the Autodesk Revit API that represents a filter for space tags. It can be used to retrieve a collection of space tags that meet certain criteria.
The Autodesk.Revit.DB.Mechanical.SpaceTagFilter
class has the following properties:
CategoryId
: Gets or sets the category id of the space tag.FamilyName
: Gets or sets the family name of the space tag.TypeName
: Gets or sets the type name of the space tag.The Autodesk.Revit.DB.Mechanical.SpaceTagFilter
class has the following methods:
Equals
: Determines whether the specified object is equal to the current object.GetHashCode
: Serves as the default hash function.GetType
: Gets the Type of the current instance.Matches
: Determines whether the space tag matches the filter.The following code example demonstrates how to use the Autodesk.Revit.DB.Mechanical.SpaceTagFilter
class to retrieve a collection of space tags that have the category id of "HVAC".
FilteredElementCollector collector = new FilteredElementCollector(doc);
ICollection<Element> spaceTags = collector
.OfClass(typeof(SpaceTag))
.WherePasses(new Autodesk.Revit.DB.Mechanical.SpaceTagFilter(new ElementId(BuiltInCategory.OST_MEPSpacesTags))))
.ToElements();
In this example, we are creating a FilteredElementCollector
that retrieves all instances of the SpaceTag
class, and then using the WherePasses
method to apply a filter that retrieves only space tags that have the category id of "HVAC".
The Autodesk.Revit.DB.Mechanical.SpaceTagFilter
class is a powerful tool for filtering space tags in Autodesk Revit. With its properties and methods, it allows users to retrieve collections of space tags that meet specific criteria, making it easier to analyze and work with large models.