Home > ISCH_PrimitiveRectangle > isAsync
ISCH_PrimitiveRectangle.isAsync() method
Query whether the primitive is an async primitive
Signature
typescript
function isAsync(): boolean;1
Returns
boolean
Whether Is async primitive
Example
javascript
// 1. 创建一个测试矩形,创建后默认处于异步模式
const rect = await eda.sch_PrimitiveRectangle.create(400, 300, 200, 100);
const asyncOnCreate = rect.isAsync();
// 2. 切换到同步模式再查询一次,对比两种模式
rect.toSync();
const asyncAfterToSync = rect.isAsync();
// 3. 清理测试图元(查询类案例不留测试对象)
await eda.sch_PrimitiveRectangle.delete([rect.getState_PrimitiveId()]);
console.log('isAsync on create:', asyncOnCreate);
console.log('isAsync after toSync:', asyncAfterToSync);1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13