Skip to content

mac999/BIM-quality-checker

Repository files navigation

BIM Quality Checker (BQC)

BQC is simple web application for checking the quality of BIM datasets, specifically IFC and COBie files. It supports IFC, COBie for the data integrity using the predefine rule, code, BCF, LLM(Large Language Model). It provides a user-friendly interface to upload these files, validate them for quality issues, and generate a comprehensive report.
BIM quality checker web application link

Features

0.1 version

  • Validate IFC files for compliance with BIM standards.
  • Validate COBie files for data integrity and completeness.
  • Customizable rules for data validation.
  • Supports multiple file formats, including .xlsx, .csv, and .ifc.
  • Built-in checks for:
    • Attribute ranges
    • Equations
    • Functional categories
    • Custom Python scripts
  • Generate PDF reports summarizing validation results. This project will continue to be developed in the future.

0.2 version

  • IFC 4.0 support.
  • Error message and Bug fixed.

0.3 version

  • BCF 2.0 support (without visualization).
  • Bug fixed.

0.4 version

  • Clash (collision) detection support. To test, use voids.ifc and walls.ifc in sample folder.

0.43 version

  • Support to check BIM elements which have issues in 3D viewer like below

0.45 version

  • Support LLM such as ChatGPT to check ruleset. It's still not perfect as it's an experimental feature. In detail, refer to LLM based quality check in Rule Condition chapter.

Future plan

Add more features including LandXML, IFC various types, visualzation support.

Source code installation

To install source code and run it, follow the below and open http://127.0.0.1:7860

git clone https://github.com/mac999/BIM-quality-checker.git
pip install -r requirements.txt
cd ./src
python app.py

Instruct

Software Architecture

The below is SAD(Software Architecture Design)(UML).

Ruleset Configuration File

The tool uses a JSON configuration file to define the validation rules. Below are the main sections:

Project Metadata

"project": {
  "name": "BIM quality check project (example)",
  "description": "This project is for BIM quality check example.",
  "version": "1.0",
  "author": "Taewook Kang",
  "email": "laputa99999@gmail.com"
}

Defines basic project information, including the name, description, version, author, and contact email.

Validation Rules

The validation_rules consists of checks which have section defines multiple validation check for different BIM data types.

"validation_rules": [
{
  "name": "COBie data check",
  "entity": "Space",
  "file_format": [".xlsx", ".xls", ".csv"],
  "classification_system": "uniclass(2015), omniclass",
  "notify": "BIM-coordinator@gmail.com",
  "checks": [
    {
      "name": "Area Check",
      "description": "Validate the gross floor area of spaces",
      "attribute": "GrossArea",
      "condition": { ... }
    },
  ]
}
]
  • entity: entity to check it's value. entity can be IFC element type (ex. IfcDoor), COBie worksheet's name (ex. Space) etc.
  • file_format: checking files format.
  • classification_system: information classification of the files. it's just explaination.
  • notify: if there are problem in the checks, input the responsible person contact email.
  • checks: consists of name, description and attribute for checking the value in properties. The entity has default properties category "Element" as default properties which have "Name", "OperationType", "Tag" in case of IFC.

COBie Data Validation

{
  "name": "COBie data check",
  "entity": "Space",
  "file_format": [".xlsx", ".xls", ".csv"],
  "classification_system": "uniclass(2015), omniclass",
  "checks": [ ... ]
}

Validates COBie Space tables. Includes checks for:

  • Gross floor area validation
  • Functional category alignment
  • Space classification via scripts

IFC Data Validation

{
  "name": "IFC space data check",
  "entity": "IfcSpace",
  "file_format": [".ifc"],
  "classification_system": "uniclass(2015), omniclass",
  "checks": [ ... ]
}

Validates IfcSpace entities in IFC files. Includes checks for:

  • Functional category validation
  • Classification alignment

Rule Condition

Supported Condition Types

Range Validation

Ensures a numeric attribute falls within a specific range, with optional tolerances.

{
  "type": "range",
  "min": 300,
  "max": 320,
  "tolerance_min": -2,
  "tolerance_max": 2,
  "units": "m2"
}
  • min / max: Defines the acceptable range.
  • tolerance_min / tolerance_max: Expands the range with tolerances.
  • units: Specifies the unit of measurement (e.g., m2).

