Home > ISCH_PrimitiveComponent > getState_PrimitiveType
ISCH_PrimitiveComponent.getState_PrimitiveType() method
获取属性状态:图元类型
签名
typescript
public getState_PrimitiveType(): ESCH_PrimitiveType;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. 读取图元类型(器件图元为 'Component')
const primitiveType = comp.getState_PrimitiveType();
// 3. 清理测试器件(查询类需要清理)
await eda.sch_PrimitiveComponent.delete([compId]);
console.log('primitiveType:', primitiveType);1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12