LearnRevitAPI

🆎 How To Convert Units in Revit API With a Single Line Of Code.

Aug 4, 2025
🧮Units in Revit API

📏 Revit API uses feet internally.
This has caused a lot of confusion among beginners who use the metric system.
They read property or parameter values and see completely wrong numbers in Revit and Revit API. And it's the worst when you're debugging something that isn't even broken. (Trust me, 🤦♂️ I've been there too...)
So I want to share how to convert units in Revit API with a single line of code.
🧮 Pull out your calculators.

Revit API uses Feet
It's so simple, but beginners tend to forget it. So let me say once more:
🚨Revit API uses Feet As Internal Units!🚨
Many people waste hours because of this confusion... Myself included!
Once, I was going crazy when I worked with coordinates and forgot to convert units. And nothing matched when I wanted to verify my values.
I spent hours debugging and rewriting my code multiple times, knowing that it can't be broken. My logic was on point and it should have worked. And then I realized...
I just forgot a single line of code🤦♂️.

How to work with Revit API units?
Imagine you have a wall with a height 300cm.
You read the value with Revit API and you see completely different result (9.84). You start to think you doing something wrong, but your value is just in feet...
And the same goes for setting new values. If you'd want to change height to 250cm, you'd need to convert 250cm to feet before you set a new value with Revit API.
You just need to add an extra line of code to convert units correctly. Sounds annoying, but you get used to that.
Converting units with the Revit API is quite simple. There are two methods in the UnitUtils class that we can use to convert internal units:
- ConvertToInternalUnits(value, UnitTypeId)
- ConvertFromInternalUnits(value, UnitTypeId)
Here is the Syntax:

Also, keep in mind that there is no ForgeTypeId class. Instead, you need to use UnitTypeId class which contains a list of all possible unit values to choose from.
Convert Units Like This
Now let's try it out.
If you have a value in metric units and need to convert it into internal units, use ConvertToInternalUnits like this:

However, if you have a value in internal units (ft), then use ConvertFromInternalUnits like this:

That’s it.
Just remember that the Revit API uses feet as its internal unit, so always select the correct unit.
UnitTypeId Class
UnitTypeId is a class in Revit API that contains a list of units of measurement.
It includes a long list of units, but you’ll only need a handful, such as Meters, Centimeters, SquareMeters, and so on...
Here is a screenshot from the Docs:

P.S.
Whenever you read or set values and something doesn't match up, make sure you use the right units before you start the whole debugging session.
This can save you a lot of time!
Join Newsletter
📩 You will be added to Revit API Newsletter
Join Us!
which is already read by 9500+ people!




