@Alban_de_Chasteigner beat me to it, but it looks like they changed units to Forge specs in 2021.
Here's a small summary.
Units API changes
Revit has converted to use an external reference to unit definitions defined in Forge schemas.
In the Autodesk.Revit.DB namespace, the enumerations DisplayUnitType, UnitSymbolType, and UnitType have been deprecated in favor of a potentially extensible set of units, symbols, and unit types. The new class:
- Autodesk.Revit.DB.ForgeTypeId
represents an identifier for a unit, symbol, or other object, and is now used throughout the Revit API to identify units of measurement, symbols, and unit types. Unit types are now referred to as “specs” to avoid confusion with units themselves.
A ForgeTypeId instance holds a string, called a “typeid”, that uniquely identifies a Forge schema. A Forge schema is a JSON document describing a data structure, supporting data interchange between applications. A typeid string includes a namespace and version number and may look something like “autodesk.spec.aec:length-1.0.0” or “autodesk.unit.unit:meters-1.0.0”. By default, comparison of ForgeTypeId values in the Revit API ignores the version number.
The new classes:
- Autodesk.Revit.DB.UnitTypeId
- Autodesk.Revit.DB.SymbolTypeId
- Autodesk.Revit.DB.SpecTypeId
contain a default set of named public constant properties of type ForgeTypeId. These values can be used in code replacing values of the deprecated DisplayUnitType, UnitSymbolType, and UnitType enumerations.
For example, where you previously used DisplayUnitType.DUT_WATTS_PER_SQUARE_METER_KELVIN, you would now use UnitTypeId.WattsPerSquareMeterKelvin. Where you previously used UnitType.UT_HVAC_Density, you would now use SpecTypeId.HvacDensity.
The UnitUtils class now offers a set of new methods for mapping between enumeration values and ForgeTypeId values to assist clients in migrating code to ForgeTypeId:
- UnitUtils.IsSymbol()
- UnitUtils.GetSpecTypeId()
- UnitUtils.GetUnitType()
- UnitUtils.GetUnitTypeId()
- UnitUtils.GetDisplayUnitType()
- UnitUtils.GetSymbolTypeId()
- UnitUtils.GetUnitSymbolType()
Some of the preceding methods are new but are already deprecated. They have been added to the API only to assist clients in migrating code from the old enumerations to the ForgeTypeId class.