2025 Class
Changes 2
C

FormatOptions

Description:
Options for formatting numbers with units.
Remarks:

The FormatOptions class contains settings that control how to format numbers with units as strings. It contains those settings that are typically chosen by an end user in the Format dialog and stored in the document.

The FormatOptions class is used in two different ways. A FormatOptions object in the Units class represents the default settings for the document. A FormatOptions object used elsewhere represents settings that may optionally override the default settings.

The UseDefault property controls whether a FormatOptions object represents default or custom formatting. If UseDefault is true, formatting will be according to the default settings in the Units class, and none of the other settings in the object are meaningful. If UseDefault is false, the object contains custom settings that override the default settings in the Units class. UseDefault is always false for FormatOptions objects in the Units class.

Inheritance Hierarchy:
System.Object
  Autodesk.Revit.DB.FormatOptions
public class FormatOptions : IDisposable
Name Return Type Description Inherited From
C FormatOptions() None Creates a new FormatOptions object that represents default formatting.
C FormatOptions(ForgeTypeId) None Creates a new FormatOptions object that represents custom formatting.
C FormatOptions(FormatOptions) None Creates a copy of a FormatOptions object.
C FormatOptions(ForgeTypeId, ForgeTypeId) None Creates a new FormatOptions object that represents custom formatting.
Name Return Type Description Inherited From
M CanHaveSymbol() Boolean Checks whether a symbol can be specified to display the unit in this FormatOptions.
M CanHaveSymbol(ForgeTypeId) Boolean Checks whether a symbol can be specified to display a given unit.
M CanSuppressLeadingZeros() Boolean Checks whether leading zeros can be suppressed for the display unit in this FormatOptions.
M CanSuppressLeadingZeros(ForgeTypeId) Boolean Checks whether leading zeros can be suppressed for a given unit.
M CanSuppressSpaces() Boolean Checks whether spaces can be suppressed for the display unit in this FormatOptions.
M CanSuppressSpaces(ForgeTypeId) Boolean Checks whether spaces can be suppressed for a given unit.
M CanSuppressTrailingZeros() Boolean Checks whether trailing zeros can be suppressed for the display unit in this FormatOptions.
M CanSuppressTrailingZeros(ForgeTypeId) Boolean Checks whether trailing zeros can be suppressed for a given unit.
M CanUsePlusPrefix() Boolean Checks whether a plus prefix can be displayed for the display unit in this FormatOptions.
M CanUsePlusPrefix(ForgeTypeId) Boolean Checks whether a plus prefix can be displayed for a given unit.
M Dispose() None Releases all resources used by the FormatOptions
M Equals None Determines whether the specified object is equal to the current object. (Inherited from Object ) Object
M GetHashCode None Serves as the default hash function. (Inherited from Object ) Object
M GetSymbolTypeId() ForgeTypeId Gets the identifier of the symbol indicating the unit quantifying the value.
M GetType None Gets the Type of the current instance. (Inherited from Object ) Object
M GetUnitTypeId() ForgeTypeId Gets the identifier of the unit used to quantify values.
M GetValidSymbols() IList<ForgeTypeId> Gets the identifiers of all valid symbols for the unit in this FormatOptions.
M GetValidSymbols(ForgeTypeId) IList<ForgeTypeId> Gets the identifiers of all valid symbols for a given unit.
M IsValidAccuracy(Double) Boolean Checks whether an accuracy is valid for the display unit in this FormatOptions.
M IsValidAccuracy(ForgeTypeId, Double) Boolean Checks whether an accuracy is valid for a given unit.
M IsValidForSpec(ForgeTypeId) Boolean Checks whether this FormatOptions is valid for a given spec.
M IsValidSymbol(ForgeTypeId) Boolean Checks whether a symbol is valid for the unit in this FormatOptions.
M IsValidSymbol(ForgeTypeId, ForgeTypeId) Boolean Checks whether a symbol is valid for a given unit.
M SetSymbolTypeId(ForgeTypeId) None Sets the symbol that should be displayed to indicate the unit quantifying the value.
M SetUnitTypeId(ForgeTypeId) FormatOptions Sets the unit used to quantify values.
M ToString None Returns a string that represents the current object. (Inherited from Object ) Object
Name Return Type Description Inherited From
P Accuracy double The accuracy to which values will be rounded.
P IsValidObject Boolean Specifies whether the .NET object represents a valid Revit entity.
P RoundingMethod RoundingMethod The method used to round values: round to nearest, round up, or round down.
P SuppressLeadingZeros bool Indicates if leading zeros should be suppressed in feet and fractional inches.
P SuppressSpaces bool Indicates if spaces around the dash should be suppressed in feet and fractional inches.
P SuppressTrailingZeros bool Indicates if trailing zeros after the decimal point should be suppressed.
P UseDefault bool Indicates whether default or custom formatting should be used.
P UseDigitGrouping bool Indicates if digit grouping symbols should be displayed.
P UsePlusPrefix bool Indicates if a plus sign prefix should be displayed for positive and zero values.