Skip to main content
Glama

ifc-tools-vn

Bộ công cụ kiểm tra mô hình IFC theo cách làm Việt Nam: yêu cầu thông tin (IDS), mức độ phát triển (LOD), bóc khối lượng — chạy bằng dòng lệnh hoặc gọi thẳng trong Claude Desktop qua MCP.

English summary at the end.

Vì sao có bộ này

Báo cáo kiểm IDS thường chỉ ghi "% đạt". Nhưng theo chuẩn IDS, một yêu cầu ở dạng mặc định (không khai báo bắt buộc phải có cấu kiện) mà không áp dụng lên cấu kiện nào vẫn được tính là đạt. Nên "100% đạt" có thể là 100% của phần chưa kiểm gì.

Bộ này chấm bằng ifctester (IfcOpenShell) theo chuẩn buildingSMART IDS 1.0 và báo thêm độ phủ: bao nhiêu cấu kiện trong mô hình thực sự có yêu cầu kiểm, yêu cầu nào không khớp cấu kiện nào. Muốn một yêu cầu bắt buộc phải có cấu kiện, dùng eir_to_ids --bat-buoc.

Ví dụ trên mô hình mẫu Duplex: 8/10 yêu cầu đạt, nhưng độ phủ chỉ 101/245 cấu kiện (41%) — 144 cấu kiện không có yêu cầu nào áp dụng.

Related MCP server: ACC MCP

Gồm những gì

Lệnh MCP

Module dòng lệnh

Làm gì

Kết quả

kiem_tra_ids

eir_to_ids → ids_run

Sinh file .ids theo bộ môn + giai đoạn, chấm mô hình, đo độ phủ

IDS_KetQua_*.xlsx, .html (báo cáo gốc của ifctester), .bcf

kiem_tra_lod

lod_checker

LOD 100–500 từng cấu kiện theo giai đoạn

LOD_Audit_*.xlsx

boc_khoi_luong

ifc_qto

Bóc khối lượng từ BaseQuantities. Mỗi cấu kiện lấy 1 khối lượng chính; Gross ≠ Net thì đối chiếu thể tích hình học. Tuỳ chọn đo từ hình học khi IFC không có

IFC_QTO_*.xlsx (+ <tên>_BoSungQTO.ifc)

tong_hop_audit

audit_summary_report

Gộp 3 kết quả trên thành 1 bảng gửi trưởng bộ môn

AuditSummary_*.xlsx

kiem_tra_toan_dien

bim_audit_pipeline

Chạy IDS → LOD → QTO trong 1 lệnh

BIM_HealthDashboard_*.xlsx

Giai đoạn: TKCS · TKKT · TKTC · AS-BUILT. Bộ môn: KT · KC · MEP · ALL.

Cài đặt

Cần Python 3.10 trở lên.

python -m venv .venv
.venv\Scripts\activate          # macOS/Linux: source .venv/bin/activate
pip install git+https://github.com/nguyenthang325-prog/ifc-tools-vn

Thư viện kéo theo: ifcopenshell, ifctester (LGPL, cài qua pip, không đóng gói trong repo), openpyxl, numpy, mcp.

Dùng trong Claude Desktop

Mở claude_desktop_config.json (Claude Desktop → Settings → Developer → Edit Config), thêm:

{
  "mcpServers": {
    "ifc-tools-vn": {
      "command": "C:\\duong\\dan\\toi\\.venv\\Scripts\\ifc-tools-vn.exe",
      "env": { "IFC_TOOLS_OUTPUT": "C:\\duong\\dan\\luu\\ket_qua" }
    }
  }
}

command là file ifc-tools-vn trong thư mục Scripts (Windows) hoặc bin (macOS/Linux) của venv vừa tạo. Bỏ env thì kết quả ghi vào ~/ifc_tools_output/. Khởi động lại Claude Desktop rồi hỏi, ví dụ: "Kiểm tra IDS file C:...\Duplex_A_20110907.ifc, bộ môn KT, giai đoạn TKTC".

Dùng bằng dòng lệnh

python -m ifc_tools_vn.checks.bim_audit_pipeline --ifc Duplex_A_20110907.ifc --project Duplex --stage TKTC --discipline KT

python -m ifc_tools_vn.checks.eir_to_ids --du-an Duplex --discipline KT --stage TKTC -o EIR_Duplex_KT_TKTC.ids
python -m ifc_tools_vn.checks.ids_run --ids EIR_Duplex_KT_TKTC.ids --ifc Duplex_A_20110907.ifc --project Duplex

