Revit 2026 API
Global |
Sets a new value of the global parameter.
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 26.0.4.0 (26.0.4.0)
Syntax
public void SetValue( ParameterValue value )
Public Sub SetValue ( value As ParameterValue )
public: void SetValue( ParameterValue^ value )
member SetValue : value : ParameterValue -> unit
Parameters
- value ParameterValue
- An instance of one of the value classes derived from ParameterValue.
| 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. |
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