> **本文回答**：编辑实体走两条路：① 直接用 `EntityBase.move/rotate/scale/mirror`（**记得 `Engine.regen()`**）；② 通过命令 `MOVE / COPY / ROTATE / SCALE / MIRROR / ERASE / OFFSET / FILLET / STRETCH / LINEARCOPY / POLARCOPY / GROUP / UNGROUP` 等。删除推荐 `Engine.eraseEntities(...)`，高亮推荐 `Engine.highLightEntities(...) / Engine.clearHighLight()`。

## 一、按子主题挑

| 想做的 | 子主题 |
|---|---|
| 移动 / 复制 | [move-copy](move-copy.md) |
| 旋转 / 缩放 | [rotate-scale](rotate-scale.md) |
| 镜像 | [mirror](mirror.md) |
| 删除 | [erase](erase.md) |
| 显示顺序（前/后/图层） | [draw-order](draw-order.md) |
| 组（Group / Ungroup / Explode） | [group](group.md) |
| 高亮 / 清除高亮 | [highlight](highlight.md) |

## 二、`EntityBase` 通用变换签名

```js
ent.move(from: Point2D | [number, number], to: Point2D | [number, number]): void;
ent.rotate(center: Point2D, angle: number /* 弧度 */): void;
ent.scale(basePoint: Point2D, factor: number): void;
ent.mirror(p1: Point2D, p2: Point2D): void;
ent.clone(): EntityBase;
```

> **注意**：示例里的 `move(from, to)` 与文档里的 `move(dx, dy)` 命名不同。**实战按示例来用 `(from, to)`**——示例真的能跑（`vjcad/example/edit/01move.js`）。

## 三、命令版（与 AutoCAD 兼容）

| 命令 | 别名 | 说明 |
|---|---|---|
| `MOVE` | `M` | 移动 |
| `COPY` | `CO` | 复制（⚠️ `CP` 未注册，别名表只有 `CO`；`E`→`ERASE` 也已注册） |
| `ROTATE` | `RO` | 旋转 |
| `SCALE` | `SC` | 缩放 |
| `MIRROR` | `MI` | 镜像 |
| `ERASE` | — | 删除 |
| `STRETCH` | `S` | 拉伸 |
| `OFFSET` | `O` | 偏移 |
| `FILLET` | `F` | 圆角 |
| `LINEARCOPY` | — | 线性阵列复制 |
| `POLARCOPY` | — | 环形阵列复制 |
| `COPYBASE` / `PASTECLIP` | — | 带基点复制 / 粘贴 |
| `ENTDRAWFRONT` / `ENTDRAWBACK` | — | 实体置前 / 置后 |
| `LAYDRAWFRONT` / `LAYDRAWBACK` | — | 图层整体置前 / 置后 |
| `GROUP` / `UNGROUP` | — | 创建组 / 取消组 |

通过 `Engine.editor.executerWithOp('MOVE')` 等触发，或在 `Engine.editor.automate()` 脚本中使用。详见 [command/execute-script](../command/execute-script.md)。

## 四、关键 Tips

1. `move/rotate/scale/mirror` 只改数据 + 标记 `isDirty`，**不会自动重绘**，必须手动 `Engine.regen()`。
2. `Engine.eraseEntities(ent)` 会自动 undo + 标记 `isAlive = false`。
3. 高亮 `Engine.highLightEntities([...])` 是临时视觉效果，不影响实体属性。

## 参考（官方文档 MCP）

- 文档：`vjcad/doc/edit/index.md`、`vjcad/doc/edit/edit-commands.md`
- 示例：`vjcad/example/edit/01move.js` ~ `09highlight.js`
