Home > IPCB_PrimitivePoured > addSolderMaskFill
IPCB_PrimitivePoured.addSolderMaskFill() 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.
Add: solder mask region
Signature
typescript
function addSolderMaskFill(
pourFillId: IPCB_PrimitivePouredPourFill['id'],
): Promise<IPCB_PrimitiveFill | undefined>;1
2
3
2
3
Parameters
Parameter | Type | Description |
|---|---|---|
pourFillId |
Returns
Promise<IPCB_PrimitiveFill | undefined>
The solder mask region fill primitive object. If conversion fails or the ID is incorrect, undefined is returned
Example
javascript
// 1. 获取画布上已有的覆铜填充图元
const pouredList = await eda.pcb_PrimitivePoured.getAll();
if (!pouredList || pouredList.length === 0) {
console.log('说明:PCB 上没有覆铜填充,请先手动绘制覆铜并重建(设计 → 覆铜)');
return;
}
const poured = pouredList[0];
// 2. 取第一个填充子区域的 ID(本方法按 pourFillId 定位,不是图元 ID)
const pourFills = poured.getState_PourFills();
if (pourFills.length === 0) {
console.log('说明:该覆铜填充没有子区域');
return;
}
// 3. 为该子区域添加阻焊区域(保留现场供观察)
const solderMaskFill = await poured.addSolderMaskFill(pourFills[0].id);
// 4. 输出生成的阻焊填充图元信息
if (solderMaskFill) {
console.log('primitiveType:', solderMaskFill.getState_PrimitiveType());
console.log('primitiveId:', solderMaskFill.getState_PrimitiveId());
} else {
console.log('说明:未能生成阻焊区域(返回 undefined)');
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25