Home > PCB_PrimitiveArc > modify
PCB_PrimitiveArc.modify() 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 Arc line
Signature
typescript
function modify(
primitiveId: string | IPCB_PrimitiveArc,
property: {
net?: undefined | string;
layer?:
| undefined
| EPCB_LayerId.TOP
| EPCB_LayerId.TOP_SILKSCREEN
| EPCB_LayerId.TOP_SOLDER_MASK
| EPCB_LayerId.TOP_PASTE_MASK
| EPCB_LayerId.TOP_ASSEMBLY
| EPCB_LayerId.BOTTOM
| EPCB_LayerId.BOTTOM_SILKSCREEN
| EPCB_LayerId.BOTTOM_SOLDER_MASK
| EPCB_LayerId.BOTTOM_PASTE_MASK
| EPCB_LayerId.BOTTOM_ASSEMBLY
| EPCB_LayerId.BOARD_OUTLINE
| EPCB_LayerId.DOCUMENT
| EPCB_LayerId.MECHANICAL
| EPCB_LayerId.INNER_1
| EPCB_LayerId.INNER_2
| EPCB_LayerId.INNER_3
| EPCB_LayerId.INNER_4
| EPCB_LayerId.INNER_5
| EPCB_LayerId.INNER_6
| EPCB_LayerId.INNER_7
| EPCB_LayerId.INNER_8
| EPCB_LayerId.INNER_9
| EPCB_LayerId.INNER_10
| EPCB_LayerId.INNER_11
| EPCB_LayerId.INNER_12
| EPCB_LayerId.INNER_13
| EPCB_LayerId.INNER_14
| EPCB_LayerId.INNER_15
| EPCB_LayerId.INNER_16
| EPCB_LayerId.INNER_17
| EPCB_LayerId.INNER_18
| EPCB_LayerId.INNER_19
| EPCB_LayerId.INNER_20
| EPCB_LayerId.INNER_21
| EPCB_LayerId.INNER_22
| EPCB_LayerId.INNER_23
| EPCB_LayerId.INNER_24
| EPCB_LayerId.INNER_25
| EPCB_LayerId.INNER_26
| EPCB_LayerId.INNER_27
| EPCB_LayerId.INNER_28
| EPCB_LayerId.INNER_29
| EPCB_LayerId.INNER_30
| EPCB_LayerId.CUSTOM_1
| EPCB_LayerId.CUSTOM_2
| EPCB_LayerId.CUSTOM_3
| EPCB_LayerId.CUSTOM_4
| EPCB_LayerId.CUSTOM_5
| EPCB_LayerId.CUSTOM_6
| EPCB_LayerId.CUSTOM_7
| EPCB_LayerId.CUSTOM_8
| EPCB_LayerId.CUSTOM_9
| EPCB_LayerId.CUSTOM_10
| EPCB_LayerId.CUSTOM_11
| EPCB_LayerId.CUSTOM_12
| EPCB_LayerId.CUSTOM_13
| EPCB_LayerId.CUSTOM_14
| EPCB_LayerId.CUSTOM_15
| EPCB_LayerId.CUSTOM_16
| EPCB_LayerId.CUSTOM_17
| EPCB_LayerId.CUSTOM_18
| EPCB_LayerId.CUSTOM_19
| EPCB_LayerId.CUSTOM_20
| EPCB_LayerId.CUSTOM_21
| EPCB_LayerId.CUSTOM_22
| EPCB_LayerId.CUSTOM_23
| EPCB_LayerId.CUSTOM_24
| EPCB_LayerId.CUSTOM_25
| EPCB_LayerId.CUSTOM_26
| EPCB_LayerId.CUSTOM_27
| EPCB_LayerId.CUSTOM_28
| EPCB_LayerId.CUSTOM_29
| EPCB_LayerId.CUSTOM_30
| EPCB_LayerId.DRILL_DRAWING;
startX?: undefined | number;
startY?: undefined | number;
endX?: undefined | number;
endY?: undefined | number;
arcAngle?: undefined | number;
lineWidth?: undefined | number;
interactiveMode?:
| undefined
| EPCB_PrimitiveArcInteractiveMode.TWO_POINT_ARC
| EPCB_PrimitiveArcInteractiveMode.CENTER_ARC;
primitiveLock?: undefined | false | true;
},
): Promise<IPCB_PrimitiveArc | undefined>;1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
Parameters
Returns
Promise<IPCB_PrimitiveArc | undefined>
Arc line primitive object
Example
javascript
// 1. 创建待修改的测试圆弧(随机坐标避免与画布已有圆弧重合)
const x = 2000 + Math.floor(Math.random() * 100000);
const y = 2000 + Math.floor(Math.random() * 100000);
const arc = await eda.pcb_PrimitiveArc.create('', 1, x, y, x + 500, y + 300, 90, 10, 1, false);
const arcId = arc.getState_PrimitiveId();
// 2. 读取修改前的线宽与圆心角
const beforeWidth = arc.getState_LineWidth();
const beforeAngle = arc.getState_ArcAngle();
// 3. 批量修改:线宽 10 → 24,圆心角 90 → 120
await eda.pcb_PrimitiveArc.modify(arcId, { lineWidth: 24, arcAngle: 120 });
// 4. modify 返回后需要重新 get() 才能读到画布上的最新值
const refreshed = await eda.pcb_PrimitiveArc.get(arcId);
// 5. 修改类保留现场,供观察修改结果
console.log('primitiveId:', arcId);
console.log('lineWidth:', beforeWidth, '→', refreshed.getState_LineWidth());
console.log('arcAngle:', beforeAngle, '→', refreshed.getState_ArcAngle());1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20