Revit Extractor is a library that allows you to export native data from Revit files without needing to open Revit. It’s particularly useful for extracting data from Revit files and integrating it into other systems.
- Make sure you have Revit installed on your machine.
- Make sure you have Python installed on your machine version
3.9
or later. - Make sure you are running on Windows Platform. MacOS and Linux are not supported.
- Install the library by using pip:
pip install revit-extractor --upgrade
- Get Revit Version
from revit_extract import RevitExtractor
rvt_path = r"D:\_WIP\Download\Sample Office Building Model V1.rvt"
version = RevitExtractor.get_version(rvt_path)
print(version)
Bulk Extract All Models Version :
import os
import pandas as pd
from revit_extract import RevitExtractor
path = "D:\Development\Revit\Project\XXX\Electrical"
def get_files(path):
df = pd.DataFrame(columns=['File', 'Version'])
for r, d, f in os.walk(path):
for file in f:
if '.rvt' in file:
version = RevitExtractor.get_version(os.path.join(r, file))
df.loc[len(df)] = [file, version]
return df
df = get_files(path)
df.head()
- Use the library in your code:
- Extract all categories from Revit file:
from revit_extract import RevitExtractor
rvt_path = r"D:\_WIP\Download\Sample Office Building Model V1.rvt"
prodb = RevitExtractor(rvt_path).read_prob_data()
categories = prodb.get_all_categories()
for key in categories:
print(key, categories[key])
- Extract data by categories and parameters from Revit file:
from revit_extract import RevitExtractor
rvt_path = r"D:\_WIP\Download\Sample Office Building Model V1.rvt"
prodb = RevitExtractor(rvt_path).read_prob_data()
categories =["Walls", "Doors"]
params = ["Name", "Type", "Level"]
data_frame = prodb.get_data_by_categories_and_params(categories, params)
data_frame.to_excel("output.xlsx", index=False)
Check Example Files
-
Export Schedule table data is not supported with svf format.
-
Geometry data is limit supported to read at the moment (But can export and use APS-Toolkit)
- Clone the repository
- Install the dependencies by running
pip install -r requirements.txt
- Run the tests by running
pytest
- Make your changes
I'm happy to accept pull requests and contributions. If you have any questions, feel free to ask.
This is not an official Autodesk product to support for Autodesk Platform Services. Use it at your own risk.
I'm not responsible for any data loss or any other issues caused by using this library, some features need require cost for using. Please read carefully the Autodesk Forge and Autodesk Platform Services terms of use. I'm just doing, testing , maintaining in free time, so feel free to contribute and make it better.
This project is licensed under the GNU v3 License - see the LICENSE file for details
This is not an official method recommended by Autodesk, for academic purposes only, please use Design Automation or official support services from Autodesk like AEC Data Model API