Home > ISCH_PrimitiveCircle > isAsync
ISCH_PrimitiveCircle.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 circle = await eda.sch_PrimitiveCircle.create(400, 300, 150);
const asyncOnCreate = circle.isAsync();
// 2. 切换到同步模式再查询一次,对比两种模式
circle.toSync();
const asyncAfterToSync = circle.isAsync();
// 3. 清理测试图元(查询类案例不留测试对象)
await eda.sch_PrimitiveCircle.delete([circle.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