Message 1 of 4
Conversion from internal to Revit type for UnitType
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello!
I need to upgrade an application to be supported on Revit 2022 and I have a problem with UnitType that is no longer available in Autodesk.Revit.DB.
I have a conversion method:
public static Autodesk.Revit.DB.UnitType ToRevit(this Model.UnitType unitType)
{
if (Enum.IsDefined(typeof(Autodesk.Revit.DB.UnitType), (int)unitType))
return (Autodesk.Revit.DB.UnitType)unitType;
else
return Autodesk.Revit.DB.UnitType.UT_Undefined;
}
where the Model.UnitType is an internal created enum that contains the following:
public enum UnitType
{
Unknown = -2,
Length = 0,
Angle = 3,
Mass = 98
}
Does someone have an idea of how I can update the method using ForgeTypeId that is used now in Revit 2022?
Thank You!