We talked about the BuiltInParameterGroup enumeration and how to group parameters based on its values before. Now let’s see how the RevitAddinWizard can help to do the same work. The Parameter Grouper can be found from either the Revit Addin Coder sub-menu under the Tools or the following Revit Addin Coder toolbar:
When the button is clicked, the Parameter Grouper window will show up:
If the BuiltInParameterGroup enumeration and the method name are specified like the above, the following Parameter Grouper help methods will be created in the chosen class:
public static List<Parameter> ParametersInGroup_Constraints(Element e)
{
return RawGroupParameters(e)[BuiltInParameterGroup.PG_CONSTRAINTS];
}
public static Dictionary<BuiltInParameterGroup, List<Parameter>> RawGroupParameters(Element e)
{
Dictionary<BuiltInParameterGroup, List<Parameter>> dict =
new Dictionary<BuiltInParameterGroup, List<Parameter>>();
foreach (Parameter p in e.Parameters)
{
if (!dict.ContainsKey(p.Definition.ParameterGroup))
{
dict.Add(p.Definition.ParameterGroup, new List<Parameter>());
}
dict[p.Definition.ParameterGroup].Add(p);
}
return dict;
}
In terms of how to use the help methods, please refer to previous posts for ideas and code examples.
Parameter Grouper of RevitAddinWizard can do all these in no time.
Parameter of Revit API - BuiltInParameter
Parameter Retriever of RevitAddCoder
Parameter of Revit API - Parameter Information
Parameter Infoer of RevitAddCoder
Parameter of Revit API - ParameterType And StorageType
Parameter Typer of RevitAddCoder
Parameter of Revit API - BuiltInParameterGroup
Parameter Filter of RevitAddCoder
Parameter of Revit API - Read/Write Parameter Values
Recent Comments