Home > IPCB_PrimitivePad > create
IPCB_PrimitivePad.create() method
此 API 当前处于 BETA 预览状态,希望得到开发者的反馈。它的任何功能都可能在接下来的开发进程中被修改,请不要将它用于任何正式环境。
在 PCB 画布中创建图元
签名
typescript
function create(): Promise<IPCB_PrimitivePad>;1
返回值
Promise<IPCB_PrimitivePad>
焊盘图元对象
示例
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