Home > ISCH_PrimitiveComponent > getAllPins
ISCH_PrimitiveComponent.getAllPins() 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 pins associated with the device
Signature
typescript
function getAllPins(): Promise<Array<ISCH_PrimitiveComponentPin> | undefined>;1
Returns
Promise<Array<ISCH_PrimitiveComponentPin> | undefined>
Device pin primitive array
Example
javascript
// 1. 放置一个测试器件(C0402 电容有两个引脚,SCH 坐标单位 10mil)
const devices = await eda.lib_Device.search('C0402');
const comp = await eda.sch_PrimitiveComponent.create(devices[0], 600, 600);
const compId = comp.getState_PrimitiveId();
// 2. 获取器件全部引脚(C0402 电容返回 2 个引脚图元)
const pins = await comp.getAllPins();
// 3. 清理测试器件(查询类需要清理)
await eda.sch_PrimitiveComponent.delete([compId]);
console.log('pinCount:', pins.length);1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12