Home > ISCH_PrimitiveWire > toSync
ISCH_PrimitiveWire.toSync() method
Convert Primitive to Sync primitive
Signature
typescript
function toSync(): ISCH_PrimitiveWire;1
Returns
Wire primitive object
Example
javascript
// 1. 创建一条测试导线(创建后默认处于异步模式)
const wire = await eda.sch_PrimitiveWire.create([1000, 1000, 1400, 1000]);
// 2. 转换为同步图元,isAsync() 变为 false
const syncWire = wire.toSync();
const isAsyncAfterToSync = syncWire.isAsync();
// 3. 清理测试图元(本案例只演示模式转换,不修改画布)
await eda.sch_PrimitiveWire.delete([wire.getState_PrimitiveId()]);
console.log('isAsync after toSync:', isAsyncAfterToSync);1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11