Metadata-Version: 2.4
Name: catia-v5-com
Version: 0.1.1
Summary: CATIA V5 COM 便捷函数层 — 封装 CATIA Automation API
Author: terry
License: MIT
Project-URL: Homepage, https://github.com/terry-0522/catia-com
Project-URL: Repository, https://github.com/terry-0522/catia-com
Project-URL: Issues, https://github.com/terry-0522/catia-com/issues
Keywords: catia,cad,automation,com
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: pywin32
Provides-Extra: excel
Requires-Dist: openpyxl; extra == "excel"
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"

# catia-com

CATIA V5 COM 便捷函数层 — 基于 `pywin32` 封装 CATIA Automation API，提供 Pythonic 的调用接口。

## 安装

```bash
pip install -e .

# 如需 Excel 导入导出功能
pip install -e ".[excel]"

# 开发模式（含 pytest）
pip install -e ".[dev]"
```

Python ≥ 3.10，仅依赖 `pywin32`。

## 快速开始

```python
from catia import get_app, get_part, create_sketch, draw_rectangle, create_pad

# 连接到运行中的 CATIA
app = get_app()

# 获取当前 Part 文档
part = get_part()

# 创建草图
plane = part.OriginElements.PlaneXY
sketch = create_sketch(part, plane)

# 绘制矩形并拉伸
with sketch_edition(sketch, part) as factory:
    draw_rectangle(factory, 0, 0, 100, 50)
create_pad(part, sketch, 20)
```

## 模块

| 模块 | 功能 |
|---|---|
| `connection` | COM 连接管理，获取 Application/Part/Document |
| `collections` | 1-based COM 集合 → 0-based Pythonic 包装 |
| `selection` | 交互式选择对象 |
| `measurement` | 长度、距离、包围盒、惯性、重心 |
| `geometry` | 曲线布点、参考面/对象、草图创建 |
| `shape_factory` | 实体特征：Pad/Pocket/Fillet/Chamfer 等 |
| `sketch_drawing` | 2D 绘图：线/矩形/圆/弧/样条 |
| `sketch_constraints` | 2D 约束：距离/角度/相切/同心/对称等 |
| `gsd` | 曲面造型：点/线/面/扫掠/放样/修剪/接合 |
| `assembly` | 装配：添加组件、配合约束、装配树遍历 |
| `export` | 导出 STEP/IGES/STL + 截图 |
| `rules` | Knowledgeware 规则生成 |
| `excel_integration` | Excel 点坐标导入导出（需 openpyxl） |
| `boolean_operations` | 布尔运算（联合/移除/相交） + Body 管理 |
| `parameters` | 参数创建/读写/公式/批量设值/枚举值 |
| `document` | 文档创建/打开/保存/关闭 + 上下文管理器 |
| `properties` | 对象可见性控制（show/hide/is_visible） |
| `search` | Selection.Search 封装（按类型/按名称搜索） |
| `design_table` | 设计表创建/切换配置 |
| `powercopy` | PowerCopy 实例化（上下文管理器 + 参数设置） |
