Home > IPCB_PrimitivePoured > reset
IPCB_PrimitivePoured.reset() method
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Reset the async primitive to the current canvas state
Signature
typescript
function reset(): Promise<IPCB_PrimitivePoured>;1
Returns
Promise<IPCB_PrimitivePoured>
Copper fill primitive object
Example
javascript
// 1. 获取画布上已有的覆铜填充图元
const pouredList = await eda.pcb_PrimitivePoured.getAll();
if (!pouredList || pouredList.length === 0) {
console.log('说明:PCB 上没有覆铜填充,请先手动绘制覆铜并重建(设计 → 覆铜)');
return;
}
const poured = pouredList[0];
// 2. 记录重置前的子区域数量
const before = poured.getState_PourFills().length;
// 3. 重置为当前画布状态(丢弃未提交的修改)
const resetResult = await poured.reset();
// 4. 重置返回的对象仍可正常读取状态
const after = resetResult.getState_PourFills().length;
console.log('pourFillCount:', before, '→', after);
console.log('primitiveType:', resetResult.getState_PrimitiveType());1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18