Home > IPCB_PrimitiveComponent > getState_Component
IPCB_PrimitiveComponent.getState_Component() method
获取属性状态:关联库器件
签名
typescript
function getState_Component():
{ libraryUuid: string; uuid: string; name?: undefined | string } | undefined;1
2
2
返回值
{ libraryUuid: string; uuid: string; name?: undefined | string } | undefined
关联库器件
示例
javascript
// 1. 放置一个测试器件
const devices = await eda.lib_Device.search('C0402');
const comp = await eda.pcb_PrimitiveComponent.create(devices[0], 1, 5000, 5000);
// 2. 读取关联的库器件信息
const component = comp.getState_Component();
// 3. 清理测试器件
await eda.pcb_PrimitiveComponent.delete([comp.getState_PrimitiveId()]);
console.log('deviceName:', component.name);
console.log('deviceUuid:', component.uuid);
console.log('libraryUuid:', component.libraryUuid);1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13