Home > ISCH_PrimitiveComponent > getState_PrimitiveId
ISCH_PrimitiveComponent.getState_PrimitiveId() method
Get the property state: primitive ID
Signature
typescript
function getState_PrimitiveId(): string;1
Returns
string
Primitive ID
Example
javascript
// 1. 放置一个测试器件(SCH 坐标单位 10mil)
const devices = await eda.lib_Device.search('C0402');
const comp = await eda.sch_PrimitiveComponent.create(devices[0], 600, 600);
// 2. 读取图元 ID
const compId = comp.getState_PrimitiveId();
// 3. 清理测试器件(查询类需要清理)
await eda.sch_PrimitiveComponent.delete([compId]);
console.log('compId:', compId);1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11