Home > PCB_Net > getAllNetsName
PCB_Net.getAllNetsName() method
Get the net names of all nets
Signature
typescript
function getAllNetsName(): Promise<Array<string>>;1
Returns
Promise<Array<string>>
Net name array
Example
javascript
// 1. 创建带网络名的过孔,让 PCB 中出现可查询的网络
const via = await eda.pcb_PrimitiveVia.create('嘉立创示例_NET1', 2000, 2000, 20, 40);
// 2. 获取所有网络的名称数组
const names = await eda.pcb_Net.getAllNetsName();
// 3. 清理测试图元(查询类需要清理)
await eda.pcb_PrimitiveVia.delete([via.getState_PrimitiveId()]);
console.log('totalNetCount:', names.length);
console.log('netNames:', names.slice(0, 5));
console.log('hasExampleNet:', names.includes('嘉立创示例_NET1'));1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12