Units conversion Revit 2022

Haha, was just messing around with this, and the ForgeTypeId. Got way more complex then the actual answer :slight_smile:

That being said though, I think the OP needs the ConvertFrom :slight_smile:

import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import UnitUtils, UnitTypeId

wallType = UnwrapElement(IN[0])

widthInternal = wallType.Width

#output unit
uid = UnitTypeId.Millimeters

OUT = UnitUtils.ConvertFromInternalUnits(widthInternal, uid)

Image for context :slight_smile:

3 Likes