LearnRevitAPI
Jun 26, 2023
Coordinate Systems with Revit API
Coordinate Systems in Revit is not a simple topic, especially with Revit API.
But I want to simplify it for you so you don't spend countless
hours on trial and error. And of course I will provide an easy to use python code!
💡 Let's learn how to convert Coordinate Systems with Revit API
⏺️ Coordinate Systems
First of all let's have an overview of Coordinate Systems in Revit.
There are 3 systems available:
When we work with Revit API we are working with Internal Coordinate System. When you get any coordinates or you want to place an element in your project, we provide coordinates in XYZ class as internal.
So if you want to take a set of Project or Survey points for placing your elements you will need to convert it to Internal to place it correctly.
📚 Resources
While researching the topic 2 articles from danimosite website have helped me the most. Link 1, Link 2
I would recommend you read them if you want to go into this topic deeper. I still spent hours making it work across all 3 coordinate systems back and forth, but you don't have to. I will provide my final code for you!
⌨️ Here is the Code
I have written this PointConverter Class to convert any units between each other. I hope you will find it useful!
💡 Note that values for X, Y, Z are provided in meters, and it will be converted into Internal units(feet) inside of the class.
💡I haven't provided code for convert_internal_units(value, get_internal)
If you don't know how to Convert Units: 👀 Read This!
🤔 How to Use?
The Class is very simple to use. But please pay attention to units used in your Revit Project and in the Code!
As I mentioned, Revit API always uses Internal units for everything. So when you get your converted point and you want to compare to Revit , don't forget to convert to match Revit's display units.
That's why print_coord_in_m function is used in my example.
Video just for Newsletter
👆Click on the Image.
You can see how I use this class in this short video.
Join Newsletter
📩 You will be added to Revit API Newsletter
Join Us!
which is already read by 7400+ people!
◼️BLACK FRIDAY DEAL 20% OFF. Ends in: