Skip to content

FamilyManager.ReplaceParameter(FamilyParameter, ExternalDefinition, ForgeTypeId, Boolean)

Public Class

Replace a family parameter with a shared parameter.

Namespace: Autodesk.Revit.DB

Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)

Syntax

public FamilyParameter ReplaceParameter(
FamilyParameter currentParameter,
ExternalDefinition familyDefinition,
ForgeTypeId groupTypeId,
bool isInstance
)

Parameters

currentParameter FamilyParameter

The current family parameter.

familyDefinition ExternalDefinition

The definition of the loaded shared parameter.

groupTypeId ForgeTypeId

The identifier of the group to which the new shared parameter belongs.

isInstanceBoolean

Indicates if the new parameter is instance or type.

Return Value

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

Exceptions

Exception

Condition


ArgumentNullException

Thrown when the input argument-”familyParameter” or “name”-is ..


ArgumentException

Thrown when the input argument-”familyParameter”-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.


InvalidOperationException

Thrown when trying to replace a built-in parameter.


InvalidOperationException

Thrown when replacement failed, because the replacement would cause a formula error. Or trying to replace with an instance parameter of image type.


Remarks

This operation is invalid for Built-in Parameters. The formulas and labels which in reference to this parameter will be updated to the new parameter.