FamilyManager.AddParameter
Description:
Add a new family type parameter to control the type of a nested family within another family.
Add a new family type parameter to control the type of a nested family within another family.
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 (5):
AddParameter(String,BuiltInParameterGroup,Category,Boolean)
[ObsoleteAttribute("This method is deprecated in Revit 2024 and may be removed in a future version of Revit. Please use the `AddParameter(String, ForgeTypeId, Category, bool)` method instead.")]
public FamilyParameter AddParameter(
string parameterName,
BuiltInParameterGroup parameterGroup,
Category familyCategory,
bool isInstance
)
-
StringparameterNameThe name of the new family parameter.
-
parameterGroupThe group to which the family parameter belongs.
-
familyCategoryThe category to which the new family parameter binds.
-
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 the input parameter group cannot be assigned to the new parameter, or the input argument-"familyCategory"-is illegal to bind with parameter.
-
Thrown when the required family of familyCategory is not existing in current document, , or when the creation failed. Or trying to add an instance parameter of image type.