The Autodesk.Revit.DB.ParameterSetIterator class is used in Revit to iterate through a set of parameters.
The following methods are available for the Autodesk.Revit.DB.ParameterSetIterator class:
MoveNext(): Moves the iterator to the next parameter of the set. Returns true if the iterator is successfully moved to the next parameter, and false if there are no more parameters left to iterate through.
Reset(): Resets the iterator to the beginning of the set.
GetCurrent(): Returns the current parameter that the iterator is pointing to.
The following properties are available for the Autodesk.Revit.DB.ParameterSetIterator class:
Current: Gets or sets the current parameter that the iterator is pointing to.
Size: Returns the number of parameters in the set.
// create a new instance of parameter set iterator
ParameterSetIterator iter = element.Parameters.ForwardIterator();
// loop through each parameter in the set
while (iter.MoveNext())
{
Parameter param = iter.GetCurrent();
// do something with the parameter
}
// reset the iterator
iter.Reset();
// get the size of the set
int size = iter.Size;
The Autodesk.Revit.DB.ParameterSetIterator class is typically used when iterating through a set of parameters. It can be created by calling the ForwardIterator method on a ParameterSet object.