Global |
Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.3.0.0 (25.3.0.0)

Parameters
- expression String
- Valid formula string.

Exception | Condition |
---|---|
ArgumentException | The given expression argument is not valid as a formula for this parameter. |
ArgumentNullException | A non-optional argument was null |
InvalidOperationException | This is a non-reporting global parameter. As such it does not allow the current operation. |

In order to set a formula, the global parameter must be non-reporting. Therefore a reporting parameter must be changed to non-reporting first before assigning a formula.
Value of the evaluated formula must be compatible with the value-type of the parameter. For example, it is permitted to use Integer parameters in a formula assigned to a Double ( Number ) parameter, or vice versa. It is not allowed, however, to use Length or Angle arguments in a formula in a parameter of which type is ether Integer or Number . To test whether a formula is valid for a global parameter, the method IsValidFormula(String) can be used.
An empty string can be used to remove an existing formula. When a formula is removed, the parameter retains its value as it was previously computed using the formula.
Formulas may include all standard arithmetic operations and logical operations (as functions and , or , not .) Input to logical operations must be Boolean values (parameters of YesNo type). Consequently, arithmetic operations can be applied to numeric values only. While there are no operations supported for string (text) arguments, strings can be used as results of a logical If operation.
