The Autodesk.Revit.DB.Mechanical.DuctSizeIterator
class represents an iterator for a collection of duct sizes in a mechanical system within a Revit project. This class can be used to iterate over a list of duct sizes and access their properties.
The Autodesk.Revit.DB.Mechanical.DuctSizeIterator
class has the following properties:
Autodesk.Revit.DB.Mechanical.DuctSize
object in the iterator.The Autodesk.Revit.DB.Mechanical.DuctSizeIterator
class has the following methods:
Autodesk.Revit.DB.Mechanical.DuctSize
object in the collection.The following example demonstrates how to use the Autodesk.Revit.DB.Mechanical.DuctSizeIterator
class to iterate over a collection of duct sizes in a mechanical system and output their width and height properties:
// Get a mechanical system in the Revit project
MechanicalSystem system = ... ;
// Get the duct sizes iterator for the system
DuctSizeIterator iterator = system.DuctSizes.ForwardIterator();
// Iterate over the collection and output width and height properties
while (!iterator.IsDone)
{
DuctSize ductSize = iterator.Current;
Console.WriteLine("Width: " + ductSize.Width);
Console.WriteLine("Height: " + ductSize.Height);
iterator.MoveNext();
}
The Autodesk.Revit.DB.Mechanical.DuctSizeIterator
class is typically used with the Autodesk.Revit.DB.MechanicalSystem.DuctSizes
property to access and iterate over a collection of duct sizes for a particular mechanical system in a Revit project. It can be used to perform various operations on the duct sizes, such as filtering, sorting, or modifying their properties. Before accessing the properties of a duct size, you must first call the MoveNext()
method to advance the iterator to the next object in the collection. The Dispose()
method should be called to release any resources used by the iterator when it is no longer needed.