Home > IPCB_PrimitivePoured > getState_PrimitiveId
IPCB_PrimitivePoured.getState_PrimitiveId() method
获取属性状态:图元 ID
签名
typescript
function getState_PrimitiveId(): 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 primitiveId = poured.getState_PrimitiveId();
console.log('primitiveId:', primitiveId);
// 3. 用该 ID 通过管理类重新读取,验证 ID 有效
const again = await eda.pcb_PrimitivePoured.get(primitiveId);
console.log('按 ID 重新读取:', again ? '成功' : '未找到');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