Home > IPCB_PrimitivePad > create
IPCB_PrimitivePad.create() 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.
In PCB canvas in create primitive
Signature
typescript
function create(): Promise<IPCB_PrimitivePad>;1
Returns
Promise<IPCB_PrimitivePad>
Pad primitive object
Example
javascript
// 1. 生成本次运行专用的坐标,在顶层放置一个圆形贴片焊盘(直径 60mil)
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. 读取创建结果,确认层、编号与外形(保留现场供画布观察)
console.log('created:', !!pad);
console.log('layer:', pad.getState_Layer());
console.log('padNumber:', pad.getState_PadNumber());
console.log('padShape:', pad.getState_Pad());1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9