Home > PCB_Drc > modifyDifferentialPairName
PCB_Drc.modifyDifferentialPairName() method
此 API 当前处于 BETA 预览状态,希望得到开发者的反馈。它的任何功能都可能在接下来的开发进程中被修改,请不要将它用于任何正式环境。
修改差分对的名称
签名
typescript
function modifyDifferentialPairName(
originalDifferentialPairName: string,
differentialPairName: string,
): Promise<boolean>;1
2
3
4
2
3
4
参数名
参数 | 类型 | 描述 |
|---|---|---|
originalDifferentialPairName | string | 原差分对名称 |
differentialPairName | string | 新差分对名称 |
返回值
Promise<boolean>
操作是否成功
示例
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