arch-PK/IFC-AI-Room-Writer-v02
0
๐๏ธ IFC AI Room Writer
IFC AI Room Writer is a simple and smart Streamlit app that extracts rooms from IFC files and generates automatic descriptions of each room based on its area and furniture types. It uses AI to infer the likely function of each room by analyzing the interior elements found in the IFC model.
โ How it works
- You upload an
.ifcfile exported from Revit. - The app reads:
- room names and areas from
IfcSpace - furniture types from
IfcFurnitureType - After clicking the โจ "Generate AI Descriptions" button, the app uses AI to describe each room in 1โ2 sentences based on its size and furniture content.
๐ฆ Required IFC export settings
To ensure the app works correctly, your .ifc file must be exported from Revit using IFC 2x3 Coordination View and the following options enabled:
- โ Export Revit property sets
- โ Export IFC common property sets
- โ Export base quantities
These options ensure that area information (GrossFloorArea/NetFloorArea) and spatial relationships are preserved in the IFC file.
๐ API Key Required
To use the AI description feature, you must provide your own OpenAI API key.
You can do this in two ways:
Option 1 โ Add directly in app.py (quick test only):
client = openai.OpenAI(api_key="your-openai-api-key")Option 2 โ Use environment variable (recommended):
export OPENAI_API_KEY=your-openai-api-key๐ How to run locally
git clone https://huggingface.co/spaces/your-username/ifc-ai-room-writer
cd ifc-ai-room-writer
pip install -r requirements.txt
streamlit run app.py