Change Units in Current Document

I am trying to change units of current document, but it seems that Revit 2022 has changed DisplayUnitType API. Any hint on how call out the untis using new API?

Correct. DisplayUnitType has been deprecated and replaced with ForgeTypeId.

ApiDocs.co · Revit · DisplayUnitType Enumeration

1 Like

After chaning to new callout, it seems to be asking me to define FORGETYPEID:

Sorry, I missed that you already changed from DisplayUnitType to UnitTypeId and was thinking you needed the other type change. Make sure you have it typed correctly. You have “ID” instead of “Id”.

1 Like

Hi Nick, Im close, but not that close to solve it, as im missing something here:

Now, its not happy about Unit Length Type:

Solved: unit.SetFormatOptions(SpecTypeId.Length,format)