bim-cost-estimation-cwicr
This Claude Code skill automates construction cost estimation by extracting quantities from Building Information Models, using AI to classify building elements into standard work items, and applying vector search across the DDC CWICR database of 55,719 construction items to retrieve accurate pricing. Use this when rapid, data-driven cost estimates are needed during design phases or when design changes require quick estimate updates.
git clone --depth 1 https://github.com/datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction /tmp/bim-cost-estimation-cwicr && cp -r /tmp/bim-cost-estimation-cwicr/1_DDC_Toolkit/Cost-Management/bim-cost-estimation-cwicr ~/.claude/skills/bim-cost-estimation-cwicrSKILL.md
# BIM Cost Estimation with DDC CWICR
Generate accurate cost estimates from BIM models using AI classification and the DDC CWICR construction cost database.
## Business Case
**Problem**: Traditional cost estimation:
- Manual and time-consuming (weeks for detailed estimate)
- Subjective and inconsistent between estimators
- Requires specialized knowledge
- Difficult to update with design changes
**Solution**: Automated BIM-to-cost pipeline:
- Extract quantities directly from model
- AI classifies elements to work items
- Vector search finds matching prices in CWICR
- Complete estimate in hours, not weeks
**ROI**: 80% reduction in estimation time, consistent methodology
## System Architecture
```
┌──────────────────────────────────────────────────────────────────────────┐
│ BIM TO COST ESTIMATION PIPELINE │
├──────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────────────┐ │
│ │ BIM │ │ DDC │ │ AI │ │ DDC CWICR │ │
│ │ Model │────►│Converter│────►│ LLM │────►│ Vector Search │ │
│ │.rvt/.ifc│ │ │ │ │ │ (Qdrant) │ │
│ └─────────┘ └─────────┘ └─────────┘ └─────────────────┘ │
│ │ │ │ │
│ ▼ ▼ ▼ │
│ ┌─────────┐ ┌─────────┐ ┌──────────┐ │
│ │ .xlsx │ │ Work │ │ Matched │ │
│ │ QTO │ │ Items │ │ Rates │ │
│ └─────────┘ └─────────┘ └──────────┘ │
│ │ │ │ │
│ └──────────────┼────────────────────┘ │
│ ▼ │
│ ┌─────────────────┐ │
│ │ COST ESTIMATE │ │
│ │ │ │
│ │ • By element │ │
│ │ • By trade │ │
│ │ • By phase │ │
│ │ • Resources │ │
│ └─────────────────┘ │
│ │
└──────────────────────────────────────────────────────────────────────────┘
```
## DDC CWICR Database
```yaml
Database Overview:
work_items: 78228 # 8 national bases
resources: 27,672
languages: 9 (AR, DE, EN, ES, FR, HI, PT, RU, ZH)
fields_per_item: 85
embedding_model: BAAI/bge-m3 (1024d)
vector_db: Qdrant
Collections:
- ddc_cwicr_ar # Arabic (Dubai prices)
- ddc_cwicr_de # German (Berlin prices)
- cwicr_en_v3 # English (Toronto prices)
- ddc_cwicr_es # Spanish (Barcelona prices)
- ddc_cwicr_fr # French (Paris prices)
- ddc_cwicr_hi # Hindi (Mumbai prices)
- ddc_cwicr_pt # Portuguese (São Paulo prices)
- ddc_cwicr_ru # Russian (St. Petersburg prices)
- ddc_cwicr_zh # Chinese (Shanghai prices)
```
## Pipeline Stages
| Stage | Name | Description |
|-------|------|-------------|
| 0 | Collect BIM Data | Extract elements from Revit/IFC |
| 1 | Project Detection | AI identifies project type |
| 2 | Phase Generation | AI creates construction phases |
| 3 | Element Assignment | AI maps types to phases |
| 4 | Work Decomposition | AI breaks types into work items |
| 5 | Vector Search | Find matching rates in CWICR |
| 6 | Unit Mapping | Convert BIM units to rate units |
| 7 | Cost Calculation | Qty × Unit Price |
| 7.5 | Validation | CTO review for completeness |
| 8 | Aggregation | Sum by phases and categories |
| 9 | Report Generation | HTML and Excel outputs |
## Python Implementation
```python
import pandas as pd
import numpy as np
from qdrant_client import QdrantClient
from qdrant_client.models import Filter, FieldCondition, MatchValue
from openai import OpenAI
from typing import List, Dict, Optional
from dataclasses import dataclass
import json
@dataclass
class WorkItem:
"""Matched work item from CWICR"""
cwicr_code: str
description: str
unit: str
unit_price: float
labor_cost: float
material_cost: float
equipment_cost: float
productivity: float # units per hour
currency: str
confidence: float
@dataclass
class CostLineItem:
"""Single line item in estimate"""
bim_type: str
work_item: WorkItem
quantity: float
quantity_unit: str
total_cost: float
labor_cost: float
material_cost: float
equipment_cost: float
phase: str
trade: str
class BIMCostEstimator:
"""BIM to cost estimation using DDC CWICR"""
def __init__(
self,
qdrant_url: str,
qdrant_api_key: str = None,
openai_api_key: str = None,
language: str = "EN"
):
self.qdrant = QdrantClient(url=qdrant_url, api_key=qdrant_api_key)
self.openai = OpenAI(api_key=openai_api_key)
self.language = language
self.collection = f"ddc_cwicr_{language.lower()}"
def get_embedding(self, text: str) -> List[float]:
"""Generate embedding for text"""
response = self.openai.embeddings.create(
model="BAAI/bge-m3",
input=text,
dimensions=1024
)
return response.data[0].embedding
def search_cwicr(
self,
query: str,
limit: int = 5,
category_filter: str = None
) -> List[WorkItem]:
"""Search CWICR database forAnalyze 5000+ IFC and Revit projects at scale for patterns, benchmarks, and insights. Big data analysis for construction.
Manage as-built documentation for project closeout. Track drawing markups, coordinate updates, and verify completeness.
Track as-built documentation and record drawings. Monitor submission status, manage revisions, and ensure completeness for handover.
Batch convert multiple CAD/BIM files (Revit, IFC, DWG, DGN) with progress tracking, error handling, and consolidated reporting.
Compare and analyze contractor bids. Score proposals, identify scope gaps, and recommend selections.
Detect and analyze geometric clashes in BIM models. Identify MEP, structural, and architectural conflicts before construction.
Classify BIM elements using AI and standard classification systems. Map elements to UniFormat, MasterFormat, OmniClass, and CWICR codes.
Link BIM elements to schedule activities for 4D simulation. Visualize construction sequence over time.