AddParameter Method (ExternalDefinition, BuiltInParameterGroup, Boolean)

Add a new shared parameter to the family.

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


public FamilyParameter AddParameter(
	ExternalDefinition familyDefinition,
	BuiltInParameterGroup parameterGroup,
	bool isInstance
Visual Basic
Public Function AddParameter ( _
	familyDefinition As ExternalDefinition, _
	parameterGroup As BuiltInParameterGroup, _
	isInstance As Boolean _
) As FamilyParameter
Visual C++
FamilyParameter^ AddParameter(
	ExternalDefinition^ familyDefinition, 
	BuiltInParameterGroup parameterGroup, 
	bool isInstance


Type: Autodesk.Revit.DB ExternalDefinition
The definition of the loaded shared parameter.
Type: Autodesk.Revit.DB BuiltInParameterGroup
The group to which the family parameter belongs.
Type: System Boolean
Indicates if the new parameter is instance or type.

Return Value

If creation was successful the new shared 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 ArgumentException Thrown when the input parameter group cannot be assigned to the new parameter.
Autodesk.Revit.Exceptions InvalidOperationException Thrown when the shared family parameter creation is not supported. Or trying to add an instance parameter of image type.

See Also