Home > PCB_Document > save
PCB_Document.save() method
保存文档
签名
typescript
function save(): Promise<boolean>;1
返回值
Promise<boolean>
保存操作是否成功,保存失败、上传失败等错误均返回 false
备注
在 headless / 无头环境下,本接口可能返回 true 但实际未真正落盘(如网络 / 上传链路异常), 对落盘结果敏感的流程应通过 文件系统接口 二次核验
示例
javascript
// 1. 创建测试 PCB 并打开(保存作用于当前激活的 PCB)
const pcbUuid = await eda.dmt_Pcb.createPcb();
await new Promise(r => setTimeout(r, 1500));
await eda.dmt_EditorControl.openDocument(pcbUuid);
await new Promise(r => setTimeout(r, 1000));
// 2. 保存当前 PCB
const saved = await eda.pcb_Document.save();
console.log('saved:', saved);
// 3. 清理测试 PCB
await eda.dmt_Pcb.deletePcb(pcbUuid);1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12