Home > IPCB_PrimitivePad > setState_SpecialPad
IPCB_PrimitivePad.setState_SpecialPad() 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.
Set the property state: special pad shape
Signature
typescript
function setState_SpecialPad(specialPad: TPCB_PrimitiveSpecialPadShape): IPCB_PrimitivePad;1
Parameters
Parameter | Type | Description |
|---|---|---|
specialPad |
Returns
Pad primitive object
Remarks
When setting the special pad shape, some other property states will be set in conjunction:
- The pad shape property will be cleared
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. 调用设置接口(当前版本不产生任何效果)
pad.setState_SpecialPad([[1, 1, ['ELLIPSE', 40, 40]]]);
// 3. 读取确认特殊外形未生效、普通外形保持不变
const special = pad.getState_SpecialPad();
const normalShape = pad.getState_Pad();
console.log('specialPadApplied:', special !== undefined);
console.log('normalShapeKept:', JSON.stringify(normalShape) === JSON.stringify(['ELLIPSE', 60, 60]));1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13