python -m ifc_tools_vn.checks.lod_checker --ifc Duplex_A_20110907.ifc --stage TKTC --discipline KT
python -m ifc_tools_vn.checks.ifc_qto --ifc Duplex_A_20110907.ifc --discipline ALL --project Duplex --bo-sung-qto
python -m ifc_tools_vn.checks.audit_summary_report --project Duplex --discipline KT --stage TKTC

Thêm -h sau mỗi lệnh để xem đủ tuỳ chọn. Kết quả ghi vào ./ifc_tools_output/<ngày>/, hoặc thư mục trong biến IFC_TOOLS_OUTPUT.

Dùng file .ids của dự án mình: gọi thẳng ids_run --ids <file của bạn>.ids. Lệnh MCP kiem_tra_ids luôn sinh .ids từ bộ yêu cầu mẫu bên dưới.

Bộ yêu cầu mẫu

eir_to_ids sinh .ids từ một bộ 19 yêu cầu do tác giả soạn, tham khảo bảng thông tin theo giai đoạn của QĐ 347/QĐ-BXD và cách Revit xuất IFC2X3. Đây không phải yêu cầu chính thức của văn bản nào — ví dụ "tường phải khai FireRating từ TKTC" là yêu cầu tác giả đặt ra. Bảng đầy đủ và lý do từng lựa chọn: examples/EIR_mau/README_EIR.md. Dự án thật nên dùng .ids theo EIR của chủ đầu tư.

Thử với mô hình mẫu

Tải mô hình Duplex của buildingSMART (CC BY 4.0): Duplex_A_20110907.ifc. Chạy lệnh bim_audit_pipeline ở trên, kết quả đúng phải là:

Kiểm

Kết quả

IDS (KT, TKTC)

8/10 yêu cầu đạt · độ phủ 101/245 · 58 cấu kiện trượt (57 tường thiếu FireRating + công trình thiếu tên)

LOD (KT, TKTC)

197 cấu kiện, 0% đạt LOD 350 (104 thiếu vật liệu, 90 thiếu FireRating, 3 không có hình học)

Khối lượng --bo-sung-qto

218 cấu kiện (Sàn 64,583 m³ · Mái 60,747 m³ · Cầu thang 0,417 m³)

Kiểm tự động: DUPLEX_PATH=<đường dẫn file> python -m unittest discover tests -v (cần bản clone repo).

Giới hạn đã biết

  • Đã chạy thử trên Windows 11 với Python 3.10 và 3.14, ifcopenshell 0.8.5 và 0.9.0. CI cấu hình chạy trên Windows và Ubuntu, Python 3.12.

  • Viết cho IFC2X3 xuất từ Revit. Định dạng khác vẫn chạy nhưng ít được thử.

  • --bo-sung-qto chưa đo được lan can, cầu thang gộp, nội thất, MEP.

  • Bóc khối lượng: ngưỡng trọng tài (Gross ≈ Net 0,5 %, khớp hình học 2 %) mới thử trên 7 mô hình Revit. Cấu kiện có cờ (sheet KL_Chinh) cần kiểm lại trong Revit. IFC2X3 Revit không có thể tích vế thang. Thứ tự dòng trong bảng có thể đổi giữa các lần chạy (engine hình học chạy nhiều luồng); nội dung không đổi.

  • Điểm IDS cao không có nghĩa mô hình dùng được để thanh toán: IDS không kiểm phân loại đúng/sai hay hình học.

  • Chưa có công cụ báo cáo xung đột (Navisworks) — dự kiến bản sau.

Giấy phép

MIT — xem LICENSE. Tác giả: Nguyễn Đắc Thắng.


English summary

