Home > ISCH_PrimitiveComponent > getState_ComponentType
ISCH_PrimitiveComponent.getState_ComponentType() method
获取属性状态:器件类型
签名
typescript
function getState_ComponentType(): ESCH_PrimitiveComponentType;1
返回值
器件类型
示例
javascript
// 1. 放置一个测试器件(普通元件,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. 读取器件类型(普通元件为 'part')
const componentType = comp.getState_ComponentType();
// 3. 清理测试器件(查询类需要清理)
await eda.sch_PrimitiveComponent.delete([compId]);
console.log('componentType:', componentType);1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12