I modified a number of Revit Beam and Column families to add a parameter to be used to associate a series of model elements for scheduling purposes. Now my boss has asked me to change the name of that parameter (from the name he had first suggested).
Note that this parameter is an instance parameter which is not a shared parameter.
Now I want to do two things programmatically -- first, I would like to rename that parameter whenever it is used to the new name. Secondly, I would like to ADD that parameter (new name) to other beam/column families if it has not been defined in those families.
I have explored a couple methods online, such as:
BindingMap All_Binding = doc.ParameterBindings;
DefinitionBindingMapIterator Iterator = All_Binding.ForwardIterator();
Iterator.Reset(); List<string> BindingList = new List<string>();
while (Iterator.MoveNext())
{
Definition def = Iterator.Key;
ElementBinding Binders = (ElementBinding)Iterator.Current;
BindingList.Add(def.Name);
}
BindingList.Sort();
This returns a list of the Shared Parameters available in the project.
I've also explored the FamilyManager, but that is not well documented. I tried:
doc.FamilyManager.RenameParameter(FamilyParameter *****, "Label Group") but the FamilyManager options are not well documented (and I'm not even sure if the "FamilyParameter" listed matches a parameter defined inside a ".rfa" file, or another thing entirely). I tried putting the Parameter associated with ElementName.Parameters as the FamilyParameter *******, but Visual Studio says wrong type, and when I try adding "as Family Parameter", it says "cannot implicitly convert Parameter to FamilyParameter".
Can anyone offer me pointers about how I might add or rename parameters for families already in my project?