Home > PCB_Drc > modifyDifferentialPairName
PCB_Drc.modifyDifferentialPairName() 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.
Modify the name of the differential pair
Signature
typescript
function modifyDifferentialPairName(
originalDifferentialPairName: string,
differentialPairName: string,
): Promise<boolean>;1
2
3
4
2
3
4
Parameters
Parameter | Type | Description |
|---|---|---|
originalDifferentialPairName | string | Original differential pair name |
differentialPairName | string | New differential pair name |
Returns
Promise<boolean>
Whether the operation is successful
Example
javascript
// 1. 生成本次运行专用的网络名和差分对名(网络不能属于其他差分对)
const ts = Date.now();
const netP = `JLC_DEMO_DP_P_${ts}`;
const netN = `JLC_DEMO_DP_N_${ts}`;
// 2. 放带差分网络的焊盘并创建差分对
const x = 3000 + Math.floor(Math.random() * 20000);
await eda.pcb_PrimitivePad.create(1, '1', x, 3000, 0, ['ELLIPSE', 60, 60], netP, null, 0, 0, 0, false, 0);
await eda.pcb_PrimitivePad.create(1, '2', x + 500, 3000, 0, ['ELLIPSE', 60, 60], netN, null, 0, 0, 0, false, 0);
const pairName = `嘉立创示例_差分对_${ts}`;
await eda.pcb_Drc.createDifferentialPair(pairName, netP, netN);
// 3. 改名(保留现场供观察)
const newName = `嘉立创示例_差分对_改_${ts}`;
const result = await eda.pcb_Drc.modifyDifferentialPairName(pairName, newName);
console.log('newName:', newName);
console.log('result:', result);1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18