Equation Validation

Validates an attribute using a custom mathematical condition.

{
  "type": "equation",
  "equation": "value > 100",
  "units": "m2"
}
  • equation: A mathematical formula or logic (e.g., value > 100).
  • units: Specifies the unit of measurement.

Clash Validation

Clash (collision) detection between two elements IFC class in IFC files. In example,

"clash_check_file": "walls.ifc",
"condition": {
	"type": "collision",
	"option": "each_file",
	"IFC_entity": "IfcWall"
}
  • type: clash detection type (only collision in 0.4 version).
  • option: each_file for checking between one and another BIM file.
  • IFC_entity: Specifies target IFC entity type of clash_check_file IFC file.

List Validation

Validates that an attribute matches a predefined list of categories.

{
  "type": "list",
  "categories": [
    {
      "code": ".*SL_25_10_14.*",
      "name": "Classrooms"
    },
    {
      "code": ".*SL_20_15_59.*",
      "name": "Offices"
    }
  ]
}
  • categories: A list of valid category codes and their names.
  • code: A regex pattern matching the attribute value.
  • name: A human-readable label for the category.

Example

Here’s a complete example of a checks array with multiple condition types:

  "validation_rules": [
    {
      "name": "COBie Data Check",
      "COBie_table": "Space",
      "file_format": [".xlsx", ".xls", ".csv"],
      "checks": [
        {
          "name": "Area Check",
          "description": "Validate the gross floor area of spaces.",
          "attribute": "GrossArea",
          "condition": {
            "type": "range",
            "min": 300,
            "max": 320,
            "tolerance_min": -2,
            "tolerance_max": 2,
            "units": "m2"
          }
        }
      ]
    }
  ]

Script-Based Checks

Custom scripts can be used for advanced validation. In the python code, you can use math, numpy as np, bim_rule_issues as rule_issues with the predefined variables like below.

  • object_id: object id in case of IFC
  • entity_name: object name
  • check_name: check name
  • check_cond: rule check's condition
  • cat: cateogry
  • attribute: attribute of value
  • req_type: check value's type
  • value: object's value which can be integer, float, list, dictionary and model like IFC
  • guids: object GUID list
  • check: check rule consists of condition. refer to the Ruleset Configuration File (JSON).
  • self: condition object
  • add_result_in_check: Function of condition object. Prototype = self.add_result_in_check(object_id, check, issue, passed, GUIDs=[], models=[])
Parameter Description
object_id refer to the above variable
check refer to the above variable
issue issue description
passed check result like True, False
GUIDs GUID list of IFC if they are existed
models BIM model list like IFC

Example:

{
  "condition": {
    "type": "code",
    "code": "print('code check')/nprint(value)/nself.add_result_in_check(object_id, check, f'{attribute} satisfies equation', False)"
  }
}

or

{
  "condition": {
    "type": "script",
    "script_file": "cobie_model_check.py"
  }
}

LLM based quality check

Support to check the dataset of models using LLM such as ChatGPT. To use, you need to enter your OpenAI api_key and enter the appropriate prompt. Note that depending on the size of the quality check target dataset, many tokens may be used. This is currently an experimental feature, and research will be conducted to reduce the number of tokens used effectively.

"checks": [			
  {
    "name": "Check Door Clearance Compliance Using LLM",
    "description": "Ensures that all doors meet the minimum clearance standards.",
    "attribute": "Element.Name",	
    "condition": {
      "type": "LLM",
      "model": "gpt-4o",
      "api_key": "", 
      "prompt": "Verify the value which has a clearance width of at least 900mm and height of 2100mm."
  }
}	
]
  • model: model name such as gpt-4o
  • api_key: your OpenAI API key
  • prompt: input your prompt to check the data value of the entity in the check element. ex) "entity": "IfcDoor"

License

Develop by Taewook Kang (laputa99999@gmail.com) This project is licensed under the MIT License. See the LICENSE file for more details.

Contribution

Welcome your contribution.

Reference

Acknowledge

Thanks for the contributions.

  • fastapi
  • pydantic
  • Gradio
  • reportlab
  • pandas
  • ifcopenshell
  • openpyxl
  • fpdf

Releases

No releases published

Packages

 
 
 

Contributors

Languages