Token导航 LogoToken导航

Agent Skill · 待分类

cad-to-data(CAD 到数据)

用于辅助数据整理、表格处理、CSV/Excel 分析、指标计算和图表准备。它适合让 Agent 清洗字段、汇总数据、发现异常、生成统计口径或把分析结果转成可读说明。使用时需要确认数据来源、字段含义和时间范围,避免把样本数据当全量事实;涉及敏感数据、导出文件或批量写回时,应先确认权限和脱敏边界。

cad-to-data 是待分类类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证信息还不明确,第三方扫描已通过,按安装量在待分类类的 11,209 个 Skill 里排第 1,393。

总安装 3,519周安装 141GitHub Stars 113下载 1,139核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:cad-to-data(CAD 到数据)
来源仓库:https://github.com/datadrivenconstruction/ddc_skills_for_ai_agents_in_construction
仓库路径:skills/cad-to-data
安装命令:
npx skills add https://github.com/datadrivenconstruction/ddc_skills_for_ai_agents_in_construction --skill cad-to-data
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/datadrivenconstruction/ddc_skills_for_ai_agents_in_construction --skill cad-to-data

这个 Skill 是做什么的

这个 Skill 的分类还没最终确定,用法以来源仓库的说明为准。

cad-to-data 将 Revit、IFC、DWG 等 CAD/BIM 文件转换为结构化数据,提取构件属性与数量关系。适用于建筑、工程与施工领域,支持工程量统计与数据分析自动化。提供格式解析器与元数据提取接口,便于后续集成到 BIM 管理平台。

使用前请确认本地已安装对应 CAD 软件或解析库(如 IfcOpenShell)。处理敏感项目数据时需做好脱敏与权限控制,避免图纸信息外泄。

来源仓库内路径:skills/cad-to-data

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/datadrivenconstruction/ddc_skills_for_ai_agent…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

cad-to-data 怎么安装?

在终端执行 npx skills add https://github.com/datadrivenconstruction/ddc_skills_for_ai_agents_in_const…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

cad-to-data 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

cad-to-data 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

cad-to-data 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

cad-to-data 用的人多吗?

公开数据是累计安装 3,519 次,近一周安装 141 次,下载 1,139 次,GitHub 113 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

cad-to-data 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。
  • 标注为只读权限,试用阶段不容易误改本地文件。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理待分类类任务、又不想每次都手写提示词的人。
  • 只想先试试效果、不希望它改动本地文件的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

待分类类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
infsh-cli

infsh CLI · Codex、Claude

4,374,576382权限未标注未明确未收录
ai-video-generation

AI 视频生成 · Codex、Claude

4,313,376382调用外部服务未明确有提醒
lark-openapi-explorer

云雀 OpenAPI 浏览器 · Codex、Claude

2,064,1209,011需要联网未明确有提醒
lark-workflow-standup-report

Lark 工作流程站立报告 · Codex、Claude

2,041,6328,978需要联网未明确通过
use-my-browser

使用我的浏览器 · Codex、Claude

1,848,49140操作浏览器未明确未通过
cad-to-data

CAD 到数据 · 本页

3,519113只读未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

CAD To Data

Overview

Based on DDC methodology (Chapter 2.4), this skill converts CAD and BIM files to structured data, extracting element properties, quantities, and relationships from Revit, IFC, DWG, and DGN files.

Book Reference: "Преобразование данных в структурированную форму" / "Data Transformation to Structured Form"

Quick Start

from dataclasses import dataclass, field
from enum import Enum
from typing import List, Dict, Optional, Any, Tuple, Generator
from datetime import datetime
import json

class CADFormat(Enum):
    """Supported CAD/BIM formats"""
    IFC = "ifc"
    RVT = "rvt"
    DWG = "dwg"
    DXF = "dxf"
    DGN = "dgn"
    NWD = "nwd"
    STEP = "step"

