SetValue Method


Global Parameter Set Value Method

Sets a new value of the global parameter.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.3.0.0 (25.3.0.0)
Syntax
public void SetValue(
	ParameterValue value
)

Parameters

value ParameterValue
An instance of one of the value classes derived from ParameterValue.
Exceptions
Exception Condition
ArgumentException The given value argument is not a valid instance of ParameterValue! -or- The given parameter value arguments is not of the storage type the global parameter expects.
ArgumentNullException A non-optional argument was null
InvalidOperationException This is a formula-driven parameter. As such it does not allow the current operation. -or- This is a dimension-driven parameter. As such it does not allow the current operation.
Remarks

Note that a value can only be set for parameters that are neither formula-driven nor dimension-driven, as those have their values determined by evaluating the formula or by the dimension, respectively.

The argument this method accepts is of the same type of ParameterValue that is returned by GetValue . However, the type can also be easily deduced: Text parameters accept only StringParameterValue . Integer and YesNo parameters accept only IntegerParameterValue . All other types of parameters accept only DoubleParameterValue . Curiously, the actual value of a YesNo parameter can be only either 0 or 1.

See Also