I created a Dynamo graph that modify the project units (imperial or metric) and it doesn’t work anymore with Revit 2022. I saw that there was some modification to the API related to units in Revit 2022. I’m not programmer, I’m just someone that had interest in Dynamo so I don’t really know the terms in the industry. I know that DisplayUnitType was now replaced, but other than that, I don’t know how to make it work…
Here’s the part of the graph that now fail.
TransactionManager.Instance.EnsureInTransaction(doc)
unit = doc.GetUnits()
format = FormatOptions(DisplayUnitType.DUT_MILLIMETERS,1)
unit.SetFormatOptions(UnitType.UT_Length,format)
doc.SetUnits(unit)
TransactionManager.Instance.TransactionTaskDone()
Excellent.
It works…
Actually, I’ll have to manage many different unit symbols depending on the unit type…
Is there a list somewhere when I can find what are the new unit types?
Like… I’ll have to manage this one: UnitSymbolType.UST_KG_PER_CU_M