class ElementCategory(Enum):
    """BIM element categories"""
    WALL = "wall"
    FLOOR = "floor"
    ROOF = "roof"
    CEILING = "ceiling"
    DOOR = "door"
    WINDOW = "window"
    COLUMN = "column"
    BEAM = "beam"
    STAIR = "stair"
    RAMP = "ramp"
    FURNITURE = "furniture"
    EQUIPMENT = "equipment"
    PIPE = "pipe"
    DUCT = "duct"
    CABLE_TRAY = "cable_tray"
    SPACE = "space"
    GENERIC = "generic"

@dataclass
class Point3D:
    """3D point"""
    x: float
    y: float
    z: float

@dataclass
class BoundingBox3D:
    """3D bounding box"""
    min_point: Point3D
    max_point: Point3D

    @property
    def width(self) -> float:
        return abs(self.max_point.x - self.min_point.x)

    @property
    def depth(self) -> float:
        return abs(self.max_point.y - self.min_point.y)

    @property
    def height(self) -> float:
        return abs(self.max_point.z - self.min_point.z)

    @property
    def volume(self) -> float:
        return self.width * self.depth * self.height

@dataclass
class MaterialInfo:
    """Material information"""
    name: str
    category: str
    color: Optional[str] = None
    area: float = 0.0
    volume: float = 0.0
    properties: Dict[str, Any] = field(default_factory=dict)

@dataclass
class CADElement:
    """Extracted CAD/BIM element"""
    id: str
    guid: str
    name: str
    category: ElementCategory
    type_name: str
    level: Optional[str] = None
    bounding_box: Optional[BoundingBox3D] = None
    properties: Dict[str, Any] = field(default_factory=dict)
    quantities: Dict[str, float] = field(default_factory=dict)
    materials: List[MaterialInfo] = field(default_factory=list)
    relationships: Dict[str, List[str]] = field(default_factory=dict)

@dataclass
class CADLayer:
    """CAD layer information"""
    name: str
    color: Optional[str] = None
    line_type: Optional[str] = None
    visible: bool = True
    element_count: int = 0

@dataclass
class CADExtractionResult:
    """Result of CAD extraction"""
    file_path: str
    file_format: CADFormat
    elements: List[CADElement]
    layers: List[CADLayer]
    levels: List[str]
    total_elements: int
    categories: Dict[str, int]
    extraction_time: float
    metadata: Dict[str, Any] = field(default_factory=dict)

