SetFormula Method


Set the formula of a family parameter.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 24.0.0.0 (24.0.0.0)

Syntax

C#
public void SetFormula(
	FamilyParameter familyParameter,
	string formula
)
Visual Basic
Public Sub SetFormula ( _
	familyParameter As FamilyParameter, _
	formula As String _
)
Visual C++
public:
void SetFormula(
	FamilyParameter^ familyParameter, 
	String^ formula
)

Parameters

familyParameter
Type: Autodesk.Revit.DBFamilyParameter
The family parameter.
formula
Type: SystemString
The formula string, input a null reference (Nothing in Visual Basic) to clean the formula of the parameter.

Exceptions

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentNullException Thrown when the input argument-"familyParameter"-is a null reference (Nothing in Visual Basic).
Autodesk.Revit.ExceptionsInvalidOperationException Thrown when there is no valid family type, or the parameter cannot be assigned a formula, or the operation make a circular chain of references among the formulas.

See Also