{
  "schemaVersion": "1.0",
  "item": {
    "slug": "bim-qto",
    "name": "Bim Qto",
    "source": "tencent",
    "type": "skill",
    "category": "数据分析",
    "sourceUrl": "https://clawhub.ai/datadrivenconstruction/bim-qto",
    "canonicalUrl": "https://clawhub.ai/datadrivenconstruction/bim-qto",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/bim-qto",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=bim-qto",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "claw.json",
      "instructions.md",
      "SKILL.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/bim-qto"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/bim-qto",
    "agentPageUrl": "https://openagent3.xyz/skills/bim-qto/agent",
    "manifestUrl": "https://openagent3.xyz/skills/bim-qto/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/bim-qto/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Overview",
        "body": "Quantity Takeoff (QTO) extracts measurable quantities from BIM models. This skill processes BIM exports to generate grouped quantity reports for cost estimation."
      },
      {
        "title": "Python Implementation",
        "body": "import pandas as pd\nimport numpy as np\nfrom typing import Dict, Any, List, Optional, Tuple\nfrom dataclasses import dataclass, field\nfrom enum import Enum\n\n\nclass QTOUnit(Enum):\n    \"\"\"Quantity takeoff measurement units.\"\"\"\n    COUNT = \"ea\"\n    LENGTH = \"m\"\n    AREA = \"m2\"\n    VOLUME = \"m3\"\n    WEIGHT = \"kg\"\n    LINEAR_FOOT = \"lf\"\n    SQUARE_FOOT = \"sf\"\n    CUBIC_YARD = \"cy\"\n\n\n@dataclass\nclass QTOItem:\n    \"\"\"Single QTO line item.\"\"\"\n    category: str\n    type_name: str\n    description: str\n    quantity: float\n    unit: str\n    level: Optional[str] = None\n    material: Optional[str] = None\n    element_count: int = 0\n\n\n@dataclass\nclass QTOReport:\n    \"\"\"Complete QTO report.\"\"\"\n    project_name: str\n    items: List[QTOItem]\n    total_elements: int\n    categories: int\n    generated_date: str\n\n\nclass BIMQuantityTakeoff:\n    \"\"\"Extract quantities from BIM data.\"\"\"\n\n    # Column mappings for different BIM exports\n    COLUMN_MAPPINGS = {\n        'type': ['Type Name', 'TypeName', 'type_name', 'Family and Type', 'IfcType'],\n        'category': ['Category', 'category', 'IfcClass', 'Element Category'],\n        'level': ['Level', 'level', 'Building Storey', 'BuildingStorey', 'Floor'],\n        'volume': ['Volume', 'volume', 'Volume (m³)', 'Qty_Volume'],\n        'area': ['Area', 'area', 'Surface Area', 'Area (m²)', 'Qty_Area'],\n        'length': ['Length', 'length', 'Length (m)', 'Qty_Length'],\n        'count': ['Count', 'count', 'Quantity', 'ElementCount'],\n        'material': ['Material', 'material', 'Structural Material', 'MaterialName']\n    }\n\n    def __init__(self, df: pd.DataFrame):\n        \"\"\"Initialize with BIM data DataFrame.\"\"\"\n        self.df = df\n        self.column_map = self._detect_columns()\n\n    def _detect_columns(self) -> Dict[str, str]:\n        \"\"\"Detect which columns exist in data.\"\"\"\n        mapping = {}\n\n        for standard, variants in self.COLUMN_MAPPINGS.items():\n            for variant in variants:\n                if variant in self.df.columns:\n                    mapping[standard] = variant\n                    break\n\n        return mapping\n\n    def get_column(self, standard_name: str) -> Optional[str]:\n        \"\"\"Get actual column name from standard name.\"\"\"\n        return self.column_map.get(standard_name)\n\n    def group_by_type(self, sum_column: str = 'volume') -> pd.DataFrame:\n        \"\"\"Group quantities by type name.\"\"\"\n\n        type_col = self.get_column('type')\n        qty_col = self.get_column(sum_column)\n\n        if type_col is None:\n            raise ValueError(\"Type column not found\")\n\n        if qty_col is None:\n            # Fall back to count\n            result = self.df.groupby(type_col).size().reset_index(name='count')\n        else:\n            result = self.df.groupby(type_col).agg({\n                qty_col: 'sum'\n            }).reset_index()\n            result['count'] = self.df.groupby(type_col).size().values\n\n        result.columns = ['Type', 'Quantity', 'Count'] if len(result.columns) == 3 else ['Type', 'Count']\n        return result.sort_values('Count', ascending=False)\n\n    def group_by_category(self, sum_column: str = 'volume') -> pd.DataFrame:\n        \"\"\"Group quantities by category.\"\"\"\n\n        cat_col = self.get_column('category')\n        qty_col = self.get_column(sum_column)\n\n        if cat_col is None:\n            raise ValueError(\"Category column not found\")\n\n        agg_dict = {}\n        if qty_col:\n            agg_dict[qty_col] = 'sum'\n\n        if agg_dict:\n            result = self.df.groupby(cat_col).agg(agg_dict).reset_index()\n            result['count'] = self.df.groupby(cat_col).size().values\n        else:\n            result = self.df.groupby(cat_col).size().reset_index(name='count')\n\n        return result.sort_values('count', ascending=False)\n\n    def group_by_level(self, sum_column: str = 'volume') -> pd.DataFrame:\n        \"\"\"Group quantities by building level.\"\"\"\n\n        level_col = self.get_column('level')\n        qty_col = self.get_column(sum_column)\n\n        if level_col is None:\n            raise ValueError(\"Level column not found\")\n\n        agg_dict = {}\n        if qty_col:\n            agg_dict[qty_col] = 'sum'\n\n        if agg_dict:\n            result = self.df.groupby(level_col).agg(agg_dict).reset_index()\n            result['count'] = self.df.groupby(level_col).size().values\n        else:\n            result = self.df.groupby(level_col).size().reset_index(name='count')\n\n        return result\n\n    def pivot_by_level_and_type(self) -> pd.DataFrame:\n        \"\"\"Create pivot table: levels as rows, types as columns.\"\"\"\n\n        level_col = self.get_column('level')\n        type_col = self.get_column('type')\n\n        if level_col is None or type_col is None:\n            raise ValueError(\"Level or Type column not found\")\n\n        pivot = pd.crosstab(\n            self.df[level_col],\n            self.df[type_col],\n            margins=True\n        )\n\n        return pivot\n\n    def filter_by_category(self, categories: List[str]) -> 'BIMQuantityTakeoff':\n        \"\"\"Filter to specific categories.\"\"\"\n\n        cat_col = self.get_column('category')\n        if cat_col is None:\n            raise ValueError(\"Category column not found\")\n\n        filtered_df = self.df[self.df[cat_col].isin(categories)]\n        return BIMQuantityTakeoff(filtered_df)\n\n    def filter_by_level(self, levels: List[str]) -> 'BIMQuantityTakeoff':\n        \"\"\"Filter to specific levels.\"\"\"\n\n        level_col = self.get_column('level')\n        if level_col is None:\n            raise ValueError(\"Level column not found\")\n\n        filtered_df = self.df[self.df[level_col].isin(levels)]\n        return BIMQuantityTakeoff(filtered_df)\n\n    def get_walls(self) -> pd.DataFrame:\n        \"\"\"Get wall quantities.\"\"\"\n        cat_col = self.get_column('category')\n        if cat_col:\n            walls = self.df[self.df[cat_col].str.contains('Wall', case=False, na=False)]\n            return BIMQuantityTakeoff(walls).group_by_type()\n        return pd.DataFrame()\n\n    def get_floors(self) -> pd.DataFrame:\n        \"\"\"Get floor/slab quantities.\"\"\"\n        cat_col = self.get_column('category')\n        if cat_col:\n            floors = self.df[self.df[cat_col].str.contains('Floor|Slab', case=False, na=False)]\n            return BIMQuantityTakeoff(floors).group_by_type()\n        return pd.DataFrame()\n\n    def get_doors(self) -> pd.DataFrame:\n        \"\"\"Get door quantities.\"\"\"\n        cat_col = self.get_column('category')\n        if cat_col:\n            doors = self.df[self.df[cat_col].str.contains('Door', case=False, na=False)]\n            return BIMQuantityTakeoff(doors).group_by_type()\n        return pd.DataFrame()\n\n    def get_windows(self) -> pd.DataFrame:\n        \"\"\"Get window quantities.\"\"\"\n        cat_col = self.get_column('category')\n        if cat_col:\n            windows = self.df[self.df[cat_col].str.contains('Window', case=False, na=False)]\n            return BIMQuantityTakeoff(windows).group_by_type()\n        return pd.DataFrame()\n\n    def generate_report(self, project_name: str = \"Project\") -> QTOReport:\n        \"\"\"Generate complete QTO report.\"\"\"\n\n        from datetime import datetime\n\n        items = []\n        type_col = self.get_column('type')\n        cat_col = self.get_column('category')\n        level_col = self.get_column('level')\n        vol_col = self.get_column('volume')\n        area_col = self.get_column('area')\n        mat_col = self.get_column('material')\n\n        # Group by type\n        grouped = self.df.groupby(type_col if type_col else self.df.columns[0])\n\n        for type_name, group in grouped:\n            # Determine primary quantity\n            qty = 0\n            unit = QTOUnit.COUNT.value\n\n            if vol_col and vol_col in group.columns:\n                qty = group[vol_col].sum()\n                unit = QTOUnit.VOLUME.value\n            elif area_col and area_col in group.columns:\n                qty = group[area_col].sum()\n                unit = QTOUnit.AREA.value\n            else:\n                qty = len(group)\n                unit = QTOUnit.COUNT.value\n\n            # Get category and material\n            category = group[cat_col].iloc[0] if cat_col and cat_col in group.columns else \"\"\n            material = group[mat_col].iloc[0] if mat_col and mat_col in group.columns else \"\"\n            level = group[level_col].iloc[0] if level_col and level_col in group.columns else \"\"\n\n            items.append(QTOItem(\n                category=str(category),\n                type_name=str(type_name),\n                description=str(type_name),\n                quantity=round(qty, 2),\n                unit=unit,\n                level=str(level) if level else None,\n                material=str(material) if material else None,\n                element_count=len(group)\n            ))\n\n        return QTOReport(\n            project_name=project_name,\n            items=items,\n            total_elements=len(self.df),\n            categories=self.df[cat_col].nunique() if cat_col else 0,\n            generated_date=datetime.now().isoformat()\n        )\n\n    def to_excel(self, output_path: str, project_name: str = \"Project\"):\n        \"\"\"Export QTO to Excel with multiple sheets.\"\"\"\n\n        with pd.ExcelWriter(output_path, engine='openpyxl') as writer:\n            # Summary by category\n            self.group_by_category().to_excel(\n                writer, sheet_name='By Category', index=False)\n\n            # Summary by type\n            self.group_by_type().to_excel(\n                writer, sheet_name='By Type', index=False)\n\n            # Level breakdown\n            try:\n                self.pivot_by_level_and_type().to_excel(\n                    writer, sheet_name='Level-Type Matrix')\n            except:\n                pass\n\n            # Walls\n            walls = self.get_walls()\n            if not walls.empty:\n                walls.to_excel(writer, sheet_name='Walls', index=False)\n\n            # Doors and Windows\n            doors = self.get_doors()\n            if not doors.empty:\n                doors.to_excel(writer, sheet_name='Doors', index=False)\n\n            windows = self.get_windows()\n            if not windows.empty:\n                windows.to_excel(writer, sheet_name='Windows', index=False)\n\n        return output_path"
      },
      {
        "title": "Quick Start",
        "body": "# Load BIM export\ndf = pd.read_excel(\"revit_export.xlsx\")\n\n# Initialize QTO\nqto = BIMQuantityTakeoff(df)\n\n# Get quantities by type\nby_type = qto.group_by_type()\nprint(by_type.head(10))\n\n# Get wall schedule\nwalls = qto.get_walls()\nprint(walls)"
      },
      {
        "title": "1. Full QTO Report",
        "body": "qto = BIMQuantityTakeoff(df)\nreport = qto.generate_report(\"Office Building\")\nprint(f\"Elements: {report.total_elements}\")\nfor item in report.items[:5]:\n    print(f\"{item.type_name}: {item.quantity} {item.unit}\")"
      },
      {
        "title": "2. Level-by-Level Analysis",
        "body": "pivot = qto.pivot_by_level_and_type()\nprint(pivot)"
      },
      {
        "title": "3. Export to Excel",
        "body": "qto.to_excel(\"qto_report.xlsx\", \"My Project\")"
      },
      {
        "title": "Resources",
        "body": "DDC Book: Chapter 3.2 - Quantity Take-Off"
      }
    ],
    "body": "BIM Quantity Takeoff\nOverview\n\nQuantity Takeoff (QTO) extracts measurable quantities from BIM models. This skill processes BIM exports to generate grouped quantity reports for cost estimation.\n\nPython Implementation\nimport pandas as pd\nimport numpy as np\nfrom typing import Dict, Any, List, Optional, Tuple\nfrom dataclasses import dataclass, field\nfrom enum import Enum\n\n\nclass QTOUnit(Enum):\n    \"\"\"Quantity takeoff measurement units.\"\"\"\n    COUNT = \"ea\"\n    LENGTH = \"m\"\n    AREA = \"m2\"\n    VOLUME = \"m3\"\n    WEIGHT = \"kg\"\n    LINEAR_FOOT = \"lf\"\n    SQUARE_FOOT = \"sf\"\n    CUBIC_YARD = \"cy\"\n\n\n@dataclass\nclass QTOItem:\n    \"\"\"Single QTO line item.\"\"\"\n    category: str\n    type_name: str\n    description: str\n    quantity: float\n    unit: str\n    level: Optional[str] = None\n    material: Optional[str] = None\n    element_count: int = 0\n\n\n@dataclass\nclass QTOReport:\n    \"\"\"Complete QTO report.\"\"\"\n    project_name: str\n    items: List[QTOItem]\n    total_elements: int\n    categories: int\n    generated_date: str\n\n\nclass BIMQuantityTakeoff:\n    \"\"\"Extract quantities from BIM data.\"\"\"\n\n    # Column mappings for different BIM exports\n    COLUMN_MAPPINGS = {\n        'type': ['Type Name', 'TypeName', 'type_name', 'Family and Type', 'IfcType'],\n        'category': ['Category', 'category', 'IfcClass', 'Element Category'],\n        'level': ['Level', 'level', 'Building Storey', 'BuildingStorey', 'Floor'],\n        'volume': ['Volume', 'volume', 'Volume (m³)', 'Qty_Volume'],\n        'area': ['Area', 'area', 'Surface Area', 'Area (m²)', 'Qty_Area'],\n        'length': ['Length', 'length', 'Length (m)', 'Qty_Length'],\n        'count': ['Count', 'count', 'Quantity', 'ElementCount'],\n        'material': ['Material', 'material', 'Structural Material', 'MaterialName']\n    }\n\n    def __init__(self, df: pd.DataFrame):\n        \"\"\"Initialize with BIM data DataFrame.\"\"\"\n        self.df = df\n        self.column_map = self._detect_columns()\n\n    def _detect_columns(self) -> Dict[str, str]:\n        \"\"\"Detect which columns exist in data.\"\"\"\n        mapping = {}\n\n        for standard, variants in self.COLUMN_MAPPINGS.items():\n            for variant in variants:\n                if variant in self.df.columns:\n                    mapping[standard] = variant\n                    break\n\n        return mapping\n\n    def get_column(self, standard_name: str) -> Optional[str]:\n        \"\"\"Get actual column name from standard name.\"\"\"\n        return self.column_map.get(standard_name)\n\n    def group_by_type(self, sum_column: str = 'volume') -> pd.DataFrame:\n        \"\"\"Group quantities by type name.\"\"\"\n\n        type_col = self.get_column('type')\n        qty_col = self.get_column(sum_column)\n\n        if type_col is None:\n            raise ValueError(\"Type column not found\")\n\n        if qty_col is None:\n            # Fall back to count\n            result = self.df.groupby(type_col).size().reset_index(name='count')\n        else:\n            result = self.df.groupby(type_col).agg({\n                qty_col: 'sum'\n            }).reset_index()\n            result['count'] = self.df.groupby(type_col).size().values\n\n        result.columns = ['Type', 'Quantity', 'Count'] if len(result.columns) == 3 else ['Type', 'Count']\n        return result.sort_values('Count', ascending=False)\n\n    def group_by_category(self, sum_column: str = 'volume') -> pd.DataFrame:\n        \"\"\"Group quantities by category.\"\"\"\n\n        cat_col = self.get_column('category')\n        qty_col = self.get_column(sum_column)\n\n        if cat_col is None:\n            raise ValueError(\"Category column not found\")\n\n        agg_dict = {}\n        if qty_col:\n            agg_dict[qty_col] = 'sum'\n\n        if agg_dict:\n            result = self.df.groupby(cat_col).agg(agg_dict).reset_index()\n            result['count'] = self.df.groupby(cat_col).size().values\n        else:\n            result = self.df.groupby(cat_col).size().reset_index(name='count')\n\n        return result.sort_values('count', ascending=False)\n\n    def group_by_level(self, sum_column: str = 'volume') -> pd.DataFrame:\n        \"\"\"Group quantities by building level.\"\"\"\n\n        level_col = self.get_column('level')\n        qty_col = self.get_column(sum_column)\n\n        if level_col is None:\n            raise ValueError(\"Level column not found\")\n\n        agg_dict = {}\n        if qty_col:\n            agg_dict[qty_col] = 'sum'\n\n        if agg_dict:\n            result = self.df.groupby(level_col).agg(agg_dict).reset_index()\n            result['count'] = self.df.groupby(level_col).size().values\n        else:\n            result = self.df.groupby(level_col).size().reset_index(name='count')\n\n        return result\n\n    def pivot_by_level_and_type(self) -> pd.DataFrame:\n        \"\"\"Create pivot table: levels as rows, types as columns.\"\"\"\n\n        level_col = self.get_column('level')\n        type_col = self.get_column('type')\n\n        if level_col is None or type_col is None:\n            raise ValueError(\"Level or Type column not found\")\n\n        pivot = pd.crosstab(\n            self.df[level_col],\n            self.df[type_col],\n            margins=True\n        )\n\n        return pivot\n\n    def filter_by_category(self, categories: List[str]) -> 'BIMQuantityTakeoff':\n        \"\"\"Filter to specific categories.\"\"\"\n\n        cat_col = self.get_column('category')\n        if cat_col is None:\n            raise ValueError(\"Category column not found\")\n\n        filtered_df = self.df[self.df[cat_col].isin(categories)]\n        return BIMQuantityTakeoff(filtered_df)\n\n    def filter_by_level(self, levels: List[str]) -> 'BIMQuantityTakeoff':\n        \"\"\"Filter to specific levels.\"\"\"\n\n        level_col = self.get_column('level')\n        if level_col is None:\n            raise ValueError(\"Level column not found\")\n\n        filtered_df = self.df[self.df[level_col].isin(levels)]\n        return BIMQuantityTakeoff(filtered_df)\n\n    def get_walls(self) -> pd.DataFrame:\n        \"\"\"Get wall quantities.\"\"\"\n        cat_col = self.get_column('category')\n        if cat_col:\n            walls = self.df[self.df[cat_col].str.contains('Wall', case=False, na=False)]\n            return BIMQuantityTakeoff(walls).group_by_type()\n        return pd.DataFrame()\n\n    def get_floors(self) -> pd.DataFrame:\n        \"\"\"Get floor/slab quantities.\"\"\"\n        cat_col = self.get_column('category')\n        if cat_col:\n            floors = self.df[self.df[cat_col].str.contains('Floor|Slab', case=False, na=False)]\n            return BIMQuantityTakeoff(floors).group_by_type()\n        return pd.DataFrame()\n\n    def get_doors(self) -> pd.DataFrame:\n        \"\"\"Get door quantities.\"\"\"\n        cat_col = self.get_column('category')\n        if cat_col:\n            doors = self.df[self.df[cat_col].str.contains('Door', case=False, na=False)]\n            return BIMQuantityTakeoff(doors).group_by_type()\n        return pd.DataFrame()\n\n    def get_windows(self) -> pd.DataFrame:\n        \"\"\"Get window quantities.\"\"\"\n        cat_col = self.get_column('category')\n        if cat_col:\n            windows = self.df[self.df[cat_col].str.contains('Window', case=False, na=False)]\n            return BIMQuantityTakeoff(windows).group_by_type()\n        return pd.DataFrame()\n\n    def generate_report(self, project_name: str = \"Project\") -> QTOReport:\n        \"\"\"Generate complete QTO report.\"\"\"\n\n        from datetime import datetime\n\n        items = []\n        type_col = self.get_column('type')\n        cat_col = self.get_column('category')\n        level_col = self.get_column('level')\n        vol_col = self.get_column('volume')\n        area_col = self.get_column('area')\n        mat_col = self.get_column('material')\n\n        # Group by type\n        grouped = self.df.groupby(type_col if type_col else self.df.columns[0])\n\n        for type_name, group in grouped:\n            # Determine primary quantity\n            qty = 0\n            unit = QTOUnit.COUNT.value\n\n            if vol_col and vol_col in group.columns:\n                qty = group[vol_col].sum()\n                unit = QTOUnit.VOLUME.value\n            elif area_col and area_col in group.columns:\n                qty = group[area_col].sum()\n                unit = QTOUnit.AREA.value\n            else:\n                qty = len(group)\n                unit = QTOUnit.COUNT.value\n\n            # Get category and material\n            category = group[cat_col].iloc[0] if cat_col and cat_col in group.columns else \"\"\n            material = group[mat_col].iloc[0] if mat_col and mat_col in group.columns else \"\"\n            level = group[level_col].iloc[0] if level_col and level_col in group.columns else \"\"\n\n            items.append(QTOItem(\n                category=str(category),\n                type_name=str(type_name),\n                description=str(type_name),\n                quantity=round(qty, 2),\n                unit=unit,\n                level=str(level) if level else None,\n                material=str(material) if material else None,\n                element_count=len(group)\n            ))\n\n        return QTOReport(\n            project_name=project_name,\n            items=items,\n            total_elements=len(self.df),\n            categories=self.df[cat_col].nunique() if cat_col else 0,\n            generated_date=datetime.now().isoformat()\n        )\n\n    def to_excel(self, output_path: str, project_name: str = \"Project\"):\n        \"\"\"Export QTO to Excel with multiple sheets.\"\"\"\n\n        with pd.ExcelWriter(output_path, engine='openpyxl') as writer:\n            # Summary by category\n            self.group_by_category().to_excel(\n                writer, sheet_name='By Category', index=False)\n\n            # Summary by type\n            self.group_by_type().to_excel(\n                writer, sheet_name='By Type', index=False)\n\n            # Level breakdown\n            try:\n                self.pivot_by_level_and_type().to_excel(\n                    writer, sheet_name='Level-Type Matrix')\n            except:\n                pass\n\n            # Walls\n            walls = self.get_walls()\n            if not walls.empty:\n                walls.to_excel(writer, sheet_name='Walls', index=False)\n\n            # Doors and Windows\n            doors = self.get_doors()\n            if not doors.empty:\n                doors.to_excel(writer, sheet_name='Doors', index=False)\n\n            windows = self.get_windows()\n            if not windows.empty:\n                windows.to_excel(writer, sheet_name='Windows', index=False)\n\n        return output_path\n\nQuick Start\n# Load BIM export\ndf = pd.read_excel(\"revit_export.xlsx\")\n\n# Initialize QTO\nqto = BIMQuantityTakeoff(df)\n\n# Get quantities by type\nby_type = qto.group_by_type()\nprint(by_type.head(10))\n\n# Get wall schedule\nwalls = qto.get_walls()\nprint(walls)\n\nCommon Use Cases\n1. Full QTO Report\nqto = BIMQuantityTakeoff(df)\nreport = qto.generate_report(\"Office Building\")\nprint(f\"Elements: {report.total_elements}\")\nfor item in report.items[:5]:\n    print(f\"{item.type_name}: {item.quantity} {item.unit}\")\n\n2. Level-by-Level Analysis\npivot = qto.pivot_by_level_and_type()\nprint(pivot)\n\n3. Export to Excel\nqto.to_excel(\"qto_report.xlsx\", \"My Project\")\n\nResources\nDDC Book: Chapter 3.2 - Quantity Take-Off"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/datadrivenconstruction/bim-qto",
    "publisherUrl": "https://clawhub.ai/datadrivenconstruction/bim-qto",
    "owner": "datadrivenconstruction",
    "version": "2.1.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/bim-qto",
    "downloadUrl": "https://openagent3.xyz/downloads/bim-qto",
    "agentUrl": "https://openagent3.xyz/skills/bim-qto/agent",
    "manifestUrl": "https://openagent3.xyz/skills/bim-qto/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/bim-qto/agent.md"
  }
}