The Autodesk.Revit.DB.FamilyParameterSetIterator is a class in the Revit API that provides a way to iterate through a set of FamilyParameter objects in a Revit family. This class is part of the Autodesk.Revit.DB namespace and is available in all Revit API applications.
The FamilyParameterSetIterator class provides the following methods:
MoveNext(): This method moves the iterator to the next FamilyParameter object in the set. It returns true if there is another object to iterate over, or false if the end of the set has been reached.
Reset(): This method resets the iterator to the beginning of the set.
The FamilyParameterSetIterator class has the following properties:
// Get the FamilyManager object for a family document
FamilyManager familyManager = document.FamilyManager;
// Create a new parameter set iterator
FamilyParameterSetIterator iterator = familyManager.Parameters.ForwardIterator();
// Iterate through the set of parameters
while (iterator.MoveNext())
{
FamilyParameter parameter = iterator.Current;
// Do something with the parameter
// ...
}
In this example, we create a new FamilyParameterSetIterator object by calling the ForwardIterator method of the FamilyManager.Parameters collection. We then use a while loop and the MoveNext method to iterate through the set of parameters, and access the current parameter using the Current property. We can then perform some action on the parameter, such as getting its name or value.
The FamilyParameterSetIterator class in the Revit API provides an efficient way to iterate through a set of FamilyParameter objects in a Revit family. Its methods and properties allow for easy navigation of the set, making it a valuable tool for Revit API developers.