Home > IPCB_PrimitivePoured > deletePourFills
IPCB_PrimitivePoured.deletePourFills() 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.
Delete Copper fill region
Signature
typescript
function deletePourFills(
pourFillIds: IPCB_PrimitivePouredPourFill['id'] | Array<IPCB_PrimitivePouredPourFill['id']>,
): Promise<boolean>;1
2
3
2
3
Parameters
Parameter | Type | Description |
|---|---|---|
pourFillIds | IPCB_PrimitivePouredPourFill['id'] | Array<IPCB_PrimitivePouredPourFill['id']> | Copper fill region ID |
Returns
Promise<boolean>
Delete Whether the operation is successful
Example
javascript
// 1. 获取画布上已有的覆铜填充图元
const pouredList = await eda.pcb_PrimitivePoured.getAll();
if (!pouredList || pouredList.length === 0) {
console.log('说明:PCB 上没有覆铜填充,请先手动绘制覆铜并重建(设计 → 覆铜)');
return;
}
const poured = pouredList[0];
// 2. 取填充子区域列表(本方法按 pourFillId 定位,不是图元 ID)
const pourFills = poured.getState_PourFills();
if (pourFills.length === 0) {
console.log('说明:该覆铜填充没有子区域');
return;
}
console.log('删除前子区域数量:', pourFills.length);
// 3. 删除第一个子区域(传单个 ID;也可以传 ID 数组批量删除)
const deleted = await poured.deletePourFills(pourFills[0].id);
// 4. 从画布重新读取,确认删除结果
const refreshed = await eda.pcb_PrimitivePoured.get(poured.getState_PrimitiveId());
const after = refreshed ? refreshed.getState_PourFills().length : 0;
console.log('deleted:', deleted);
console.log('删除后子区域数量:', after);1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24