Home > PCB_PrimitivePoured > getAllPrimitiveId
PCB_PrimitivePoured.getAllPrimitiveId() 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.
Get all Copper fill primitive IDs
Signature
typescript
function getAllPrimitiveId(): Promise<Array<string>>;1
Returns
Promise<Array<string>>
Array of Copper fill primitive IDs
Example
javascript
// 1. 获取画布上全部覆铜填充的图元 ID
const ids = await eda.pcb_PrimitivePoured.getAllPrimitiveId();
if (!ids || ids.length === 0) {
console.log('说明:PCB 上没有覆铜填充,请先手动绘制覆铜并重建(设计 → 覆铜)');
return;
}
// 2. 任取一个 ID 反查覆铜填充对象,验证列表有效
const poured = await eda.pcb_PrimitivePoured.get(ids[0]);
console.log('total poured ids:', ids.length);
console.log('refetched primitiveType:', poured.getState_PrimitiveType());1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12