class IFCExtractor:
    """Extract data from IFC files"""

    def __init__(self):
        self.schema_version = "IFC4"
        self.element_mapping = self._build_element_mapping()

    def _build_element_mapping(self) -> Dict[str, ElementCategory]:
        """Map IFC types to categories"""
        return {
            "IfcWall": ElementCategory.WALL,
            "IfcWallStandardCase": ElementCategory.WALL,
            "IfcSlab": ElementCategory.FLOOR,
            "IfcRoof": ElementCategory.ROOF,
            "IfcCeiling": ElementCategory.CEILING,
            "IfcDoor": ElementCategory.DOOR,
            "IfcWindow": ElementCategory.WINDOW,
            "IfcColumn": ElementCategory.COLUMN,
            "IfcBeam": ElementCategory.BEAM,
            "IfcStair": ElementCategory.STAIR,
            "IfcRamp": ElementCategory.RAMP,
            "IfcFurnishingElement": ElementCategory.FURNITURE,
            "IfcPipeSegment": ElementCategory.PIPE,
            "IfcDuctSegment": ElementCategory.DUCT,
            "IfcCableCarrierSegment": ElementCategory.CABLE_TRAY,
            "IfcSpace": ElementCategory.SPACE,
        }

    def extract(
        self,
        file_path: str,
        categories: Optional[List[ElementCategory]] = None
    ) -> CADExtractionResult:
        """
        Extract data from IFC file.

        Args:
            file_path: Path to IFC file
            categories: Optional filter for categories

        Returns:
            Extraction result
        """
        start_time = datetime.now()

        # In production, use ifcopenshell:
        # import ifcopenshell
        # ifc_file = ifcopenshell.open(file_path)

        # Simulated extraction
        elements = self._simulate_ifc_elements()

        # Filter by category if specified
        if categories:
            elements = [e for e in elements if e.category in categories]

        # Build category counts
        category_counts = {}
        for element in elements:
            cat = element.category.value
            category_counts[cat] = category_counts.get(cat, 0) + 1

        # Extract levels
        levels = list(set(e.level for e in elements if e.level))

        extraction_time = (datetime.now() - start_time).total_seconds()

        return CADExtractionResult(
            file_path=file_path,
            file_format=CADFormat.IFC,
            elements=elements,
            layers=[],  # IFC doesn't use layers in traditional sense
            levels=levels,
            total_elements=len(elements),
            categories=category_counts,
            extraction_time=extraction_time,
            metadata={
                "schema": self.schema_version,
                "project_name": "Sample Project"
            }
        )

    def _simulate_ifc_elements(self) -> List[CADElement]:
        """Simulate IFC element extraction"""
        elements = []

        # Sample walls
        for i in range(10):
            elements.append(CADElement(
                id=f"wall_{i}",
                guid=f"1234567890ABCDEF{i:04d}",
                name=f"Basic Wall {i}",
                category=ElementCategory.WALL,
                type_name="Basic Wall:200mm Concrete",
                level="Level 1",
                bounding_box=BoundingBox3D(
                    min_point=Point3D(i * 5, 0, 0),
                    max_point=Point3D(i * 5 + 5, 0.2, 3)
                ),
                properties={
                    "IsExternal": True,
                    "FireRating": "1 HR",
                    "LoadBearing": True
                },
                quantities={
                    "Length": 5.0,
                    "Height": 3.0,
                    "Width": 0.2,
                    "Area": 15.0,
                    "Volume": 3.0
                },
                materials=[
                    MaterialInfo(
                        name="Concrete",
                        category="Concrete",
                        area=15.0,
                        volume=3.0
                    )
                ]
            ))

        # Sample doors
        for i in range(5):
            elements.append(CADElement(
                id=f"door_{i}",
                guid=f"DOOR0000000000{i:04d}",
                name=f"Single Door {i}",
                category=ElementCategory.DOOR,
                type_name="Single Flush:900x2100",
                level="Level 1",
                properties={
                    "FireRating": "None",
                    "IsExternal": False
                },
                quantities={
                    "Width": 0.9,
                    "Height": 2.1,
                    "Area": 1.89
                },
                relationships={
                    "host_wall": [f"wall_{i}"]
                }
            ))

        # Sample spaces
        for i in range(3):
            elements.append(CADElement(
                id=f"space_{i}",
                guid=f"SPACE000000000{i:04d}",
                name=f"Room {i+101}",
                category=ElementCategory.SPACE,
                type_name="Office",
                level="Level 1",
                quantities={
                    "Area": 25.0 + i * 5,
                    "Volume": 75.0 + i * 15,
                    "Perimeter": 20.0 + i * 2
                },
                properties={
                    "OccupancyType": "Office",
                    "DesignOccupancy": 4
                }
            ))

        return elements

    def get_quantities(
        self,
        elements: List[CADElement],
        quantity_type: str = "all"
    ) -> Dict[str, float]:
        """Aggregate quantities from elements"""
        totals = {}

        for element in elements:
            for qty_name, qty_value in element.quantities.items():
                if quantity_type == "all" or qty_name.lower() == quantity_type.lower():
                    key = f"{element.category.value}_{qty_name}"
                    totals[key] = totals.get(key, 0) + qty_value

        return totals

