Home > IPCB_PrimitivePad > done
IPCB_PrimitivePad.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_PrimitivePad>;1
Returns
Promise<IPCB_PrimitivePad>
Dimension primitive object
Example
javascript
// 1. 生成本次运行专用的坐标,在顶层放置一个圆形贴片焊盘
const x = 3000 + Math.floor(Math.random() * 100000);
const pad = await eda.pcb_PrimitivePad.create(1, '1', x, 3000, 0, ['ELLIPSE', 60, 60], '', null, 0, 0, 0, false, 0);
// 2. 异步模式下连续修改旋转和编号(此时画布尚未变化)
const a = pad.toAsync();
a.setState_Rotation(90);
a.setState_PadNumber('嘉立创示例_A1');
// 3. 一次性提交到画布
await a.done();
// 4. 从画布重新读取,确认两处修改都已生效(保留现场供观察)
const ref = await eda.pcb_PrimitivePad.get(pad.getState_PrimitiveId());
console.log('rotation:', ref.getState_Rotation());
console.log('padNumber:', ref.getState_PadNumber());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