Home > IPCB_PrimitivePad > isAsync
IPCB_PrimitivePad.isAsync() method
查询图元是否为异步图元
签名
typescript
function isAsync(): boolean;1
返回值
boolean
是否为异步图元
示例
javascript
// 1. 在顶层放置一个圆形贴片焊盘
const x = 3000 + Math.floor(Math.random() * 100000);
const pad = await eda.pcb_PrimitivePad.create(1, '1', x, 3000, 0, ['ELLIPSE', 60, 60], '', null, 0, 0, 0, false, 0);
// 2. 读取创建后的模式
const afterCreate = pad.isAsync();
// 3. 切换模式再各读一次
const afterToSync = pad.toSync().isAsync();
const afterToAsync = pad.toAsync().isAsync();
// 4. 清理测试图元(查询类案例不留测试对象)
await eda.pcb_PrimitivePad.delete([pad.getState_PrimitiveId()]);
console.log('afterCreate:', afterCreate);
console.log('afterToSync:', afterToSync);
console.log('afterToAsync:', afterToAsync);1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17