class DWGExtractor:
    """Extract data from DWG/DXF files"""

    def __init__(self):
        self.supported_entities = ["LINE", "POLYLINE", "CIRCLE", "ARC", "TEXT", "MTEXT", "INSERT", "HATCH"]

    def extract(
        self,
        file_path: str,
        layers: Optional[List[str]] = None
    ) -> CADExtractionResult:
        """Extract data from DWG file"""
        start_time = datetime.now()

        # In production, use ezdxf:
        # import ezdxf
        # doc = ezdxf.readfile(file_path)

        # Simulated extraction
        elements, cad_layers = self._simulate_dwg_extraction()

        # Filter by layers if specified
        if layers:
            elements = [e for e in elements if e.properties.get("layer") in layers]

        extraction_time = (datetime.now() - start_time).total_seconds()

        return CADExtractionResult(
            file_path=file_path,
            file_format=CADFormat.DWG,
            elements=elements,
            layers=cad_layers,
            levels=[],
            total_elements=len(elements),
            categories={"generic": len(elements)},
            extraction_time=extraction_time,
            metadata={"units": "millimeters"}
        )

    def _simulate_dwg_extraction(self) -> Tuple[List[CADElement], List[CADLayer]]:
        """Simulate DWG extraction"""
        elements = []
        layers = [
            CADLayer("Walls", "Red", "Continuous", True, 15),
            CADLayer("Doors", "Blue", "Continuous", True, 8),
            CADLayer("Windows", "Cyan", "Continuous", True, 12),
            CADLayer("Dimensions", "Green", "Continuous", True, 50),
            CADLayer("Text", "White", "Continuous", True, 25),
        ]

        # Simulate polylines (walls)
        for i in range(15):
            elements.append(CADElement(
                id=f"polyline_{i}",
                guid=f"PL{i:08d}",
                name=f"Polyline {i}",
                category=ElementCategory.GENERIC,
                type_name="POLYLINE",
                properties={
                    "layer": "Walls",
                    "color": "Red",
                    "closed": True
                },
                quantities={
                    "Length": 10.5 + i * 0.5
                }
            ))

        return elements, layers

class CADDataConverter:
    """
    Convert CAD/BIM files to structured data.
    Based on DDC methodology Chapter 2.4.
    """

    def __init__(self):
        self.ifc_extractor = IFCExtractor()
        self.dwg_extractor = DWGExtractor()

    def convert(
        self,
        file_path: str,
        output_format: str = "json"
    ) -> Dict[str, Any]:
        """
        Convert CAD file to structured data.

        Args:
            file_path: Path to CAD file
            output_format: Output format (json, csv, dataframe)

        Returns:
            Structured data
        """
        # Detect file format
        file_format = self._detect_format(file_path)

        # Extract based on format
        if file_format == CADFormat.IFC:
            result = self.ifc_extractor.extract(file_path)
        elif file_format in [CADFormat.DWG, CADFormat.DXF]:
            result = self.dwg_extractor.extract(file_path)
        else:
            raise ValueError(f"Unsupported format: {file_format}")

        # Convert to output format
        return self._format_output(result, output_format)

    def _detect_format(self, file_path: str) -> CADFormat:
        """Detect CAD file format"""
        extension = file_path.lower().split(".")[-1]

        format_map = {
            "ifc": CADFormat.IFC,
            "rvt": CADFormat.RVT,
            "dwg": CADFormat.DWG,
            "dxf": CADFormat.DXF,
            "dgn": CADFormat.DGN,
            "nwd": CADFormat.NWD,
        }

        return format_map.get(extension, CADFormat.IFC)

    def _format_output(
        self,
        result: CADExtractionResult,
        format: str
    ) -> Dict[str, Any]:
        """Format extraction result"""
        output = {
            "file": result.file_path,
            "format": result.file_format.value,
            "total_elements": result.total_elements,
            "categories": result.categories,
            "levels": result.levels,
            "extraction_time": result.extraction_time,
            "elements": []
        }

        for element in result.elements:
            output["elements"].append({
                "id": element.id,
                "guid": element.guid,
                "name": element.name,
                "category": element.category.value,
                "type": element.type_name,
                "level": element.level,
                "properties": element.properties,
                "quantities": element.quantities,
                "materials": [
                    {"name": m.name, "area": m.area, "volume": m.volume}
                    for m in element.materials
                ]
            })

        return output

    def extract_quantities(
        self,
        file_path: str,
        categories: Optional[List[ElementCategory]] = None
    ) -> Dict[str, Any]:
        """Extract quantity takeoff from CAD file"""
        file_format = self._detect_format(file_path)

        if file_format == CADFormat.IFC:
            result = self.ifc_extractor.extract(file_path, categories)
        else:
            result = self.dwg_extractor.extract(file_path)

        # Aggregate quantities by category
        quantities = {}
        for element in result.elements:
            cat = element.category.value
            if cat not in quantities:
                quantities[cat] = {
                    "count": 0,
                    "totals": {}
                }

            quantities[cat]["count"] += 1

            for qty_name, qty_value in element.quantities.items():
                if qty_name not in quantities[cat]["totals"]:
                    quantities[cat]["totals"][qty_name] = 0
                quantities[cat]["totals"][qty_name] += qty_value

        return {
            "file": file_path,
            "quantities": quantities,
            "summary": {
                "total_elements": result.total_elements,
                "categories": list(quantities.keys())
            }
        }

    def extract_schedule(
        self,
        file_path: str,
        category: ElementCategory,
        fields: List[str]
    ) -> List[Dict]:
        """Extract schedule data for specific category"""
        file_format = self._detect_format(file_path)

        if file_format == CADFormat.IFC:
            result = self.ifc_extractor.extract(file_path, [category])
        else:
            result = self.dwg_extractor.extract(file_path)

        schedule = []
        for element in result.elements:
            if element.category == category:
                row = {"id": element.id, "name": element.name, "type": element.type_name}

                for field in fields:
                    if field in element.properties:
                        row[field] = element.properties[field]
                    elif field in element.quantities:
                        row[field] = element.quantities[field]

                schedule.append(row)

        return schedule

    def export_to_json(
        self,
        result: CADExtractionResult,
        output_path: str
    ):
        """Export extraction result to JSON file"""
        output = self._format_output(result, "json")

        with open(output_path, 'w') as f:
            json.dump(output, f, indent=2)

    def generate_report(self, result: CADExtractionResult) -> str:
        """Generate extraction report"""
        report = f"""
# CAD Extraction Report

**File:** {result.file_path}
**Format:** {result.file_format.value}
**Total Elements:** {result.total_elements}
**Extraction Time:** {result.extraction_time:.2f}s

## Elements by Category
"""
        for cat, count in result.categories.items():
            report += f"- **{cat.title()}:** {count}\n"

        if result.levels:
            report += "\n## Levels\n"
            for level in result.levels:
                report += f"- {level}\n"

        if result.layers:
            report += "\n## Layers\n"
            for layer in result.layers:
                report += f"- {layer.name}: {layer.element_count} elements\n"

        return report