ifc-tools-vn checks IFC models against Vietnamese practice: information requirements (buildingSMART IDS 1.0, checked with IfcOpenShell's ifctester), LOD per project stage, and quantity take-off — from the command line or as an MCP server for Claude Desktop.

Its main point is coverage: under the IDS standard, an optional (default) specification that matches no element still passes, so "100% compliant" can mean nothing was checked. Reports here state how many elements were actually covered (e.g. Duplex sample: 8/10 specs pass, but only 101/245 elements covered).

Install with pip install git+https://github.com/nguyenthang325-prog/ifc-tools-vn; run modules as python -m ifc_tools_vn.checks.<name> -h, or register the ifc-tools-vn executable as an MCP server (see docs/claude_desktop_config.example.json). The bundled requirement set is the author's own sample loosely based on Decision 347/QĐ-BXD, not an official specification. Output and messages are in Vietnamese. MIT licensed.

Available Tools

5 tools
boc_khoi_luongA

Bóc khối lượng QTO từ IFC dựa trên BaseQuantities Psets. Xuất IFC_QTO_*.xlsx.

IFC xuất từ Revit nên bật 'Export base quantities'. Nếu IFC không có BaseQuantities (ra 0 giá trị), đặt bo_sung_qto=True: đo khối lượng từ hình học, ghi bản sao <tên>_BoSungQTO.ifc vào thư mục kết quả rồi bóc trên bản đó.

Args: ifc_path: Đường dẫn đầy đủ tới file IFC discipline: KT / KC / MEP / ALL stage: TKCS / TKKT / TKTC / AS-BUILT project: Tên dự án bo_sung_qto: True = đo từ hình học khi IFC thiếu BaseQuantities

Inputs: ifc_path (required), stage, project, discipline, +1 more. Returns: result

kiem_tra_idsA

Kiểm tra IFC theo IDS chuẩn buildingSMART (EIR/QD347 -> .ids -> ifctester).

Tự sinh file .ids từ bộ yêu cầu EIR theo bộ môn + giai đoạn rồi chấm bằng ifctester; báo cả độ phủ (bao nhiêu cấu kiện thực sự được kiểm), không chỉ % đạt.

Args: ifc_path: Đường dẫn đầy đủ tới file IFC discipline: KT / KC / MEP / ALL stage: TKCS / TKKT / TKTC / AS-BUILT project: Tên dự án (tự nhận diện nếu để trống)

Inputs: ifc_path (required), stage, project, discipline. Returns: result

kiem_tra_lodB

Kiểm tra LOD (Level of Development) 100–500 từng element theo stage và discipline.

Args: ifc_path: Đường dẫn đầy đủ tới file IFC stage: TKCS / TKKT / TKTC / AS-BUILT discipline: KT / KC / MEP / ALL project: Tên dự án (tự nhận diện nếu để trống)

Inputs: ifc_path (required), stage, project, discipline. Returns: result

kiem_tra_toan_dienB

Chạy toàn bộ BIM audit pipeline (IDS + LOD + QTO) và xuất BIM Health Dashboard.

Args: ifc_path: Đường dẫn đầy đủ tới file IFC project: Tên dự án (tự nhận diện từ tên file nếu để trống) stage: Giai đoạn: TKCS / TKKT / TKTC / AS-BUILT (mặc định: TKKT) discipline: Discipline: KT / KC / MEP / ALL (mặc định: ALL)

Inputs: ifc_path (required), stage, project, discipline. Returns: result

tong_hop_auditA

Tổng hợp kết quả IDS + LOD + QTO từ thư mục kết quả để gửi cho lead discipline. Không cần file IFC — đọc từ các file audit đã chạy trước.

Args: project: Tên dự án (phải khớp với tên đã dùng khi chạy audit trước đó) discipline: KT / KC / MEP / ALL stage: TKCS / TKKT / TKTC / AS-BUILT top: Số lỗi ưu tiên hiển thị (mặc định: 10)

Inputs: project (required), top, stage, discipline. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 5 tools

    Disambiguation4/5

    Each tool targets a distinct scope: a full pipeline, three individual checks (IDS/LOD/QTO), and an aggregation step that reads prior results without an IFC file. The only overlap is that kiem_tra_toan_dien subsumes the three individual check tools, which could cause an agent to pick the wrong granularity, but the descriptions make the run-all vs. run-one distinction reasonably clear.

    Naming Consistency5/5

    All five names follow the same snake_case Vietnamese verb_noun pattern (kiem_tra_*, boc_khoi_luong, tong_hop_audit) with no mixing of casing or verb styles. The pattern is predictable and readable across the whole set.

    Tool Count5/5

    Five tools map cleanly onto a BIM audit workflow: three checks, one orchestrator, one report aggregator. Nothing feels redundant or missing at the count level, and the scope is comfortably within a well-scoped set.

    Completeness4/5

    The surface covers the full audit lifecycle: IDS compliance, LOD, QTO, an end-to-end pipeline, and result aggregation. Minor gaps exist: no element-level drill-down or inspection tool, no clash detection/coordination check, and no way to list prior audit runs or available projects/stages.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      AI-powered BIM tool that connects Claude to a Revit file conversion and BIM query service, enabling users to convert .rvt files to XKT, IFC, and DWG, and explore building elements through natural language.
      1
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      MCP server that lets Claude manage an ISO 19650 / TCVN 14177 Common Data Environment on Autodesk Construction Cloud — projects, CDE folder trees, permissions, files, document status and naming compliance.
      45
      1
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      An MCP server that lets users query, validate, convert, and compare IFC/BIM files using natural language. Runs fully locally and integrates with AI agents like Claude.
      8
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables natural-language validation of IFC models against Türkiye's building-permit BIM regulation, including compliance checks, EK-9 form generation, and queries about required classes and properties.
      6
      3
      MIT