Home > PCB_Drc > modifyNetClassName
PCB_Drc.modifyNetClassName() 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 Net class name of
Signature
typescript
function modifyNetClassName(originalNetClassName: string, netClassName: string): Promise<boolean>;1
Parameters
Parameter | Type | Description |
|---|---|---|
originalNetClassName | string | Original net class name |
netClassName | string | New net class name |
Returns
Promise<boolean>
Whether the operation is successful
Example
javascript
// 1. 建一个待改名的网络类
await eda.pcb_Drc.createNetClass('嘉立创示例_网络类', [], { r: 255, g: 0, b: 0, alpha: 1 });
// 2. 改名(用时间戳后缀避免与之前保留的现场重名,保留现场供观察)
const newName = `嘉立创示例_网络类_改_${Date.now()}`;
const result = await eda.pcb_Drc.modifyNetClassName('嘉立创示例_网络类', newName);
console.log('newName:', newName);
console.log('result:', result);1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9