Home > IPCB_PrimitiveVia > done
IPCB_PrimitiveVia.done() method
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Apply the changes to the primitives to the canvas
Signature
typescript
function done(): Promise<IPCB_PrimitiveVia>;1
Returns
Promise<IPCB_PrimitiveVia>
Via primitive object
Example
javascript
// 1. 生成本次运行专用的坐标,放置一个孔径 20mil、外径 40mil 的测试过孔
const x = 3000 + Math.floor(Math.random() * 100000);
const via = await eda.pcb_PrimitiveVia.create('', x, 3000, 20, 40);
// 2. 异步模式下连续修改外径和挂网络(此时画布尚未变化)
const a = via.toAsync();
a.setState_Diameter(60);
a.setState_Net('GND');
// 3. 一次性提交到画布
await a.done();
// 4. 从画布重新读取,确认两处修改都已生效(保留现场供观察)
const ref = await eda.pcb_PrimitiveVia.get(via.getState_PrimitiveId());
console.log('diameter:', 40, '→', ref.getState_Diameter());
console.log('net:', '', '→', ref.getState_Net());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