AddParameter Method (String, BuiltInParameterGroup, Category, Boolean)

Add a new family type parameter to control the type of a nested family within another family.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: (


public FamilyParameter AddParameter(
	string parameterName,
	BuiltInParameterGroup parameterGroup,
	Category familyCategory,
	bool isInstance
Visual Basic
Public Function AddParameter ( _
	parameterName As String, _
	parameterGroup As BuiltInParameterGroup, _
	familyCategory As Category, _
	isInstance As Boolean _
) As FamilyParameter
Visual C++
FamilyParameter^ AddParameter(
	String^ parameterName, 
	BuiltInParameterGroup parameterGroup, 
	Category^ familyCategory, 
	bool isInstance


Type: System String
The name of the new family parameter.
Type: Autodesk.Revit.DB BuiltInParameterGroup
The group to which the family parameter belongs.
Type: Autodesk.Revit.DB Category
The category to which the new family parameter binds.
Type: System Boolean
Indicates if the new family parameter is instance or type.

Return Value

If creation was successful the new parameter is returned, otherwise an exception with failure information will be thrown.


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.


Exception Condition
Autodesk.Revit.Exceptions ArgumentNullException Thrown when the input argument-"parameterName"-is a null reference ( Nothing in Visual Basic) .
Autodesk.Revit.Exceptions ArgumentException 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.
Autodesk.Revit.Exceptions InvalidOperationException 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.

See Also