Units.SetFormatOptions
Description:
Sets the default FormatOptions for a unit type.
Sets the default FormatOptions for a unit type.
Remarks:
Some unit types have definitions which are automatically derived from other unit types. For example, UT_SheetLength is derived from UT_Length and UT_ForceScale is derived from UT_Force. In such cases, calling SetFormatOptions() for one unit type may have the side effect of changing the FormatOptions for other unit types that depend on it.
Some unit types have definitions which are automatically derived from other unit types. For example, UT_SheetLength is derived from UT_Length and UT_ForceScale is derived from UT_Force. In such cases, calling SetFormatOptions() for one unit type may have the side effect of changing the FormatOptions for other unit types that depend on it.
Overloads (2):
SetFormatOptions(UnitType,FormatOptions)
[ObsoleteAttribute("This method is deprecated in Revit 2021 and may be removed in a future version of Revit. Please use the `SetFormatOptions(ForgeTypeId, FormatOptions)` overload instead.")]
public void SetFormatOptions(
UnitType unitType,
FormatOptions options
)
-
unitTypeThe unit type.
-
optionsThe FormatOptions.
-
unitType is an invalid unit type. See UnitUtils.IsValidUnitType() and UnitUtils.GetValidUnitTypes(). -or- FormatOptions cannot be modified for unitType. See Units.IsModifiableUnitType() and Units.GetModifiableUnitTypes(). -or- UseDefault is true in options. -or- The display unit in options is not a valid display unit for unitType. See UnitUtils.IsValidDisplayUnit(UnitType, DisplayUnitType) and UnitUtils.GetValidDisplayUnits(UnitType). -or- The rounding method in options is not set to Nearest.
-
A non-optional argument was NULL
-
A value passed for an enumeration argument is not a member of that enumeration