Common Use Cases

Extract IFC Data

converter = CADDataConverter()

# Convert IFC to structured data
data = converter.convert("building.ifc", output_format="json")

print(f"Total elements: {data['total_elements']}")
print(f"Categories: {data['categories']}")

# Access elements
for element in data['elements'][:5]:
    print(f"  {element['name']}: {element['type']}")

Extract Quantities

quantities = converter.extract_quantities(
    "building.ifc",
    categories=[ElementCategory.WALL, ElementCategory.FLOOR]
)

print(f"Wall count: {quantities['quantities']['wall']['count']}")
print(f"Total wall area: {quantities['quantities']['wall']['totals']['Area']}")

Generate Schedule

door_schedule = converter.extract_schedule(
    "building.ifc",
    category=ElementCategory.DOOR,
    fields=["Width", "Height", "FireRating", "IsExternal"]
)

for door in door_schedule:
    print(f"{door['name']}: {door.get('Width')}x{door.get('Height')}")

Generate Report

ifc_extractor = IFCExtractor()
result = ifc_extractor.extract("building.ifc")

report = converter.generate_report(result)
print(report)

Quick Reference

ComponentPurpose
CADDataConverterMain conversion engine
IFCExtractorIFC file extraction
DWGExtractorDWG/DXF extraction
CADElementExtracted element data
CADExtractionResultComplete extraction result
ElementCategoryBIM element categories

Resources

Next Steps

平台分布

Codex

32.84%
按下载量换算374

Claude

31.67%
按下载量换算361

Cursor

20.56%
按下载量换算234

Gemini CLI

9.65%
按下载量换算110

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills