FamilyManager.ReplaceParameter(FamilyParameter, String, ForgeTypeId, Boolean)
Method
Description:
Replace a shared family parameter with a new non-shared family parameter.
Replace a shared family parameter with a new non-shared family parameter.
Syntax
public FamilyParameter ReplaceParameter(
FamilyParameter currentParameter,
string parameterName,
ForgeTypeId groupTypeId,
bool isInstance
)
Parameters
Parameter | Type | Description |
---|---|---|
currentParameter | FamilyParameter | The current family parameter. |
parameterName | String | The name of the new family parameter. |
groupTypeId | ForgeTypeId | The identifier of the group to which the new family parameter belongs. |
isInstance | Boolean | Indicates if the new parameter is instance or type. |
Return Value
Type | Description |
---|---|
FamilyParameter | If replacement was successful the new family parameter is returned, otherwise an exception with failure information will be thrown. |
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | Thrown when the input argument-"currentParameter" or "parameterName"-is. |
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. |
InvalidOperationException | Thrown when trying to replace a built-in parameter or family 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. |