Home > IPCB_PrimitivePoured > getState_PourPrimitiveId
IPCB_PrimitivePoured.getState_PourPrimitiveId() method
获取属性状态:覆铜边框图元 ID
签名
typescript
function getState_PourPrimitiveId(): string;1
返回值
string
覆铜边框图元 ID
示例
javascript
// 1. 获取画布上已有的覆铜填充图元
const pouredList = await eda.pcb_PrimitivePoured.getAll();
if (!pouredList || pouredList.length === 0) {
console.log('说明:PCB 上没有覆铜填充,请先手动绘制覆铜并重建(设计 → 覆铜)');
return;
}
const poured = pouredList[0];
// 2. 读取关联的覆铜边框图元 ID
const pourPrimitiveId = poured.getState_PourPrimitiveId();
console.log('pourPrimitiveId:', pourPrimitiveId);
// 3. 用该 ID 反查覆铜边框,验证关联有效
const pour = await eda.pcb_PrimitivePour.get(pourPrimitiveId);
console.log('对应覆铜边框:', pour ? pour.getState_PourName() : '(边框已被删除)');1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15