CoolFace
Apppublic

arch-PK/IFC-AI-Room-Writer-v02

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
App README

๐Ÿ—๏ธ 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

  1. 1.You upload an .ifc file exported from Revit.
  2. 2.The app reads:
  3. 3.room names and areas from IfcSpace
  4. 4.furniture types from IfcFurnitureType
  5. 5.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):

python
client = openai.OpenAI(api_key="your-openai-api-key")

Option 2 โ€” Use environment variable (recommended):

bash
export OPENAI_API_KEY=your-openai-api-key

๐Ÿš€ How to run locally

bash
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