Home > ISCH_PrimitiveComponent > isAsync
ISCH_PrimitiveComponent.isAsync() method
查询图元是否为异步图元
签名
typescript
function isAsync(): boolean;1
返回值
boolean
是否为异步图元
示例
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. 查询创建后的默认模式(新创建的图元默认为异步)
const isAsyncOnCreate = comp.isAsync();
// 3. 转为同步后再查一次,对比两种模式
const syncComp = comp.toSync();
const isAsyncAfterToSync = syncComp.isAsync();
// 4. 清理测试器件(查询类需要清理)
await eda.sch_PrimitiveComponent.delete([compId]);
console.log('isAsync on create:', isAsyncOnCreate);
console.log('isAsync after toSync:', isAsyncAfterToSync);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