Home > IPCB_PrimitiveArc > getState_PrimitiveId
IPCB_PrimitiveArc.getState_PrimitiveId() method
Get the property state: primitive ID
Signature
typescript
function getState_PrimitiveId(): string;1
Returns
string
Primitive ID
Example
javascript
// 1. 创建一段测试圆弧
const arc = await eda.pcb_PrimitiveArc.create('', 1, 1000, 1000, 1500, 1300, 90, 10, 1, false);
// 2. 读取图元 ID
const primitiveId = arc.getState_PrimitiveId();
// 3. 用该 ID 从画布重新取回圆弧,验证 ID 有效
const refetched = await eda.pcb_PrimitiveArc.get(primitiveId);
// 4. 清理测试图元(查询类案例不留测试对象)
await eda.pcb_PrimitiveArc.delete([primitiveId]);
console.log('primitiveId:', primitiveId);
console.log('refetched type:', refetched.getState_PrimitiveType());1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14