Extract quantities from BIM/CAD data for cost estimation. Group by type, level, zone. Generate QTO reports.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install bim-qto或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install bim-qto⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/bim-qto/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: "bim-qto" description: "Extract quantities from BIM/CAD data for cost estimation. Group by type, level, zone. Generate QTO reports." homepage: "https://datadrivenconstruction.io" metadata: {"openclaw": {"emoji": "⚡", "os": ["win32"], "homepage": "https://datadrivenconstruction.io", "requires": {"bins": ["python3"]}}} ---
Quantity Takeoff (QTO) extracts measurable quantities from BIM models. This skill processes BIM exports to generate grouped quantity reports for cost estimation.
import pandas as pd
import numpy as np
from typing import Dict, Any, List, Optional, Tuple
from dataclasses import dataclass, field
from enum import Enum
class QTOUnit(Enum):
"""Quantity takeoff measurement units."""
COUNT = "ea"
LENGTH = "m"
AREA = "m2"
VOLUME = "m3"
WEIGHT = "kg"
LINEAR_FOOT = "lf"
SQUARE_FOOT = "sf"
CUBIC_YARD = "cy"
@dataclass
class QTOItem:
"""Single QTO line item."""
category: str
type_name: str
description: str
quantity: float
unit: str
level: Optional[str] = None
material: Optional[str] = None
element_count: int = 0
@dataclass
class QTOReport:
"""Complete QTO report."""
project_name: str
items: List[QTOItem]
total_elements: int
categories: int
generated_date: str
class BIMQuantityTakeoff:
"""Extract quantities from BIM data."""
# Column mappings for different BIM exports
COLUMN_MAPPINGS = {
'type': ['Type Name', 'TypeName', 'type_name', 'Family and Type', 'IfcType'],
'category': ['Category', 'category', 'IfcClass', 'Element Category'],
'level': ['Level', 'level', 'Building Storey', 'BuildingStorey', 'Floor'],
'volume': ['Volume', 'volume', 'Volume (m³)', 'Qty_Volume'],
'area': ['Area', 'area', 'Surface Area', 'Area (m²)', 'Qty_Area'],
'length': ['Length', 'length', 'Length (m)', 'Qty_Length'],
'count': ['Count', 'count', 'Quantity', 'ElementCount'],
'material': ['Material', 'material', 'Structural Material', 'MaterialName']
}
def __init__(self, df: pd.DataFrame):
"""Initialize with BIM data DataFrame."""
self.df = df
self.column_map = self._detect_columns()
def _detect_columns(self) -> Dict[str, str]:
"""Detect which columns exist in data."""
mapping = {}
for standard, variants in self.COLUMN_MAPPINGS.items():
for variant in variants:
if variant in self.df.columns:
mapping[standard] = variant
break
return mapping
def get_column(self, standard_name: str) -> Optional[str]:
"""Get actual column name from standard name."""
return self.column_map.get(standard_name)
def group_by_type(self, sum_column: str = 'volume') -> pd.DataFrame:
"""Group quantities by type name."""
type_col = self.get_column('type')
qty_col = self.get_column(sum_column)
if type_col is None:
raise ValueError("Type column not found")
if qty_col is None:
# Fall back to count
result = self.df.groupby(type_col).size().reset_index(name='count')
else:
result = self.df.groupby(type_col).agg({
qty_col: 'sum'
}).reset_index()
result['count'] = self.df.groupby(type_col).size().values
result.columns = ['Type', 'Quantity', 'Count'] if len(result.columns) == 3 else ['Type', 'Count']
return result.sort_values('Count', ascending=False)
def group_by_category(self, sum_column: str = 'volume') -> pd.DataFrame:
"""Group quantities by category."""
cat_col = self.get_column('category')
qty_col = self.get_column(sum_column)
if cat_col is None:
raise ValueError("Category column not found")
agg_dict = {}
if qty_col:
agg_dict[qty_col] = 'sum'
if agg_dict:
result = self.df.groupby(cat_col).agg(agg_dict).reset_index()
result['count'] = self.df.groupby(cat_col).size().values
else:
result = self.df.groupby(cat_col).size().reset_index(name='count')
return result.sort_values('count', ascending=False)
def group_by_level(self, sum_column: str = 'volume') -> pd.DataFrame:
"""Group quantities by building level."""
level_col = self.get_column('level')
qty_col = self.get_column(sum_column)
if level_col is None:
raise ValueError("Level column not found")
agg_dict = {}
if qty_col:
agg_dict[qty_col] = 'sum'
if agg_dict:
result = self.df.groupby(level_col).agg(agg_dict).reset_index()
result['count'] = self.df.groupby(level_col).size().values
else:
result = self.df.groupby(level_col).size().reset_index(name='count')
return result
def pivot_by_level_and_type(self) -> pd.DataFrame:
"""Create pivot table: levels as rows, types as columns."""
level_col = self.get_column('level')
type_col = self.get_column('type')
if level_col is None or type_col is None:
raise ValueError("Level or Type column not found")
pivot = pd.crosstab(
self.df[level_col],
self.df[type_col],
margins=True
)
return pivot
def filter_by_category(self, categories: List[str]) -> 'BIMQuantityTakeoff':
"""Filter to specific categories."""
cat_col = self.get_column('category')
if cat_col is None:
raise ValueError("Category column not found")
filtered_df = self.df[self.df[cat_col].isin(categories)]
return BIMQuantityTakeoff(filtered_df)
def filter_by_level(self, levels: List[str]) -> 'BIMQuantityTakeoff':
"""Filter to specific levels."""
level_col = self.get_column('level')
if level_col is None:
raise ValueError("Level column not found")
filtered_df = self.df[self.df[level_col].isin(levels)]
return BIMQuantityTakeoff(filtered_df)
def get_walls(self) -> pd.DataFrame:
"""Get wall quantities."""
cat_col = self.get_column('category')
if cat_col:
walls = self.df[self.df[cat_col].str.contains('Wall', case=False, na=False)]
return BIMQuantityTakeoff(walls).group_by_type()
return pd.DataFrame()
def get_floors(self) -> pd.DataFrame:
"""Get floor/slab quantities."""
cat_col = self.get_column('category')
if cat_col:
floors = self.df[self.df[cat_col].str.contains('Floor|Slab', case=False, na=False)]
return BIMQuantityTakeoff(floors).group_by_type()
return pd.DataFrame()
def get_doors(self) -> pd.DataFrame:
"""Get door quantities."""
cat_col = self.get_column('category')
if cat_col:
doors = self.df[self.df[cat_col].str.contains('Door', case=False, na=False)]
return BIMQuantityTakeoff(doors).group_by_type()
return pd.DataFrame()
def get_windows(self) -> pd.DataFrame:
"""Get window quantities."""
cat_col = self.get_column('category')
if cat_col:
windows = self.df[self.df[cat_col].str.contains('Window', case=False, na=False)]
return BIMQuantityTakeoff(windows).group_by_type()
return pd.DataFrame()
def generate_report(self, project_name: str = "Project") -> QTOReport:
"""Generate complete QTO report."""
from datetime import datetime
items = []
type_col = self.get_column('type')
...安装 Bim Qto 后,可以对 AI 说这些话来触发它
Help me get started with Bim Qto
Explains what Bim Qto does, walks through the setup, and runs a quick demo based on your current project
Use Bim Qto to extract quantities from BIM/CAD data for cost estimation
Invokes Bim Qto with the right parameters and returns the result directly in the conversation
What can I do with Bim Qto in my data & analytics workflow?
Lists the top use cases for Bim Qto, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/bim-qto/ 目录(个人级,所有项目可用),或 .claude/skills/bim-qto/(项目级)。重启 AI 客户端后,用 /bim-qto 主动调用,或让 AI 根据上下文自动发现并使用。
Bim Qto 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Bim Qto 可免费安装使用。请查阅仓库了解许可证信息。
Extract quantities from BIM/CAD data for cost estimation. Group by type, level, zone. Generate QTO reports.
Bim Qto 属于「Data & Analytics」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my data & analytics tasks using Bim Qto
Identifies repetitive steps in your workflow and sets up Bim Qto to handle them automatically