RoundingMethod Property


The method used to round values: round to nearest, round up, or round down.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 16.0.0.0 (16.0.0.0)
Since: 2016

Syntax

C#
public RoundingMethod RoundingMethod { get; set; }
Visual Basic
Public Property RoundingMethod As RoundingMethod
	Get
	Set
Visual C++
public:
property RoundingMethod RoundingMethod {
	RoundingMethod get ();
	void set (RoundingMethod value);
}

Field Value

The rounding method. The default is Nearest.

Remarks

The RoundingMethod property is currently only supported for rebar parameters. A FormatOptions object containing any rounding method may be returned by Element.GetParameterFormatOptions() and may be passed to the formatting and parsing utilities in the UnitFormatUtils class. FormatOptions objects used in other contexts must contain the default rounding method (Nearest).

Exceptions

Exception Condition
Autodesk.Revit.Exceptions ArgumentOutOfRangeException When setting this property: A value passed for an enumeration argument is not a member of that enumeration
Autodesk.Revit.Exceptions InvalidOperationException UseDefault is true in this FormatOptions.

See Also

ArchiLabs Desktop

Put AI to work inside Revit.

Give Desktop your instructions and project files to build Revit families, update model elements, and create views and schedules. Works directly in Revit and AutoCAD.

Explore Desktop →