Home > IPCB_PrimitivePad > getState_SpecialPad
IPCB_PrimitivePad.getState_SpecialPad() method
Get the property state: special pad shape
Signature
typescript
function getState_SpecialPad(): TPCB_PrimitiveSpecialPadShape | undefined;1
Returns
TPCB_PrimitiveSpecialPadShape | undefined
Special pad shape
Example
javascript
// 1. 生成本次运行专用的坐标,创建普通焊盘与创建时尝试带特殊外形的焊盘
const x = 3000 + Math.floor(Math.random() * 100000);
const plain = await eda.pcb_PrimitivePad.create(1, '1', x, 3000, 0, ['ELLIPSE', 60, 60], '', null, 0, 0, 0, false, 0);
const attempted = await eda.pcb_PrimitivePad.create(1, '2', x + 500, 3000, 0, ['ELLIPSE', 60, 60], '', null, 0, 0, 0, false, 0, [[1, 1, ['ELLIPSE', 40, 40]]]);
// 2. 分别读取特殊焊盘外形
const plainSpecial = plain.getState_SpecialPad();
const attemptedSpecial = attempted.getState_SpecialPad();
// 3. 清理测试图元(查询类案例不留测试对象)
await eda.pcb_PrimitivePad.delete([plain.getState_PrimitiveId(), attempted.getState_PrimitiveId()]);
console.log('plainSpecial:', plainSpecial);
console.log('attemptedSpecial:', attemptedSpecial);
console.log('normalShapeKept:', JSON.stringify(attempted.getState_Pad()) === JSON.stringify(['ELLIPSE', 60, 60]));1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15