FamilyManager.AddParameter
Description:
Add a new family parameter with a given name.
Add a new family parameter with a given name.
Remarks:
This method can work even without any family type, but it cannot be assigned the value via FamilyManager.Set methods when there is no current type.
This method can work even without any family type, but it cannot be assigned the value via FamilyManager.Set methods when there is no current type.
Overloads (6):
AddParameter(String,BuiltInParameterGroup,ParameterType,Boolean)
[ObsoleteAttribute("This property is deprecated in Revit 2022 and may be removed in a future version of Revit. Please use the AddParameter(string, ForgeTypeId, ForgeTypeId, bool) overload instead.")]
public FamilyParameter AddParameter(
string parameterName,
BuiltInParameterGroup parameterGroup,
ParameterType parameterType,
bool isInstance
)
-
StringparameterNameThe name of the new family parameter.
-
parameterGroupThe group to which the family parameter belongs.
-
parameterTypeThe type of new family parameter.
-
BooleanisInstanceIndicates if the new family parameter is instance or type.
Return Value
FamilyParameter
If creation was successful the new parameter is returned,
otherwise an exception with failure information will be thrown.
-
Thrown when the input argument-"parameterName"-isnullNothingnullptra null reference (Nothingin Visual Basic).
-
Thrown when the input argument-"parameterName"-is already in use, or when the input argument -"parameterType" is an invalid type, or the input parameter group cannot be assigned to the new parameter. Also thrown when "parameterType" is FamilyType; to add a parameter of this type use the AddParameter method that accepts a category instead.
-
Thrown when the family parameter creation failed. Or trying to add an instance parameter of image type.