Home > SCH_Document > save
SCH_Document.save() method
Save Document
Signature
typescript
function save(): Promise<boolean>;1
Returns
Promise<boolean>
Whether the save operation was successful. Errors such as save failure and upload failure all return false
Remarks
在 headless / 无头环境下,本接口可能返回 true 但实际未真正落盘(如网络 / 上传链路异常), 对落盘结果敏感的流程应通过 文件系统接口 二次核验
Example
javascript
// 1. 创建测试原理图并打开(保存作用于当前激活的原理图,openDocument 传图页级 UUID)
const schematicUuid = await eda.dmt_Schematic.createSchematic();
await new Promise(r => setTimeout(r, 1500));
const schInfo = await eda.dmt_Schematic.getSchematicInfo(schematicUuid);
await eda.dmt_EditorControl.openDocument(schInfo.page[0].uuid);
await new Promise(r => setTimeout(r, 1000));
// 2. 保存当前原理图
const saved = await eda.sch_Document.save();
console.log('saved:', saved);
// 3. 清理测试原理图(删除前等 1.5s 让保存变更同步落地)
await new Promise(r => setTimeout(r, 1500));
await eda.dmt_Schematic.deleteSchematic(schematicUuid);1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14