Files
cad-agent/ai.memory/reference_environment.md
T
gjm e25aa0a650 chore(memory): 新增 ai.memory 记忆库
- MEMORY.md 索引 + 分主题记忆文件
- project: 图纸审查 Agent 工作汇总
- feedback: 协作偏好(含 Git 推送规则:refs/for/main 触发 Gitea PR)
- reference: 环境与外部资源
2026-10-09 09:43:21 +08:00

59 lines
2.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
name: 环境与外部资源
description: CadProject 的构建/运行要点、CAD SDK 路径、测试脚本等外部资源指引
type: reference
---
# 环境与外部资源
## 构建
- 系统:**CMake + vcpkg + Visual Studio 生成器**,通过 CMake Presets 区分 CAD 版本。
- 产物:`bin/<Config>-<TAG>/` 与 `lib/<Config>-<TAG>/`。
- 命令:`cmake --preset R230` → `cmake --build --preset R230 --config Debug`。
- 可用 preset:`R180`–`R260`(AutoCAD,ARX 18–26)、`Z2023`–`Z2026`(ZWCAD,ZRX)。
- 前置:需要 `VCPKG_ROOT`;必需 cache 变量 `CAD_SDK_ROOT`、`DEP_LIB_ROOT`、`DEP_INC_ROOT`、
`CAD_SDK_VERSION`(AutoCAD 还需 `CAD_SDK_SUBVERSION`)。
## CAD SDK 路径
- AutoCAD:仓库同级 `../envi-code/Arx`
- ZWCAD:仓库同级 `../envi-code/Zrx`
- 在 `cmakepresets.json` 的 `CAD_SDK_ROOT` 中配置。
## 运行 / 联调
- 先启动 **已加载插件的 CAD**,确认 `127.0.0.1:8080` 在监听。
- 脚本通过 TCP 连接 `127.0.0.1:8080` 收发 JSON-RPC。
## 测试脚本(根目录,非单元测试)
| 脚本 | 作用 |
| --- | --- |
| `test.py` | 截图 → 发 DeepSeek 视觉模型 → 回答 |
| `test_autoagent.py` | 拉一次视口截图存 `test_screenshot.png` |
| `countOfCircle.py` | 伪造 `zoom_window_normalized` 调用,验证 TCP 链路 |
| `agent_loop.py` | 完整 Agent 循环(多回合),需 openai 包与 API Key |
## 两个构建目标
| 目标 | 产物 | 作用 |
| --- | --- | --- |
| `src/cad_mcp_frame` | `cad_mcp_frame.arx`(ZWCAD 下 `.zrx`) | MCP **基座**:起 TCP、解析配置、路由执行 |
| `src/cad_mcp_plugins` | `cad_mcp_plugins.dll` | 示例 **C++ 工具插件**,ABI 动态加载 |
## 三种工具后端(`backend.type`)
- `lisp_inline`:`{占位符}` 替换后 `sendStringToExecute`(**异步**)。
- `lisp_file`:`(load "文件" nil)` 后执行 `call_template`。
- `c++_dll`:`LoadLibrary` + `acrxGetApiVersion` 版本校验 + 工厂/销毁函数(**同步**,可返回图像)。
## 远程仓库
- 现状(2026-10-08 起):`CadProject` 已从「某仓库的子目录」**独立为单独仓库**。
- `origin` = `ssh://git@39.107.55.179:222/gjm/cad-agent.git`
- 当前分支 `home-ai-dev`;服务器只保留 `main`,采用 **PR 流程**
(`home-ai-dev` → `main`,合并后源分支被删除,故本地 `home-ai-dev` 的 upstream 显示 `[gone]`)。
- 历史已被重写/重新初始化(哈希全新)。
- 历史参考(旧):`new-start.git` = `ssh://gjm@47.93.46.28:1216/srv/git/new-start.git`