返回顶部
q

qto-report" 工程量报告

Generate Quantity Take-Off (QTO) reports from BIM/CAD data. Extract volumes, areas, counts by category. Group elements, apply calculation rules, and create cost estimates automatically."

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 2.1.0
安全检测
已通过
926
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

qto-report"

工程量清单(QTO)报告生成

概述

基于DDC方法论(第3.2章),本技能可自动从BIM/CAD数据中提取和分组工程量。QTO是建筑行业成本估算、进度规划和项目策划的基础。

参考书籍: Quantity Take-Off и автоматическое создание смет / QTO与自动估算

QTO工程量清单:按属性分组数据,可自动从BIM模型中提取体积和数量用于成本计算。
— DDC书籍,第3.2章

5D BIM概念

QTO流程是5D BIM的核心:

  • - 3D:几何形状(体积、面积、长度)
  • 4D:时间(进度集成)
  • 5D:成本(数量 × 单价)

快速入门

python
import pandas as pd

加载BIM构件数据

df = pd.readcsv(revitexport.csv)

按类别生成QTO

qto = df.groupby(Category).agg({ Volume: sum, Area: sum, ElementId: count }).rename(columns={ElementId: Count})

计算成本(如果有单价)

qto[Unit_Price] = [150, 80, 450, 200] # $/m³ qto[TotalCost] = qto[Volume] * qto[UnitPrice]

qto.toexcel(qtoreport.xlsx)

核心QTO函数

按类别基本QTO

python
import pandas as pd

def generateqto(df, groupby=Category):

按指定列分组生成工程量清单

参数:
df: 包含BIM构件的DataFrame
group_by: 分组依据的列

返回:
QTO汇总DataFrame

# 根据可用列定义聚合方式
agg_dict = {}

if Volume in df.columns:
agg_dict[Volume] = sum
if Area in df.columns:
agg_dict[Area] = sum
if Length in df.columns:
agg_dict[Length] = sum
if Count in df.columns:
agg_dict[Count] = sum
else:
agg_dict[ElementId] = count

qto = df.groupby(groupby).agg(aggdict)

if ElementId in agg_dict:
qto = qto.rename(columns={ElementId: Count})

return qto.round(2)

使用示例

qto = generateqto(df, groupby=Category) print(qto)

多层级QTO

python
def generatemultilevel_qto(df):
按多个层级分组生成QTO
qto = df.groupby([Level, Category, Material]).agg({
Volume: [sum, count],
Area: sum
}).round(2)

# 展平列名
qto.columns = [Volumem3, ElementCount, Area_m2]

# 添加百分比
qto[VolumePct] = (qto[Volumem3] /
qto[Volume_m3].sum() * 100).round(1)

return qto.sortvalues(Volumem3, ascending=False)

使用示例

qto = generatemultilevel_qto(df) qto.toexcel(qtomulti_level.xlsx)

使用数据透视表的QTO

python
def generateqtopivot(df, values=Volume, index=Level, columns=Category):
生成数据透视表形式的QTO
pivot = pd.pivot_table(
df,
values=values,
index=index,
columns=columns,
aggfunc=sum,
fill_value=0,
margins=True,
margins_name=TOTAL
).round(2)

return pivot

使用示例 - 按楼层和类别的体积

qtopivot = generateqto_pivot(df, values=Volume) qtopivot.toexcel(qto_pivot.xlsx)

基于QTO的成本计算

应用单价

python
def calculatecostfromqto(qtodf, pricesdf, quantitycol=Volume):

通过将单价应用于数量来计算成本

参数:
qto_df: 包含数量的QTO DataFrame
prices_df: 包含类别和单价的DataFrame
quantity_col: 包含数量的列

# 合并价格
result = qtodf.resetindex().merge(
prices_df, on=Category, how=left
)

# 计算成本
result[TotalCost] = result[quantitycol] * result[Unit_Price]
result[CostPct] = (result[TotalCost] /
result[Total_Cost].sum() * 100).round(1)

# 汇总
grandtotal = result[TotalCost].sum()
print(f总计: ${grand_total:,.2f})

return result

单价数据库

prices = pd.DataFrame({ Category: [Wall, Floor, Column, Beam, Foundation], Unit_Price: [150, 80, 450, 200, 120], # $/m³ Unit: [m³, m³, m³, m³, m³] })

计算

costestimate = calculatecostfromqto(qto, prices) costestimate.toexcel(cost_estimate.xlsx, index=False)

应用Excel规则

python
def applyexcelrules(df, rules_path):

应用Excel文件中定义的计算规则

Excel格式:
| Category | Formula_Type | Factor | Unit |
| Wall | volume | 1.05 | m³ |
| Floor | area | 1.10 | m² |

rules = pd.readexcel(rulespath)

results = []
for _, rule in rules.iterrows():
category = rule[Category]
formulatype = rule[FormulaType]
factor = rule[Factor]

category_data = df[df[Category] == category].copy()

if formula_type == volume:
categorydata[Quantity] = categorydata[Volume] * factor
elif formula_type == area:
categorydata[Quantity] = categorydata[Area] * factor
elif formula_type == length:
categorydata[Quantity] = categorydata[Length] * factor
elif formula_type == count:
categorydata[Quantity] = categorydata.groupby(Category).ngroup() + 1

category_data[Unit] = rule[Unit]
results.append(category_data)

return pd.concat(results, ignore_index=True)

使用示例

dfwithquantities = applyexcelrules(df, calculation_rules.xlsx)

BIM数据提取模式

从Revit导出(CSV)

python
def processrevitexport(csv_path):
处理标准Revit明细表导出
df = pd.readcsv(csvpath)

# 标准化列名
column_mapping = {
Family and Type: Type,
Volume: Volume,
Area: Area,
Count: Count,
Level: Level,
Category: Category
}

df = df.rename(columns={
k: v for k, v in column_mapping.items()
if k in df.columns
})

# 将体积从立方英尺转换为立方米(如果需要)
if Volume in df.columns:
# Revit默认以立方英尺导出
df[Volume_m3] = df[Volume] * 0.0283168

return df

使用示例

df = processrevitexport(revit_schedule.csv) qto = generate_qto(df)

从IFC导出

python

使用IfcOpenShell


import ifcopenshell
import pandas as pd

def extractqtofromifc(ifcpath):
从IFC文件中提取工程量
ifc = ifcopenshell.open(ifc_path)

elements = []
for element in ifc.by_type(IfcBuildingElement):
# 获取属性
props = {
GlobalId: element.GlobalId,
Name: element.Name,
Type: element.is_a(),
Material: None,
Volume: None,
Area: None
}

# 从属性集中提取工程量
for definition in element.IsDefinedBy:
if definition.is_a(IfcRelDefinesByProperties):
pset = definition.RelatingPropertyDefinition
if pset.is_a(IfcElementQuantity):
for qty in pset.Quantities:
if qty.is_a(IfcQuantityVolume):
props[Volume] =

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 qto-report-1776344351 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 qto-report-1776344351 技能

通过命令行安装

skillhub install qto-report-1776344351

下载

⬇ 下载 qto-report" v2.1.0(免费)

文件大小: 5.95 KB | 发布时间: 2026-4-17 16:06

v2.1.0 最新 2026-4-17 16:06
- Added integration metadata for OpenCLAW compatibility, including requirements and Windows OS support.
- Introduced new files: `claw.json` for CLI/configuration metadata and `instructions.md` for documentation.
- Updated SKILL.md to OpenCLAW format with structured metadata and homepage link.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部