Home > IPCB_PrimitiveVia > getState_ViaType
IPCB_PrimitiveVia.getState_ViaType() method
获取属性状态:过孔类型
签名
typescript
function getState_ViaType(): EPCB_PrimitiveViaType;1
返回值
过孔类型
示例
javascript
// 1. 生成本次运行专用的坐标,放置一个通孔类型的测试过孔
const x = 3000 + Math.floor(Math.random() * 100000);
const via = await eda.pcb_PrimitiveVia.create('', x, 3000, 20, 40);
const before = via.getState_ViaType();
// 2. 把第二个过孔切换为缝合孔类型后读取对比
const suture = await eda.pcb_PrimitiveVia.create('', x + 500, 3000, 20, 40);
const a = suture.toAsync();
a.setState_ViaType(2);
await a.done();
const sutureType = suture.getState_ViaType();
// 3. 清理测试图元(查询类案例不留测试对象)
await eda.pcb_PrimitiveVia.delete([via.getState_PrimitiveId(), suture.getState_PrimitiveId()]);
console.log('viaType:', before, '→', sutureType);1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16