Home > IPCB_PrimitiveArc > getEntireTrack
IPCB_PrimitiveArc.getEntireTrack() 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.
Get the entire wire
Signature
typescript
function getEntireTrack(includeVias: false): Promise<Array<IPCB_PrimitiveLine | IPCB_PrimitiveArc>>;1
Parameters
Parameter | Type | Description |
|---|---|---|
includeVias | false | Whether to include the vias at both ends of the wire |
Returns
Promise<Array<IPCB_PrimitiveLine | IPCB_PrimitiveArc>>
All lines and arc lines in the entire wire
Example
javascript
// 1. 创建一条直线走线,终点落在 (7500, 7000)
const line = await eda.pcb_PrimitiveLine.create('', 1, 7000, 7000, 7500, 7000, 10);
// 2. 创建一段圆弧,起点与直线终点重合,两段构成一整段导线
const arc = await eda.pcb_PrimitiveArc.create('', 1, 7500, 7000, 7800, 7300, 90, 10, 1, false);
// 3. 只取导线内的直线和圆弧
const trackOnly = await arc.getEntireTrack(false);
// 4. 连两端过孔一起取(本例两端没有过孔,数量不变)
const trackWithVias = await arc.getEntireTrack(true);
// 5. 清理测试图元(查询类案例不留测试对象)
await eda.pcb_PrimitiveLine.delete([line]);
await eda.pcb_PrimitiveArc.delete([arc]);
console.log('track(false) count:', trackOnly.length);
trackOnly.forEach((p, i) => {
console.log(`track(false)[${i}] type:`, p.getState_PrimitiveType());
});
console.log('track(true) count:', trackWithVias.length);1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21