Revit 2021.1 API |
FamilyManager..::..ReplaceParameter Method (FamilyParameter, String, BuiltInParameterGroup, Boolean) |
FamilyManager Class See Also |
Replace a shared family parameter with a new non-shared family parameter.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 21.0.0.0 (21.1.1.109)
Syntax
C# |
---|
public FamilyParameter ReplaceParameter( FamilyParameter currentParameter, string parameterName, BuiltInParameterGroup parameterGroup, bool isInstance ) |
Visual Basic |
---|
Public Function ReplaceParameter ( _ currentParameter As FamilyParameter, _ parameterName As String, _ parameterGroup As BuiltInParameterGroup, _ isInstance As Boolean _ ) As FamilyParameter |
Visual C++ |
---|
public: FamilyParameter^ ReplaceParameter( FamilyParameter^ currentParameter, String^ parameterName, BuiltInParameterGroup parameterGroup, bool isInstance ) |
Parameters
- currentParameter
- Type: Autodesk.Revit.DB..::..FamilyParameter
The current family parameter.
- parameterName
- Type: System..::..String
The name of the new family parameter.
- parameterGroup
- Type: Autodesk.Revit.DB..::..BuiltInParameterGroup
The group to which the new family parameter belongs.
- isInstance
- Type: System..::..Boolean
Indicates if the new parameter is instance or type.
Return Value
If replacement was successful the new family parameter is returned, otherwise an exception with failure information will be thrown.
Exceptions
Exception | Condition |
---|---|
Autodesk.Revit.Exceptions..::..ArgumentNullException | Thrown when the input argument-"currentParameter" or "parameterName"-is nullNothingnullptra null reference (Nothing in Visual Basic). |
Autodesk.Revit.Exceptions..::..ArgumentException | Thrown when the input argument-"currentParameter"-is invalid, or the input parameter group cannot be assigned to the new parameter, or the input name string contains illegal characters, or duplicated with existing parameter name. |
Autodesk.Revit.Exceptions..::..InvalidOperationException | Thrown when trying to replace a built-in parameter or family parameter. |
Autodesk.Revit.Exceptions..::..InvalidOperationException | Thrown when replacement failed, because the replacement would cause a formula error. Or trying to replace with an instance parameter of image type. |