@windypro-rourou/dsh-eda 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (484) hide show
  1. package/README.md +1 -1
  2. package/lib/backend.js +49 -0
  3. package/lib/capabilities.js +6 -2
  4. package/lib/client.js +33 -0
  5. package/lib/index.js +197 -3
  6. package/package.json +10 -1
  7. package/skill/INDEX.md +10 -8
  8. package/skill/README.md +125 -0
  9. package/skill/README.zh-Hans.md +125 -0
  10. package/skill/SKILL.md +746 -746
  11. package/skill/format/index.md +152 -152
  12. package/skill/format/pcb/3d.md +166 -166
  13. package/skill/format/pcb/attr.md +63 -63
  14. package/skill/format/pcb/common.md +306 -306
  15. package/skill/format/pcb/component.md +132 -132
  16. package/skill/format/pcb/dimension.md +58 -58
  17. package/skill/format/pcb/index.md +17 -17
  18. package/skill/format/pcb/obj.md +43 -43
  19. package/skill/format/pcb/pad_via.md +151 -151
  20. package/skill/format/pcb/panel.md +64 -64
  21. package/skill/format/pcb/partition.md +43 -43
  22. package/skill/format/pcb/primitive.md +196 -196
  23. package/skill/format/pcb/rule.md +71 -71
  24. package/skill/format/pcb/shape.md +441 -441
  25. package/skill/format/pcb/text.md +62 -62
  26. package/skill/format/project/blob.md +30 -30
  27. package/skill/format/project/common.md +42 -42
  28. package/skill/format/project/group.md +62 -62
  29. package/skill/format/project/index.md +12 -12
  30. package/skill/format/project/instance.md +32 -32
  31. package/skill/format/project/meta.md +189 -189
  32. package/skill/format/project/variant.md +30 -30
  33. package/skill/format/schematic/attr.md +41 -41
  34. package/skill/format/schematic/common.md +47 -47
  35. package/skill/format/schematic/component.md +91 -91
  36. package/skill/format/schematic/index.md +14 -14
  37. package/skill/format/schematic/obj.md +41 -41
  38. package/skill/format/schematic/pin.md +59 -59
  39. package/skill/format/schematic/shape.md +231 -231
  40. package/skill/format/schematic/structure.md +53 -53
  41. package/skill/format/schematic/table.md +109 -109
  42. package/skill/format/schematic/text.md +47 -47
  43. package/skill/format/schematic/wire.md +132 -132
  44. package/skill/guide/ancillary-projects/easyeda-api-sdk.md +1 -0
  45. package/skill/guide/ancillary-projects/pro-api-types.md +5 -5
  46. package/skill/guide/ancillary-projects.md +10 -10
  47. package/skill/guide/cli.md +1510 -0
  48. package/skill/guide/error-handling.md +38 -38
  49. package/skill/guide/extension-json.md +135 -135
  50. package/skill/guide/extensions-marketplace.md +61 -61
  51. package/skill/guide/how-to-start.md +316 -301
  52. package/skill/guide/i18n.md +57 -57
  53. package/skill/guide/index.md +7 -7
  54. package/skill/guide/inline-frame.md +20 -20
  55. package/skill/guide/invoke-apis.md +81 -81
  56. package/skill/guide/stability.md +37 -37
  57. package/skill/references/_index.md +471 -398
  58. package/skill/references/_quick-reference.md +3103 -3028
  59. package/skill/references/classes/DMT_Board.md +537 -533
  60. package/skill/references/classes/DMT_EditorControl.md +1736 -1736
  61. package/skill/references/classes/DMT_Event.md +356 -356
  62. package/skill/references/classes/DMT_Folder.md +775 -775
  63. package/skill/references/classes/DMT_Panel.md +531 -531
  64. package/skill/references/classes/DMT_Pcb.md +579 -575
  65. package/skill/references/classes/DMT_Project.md +734 -573
  66. package/skill/references/classes/DMT_Schematic.md +1482 -1477
  67. package/skill/references/classes/DMT_SelectControl.md +96 -96
  68. package/skill/references/classes/DMT_Team.md +172 -172
  69. package/skill/references/classes/DMT_Workspace.md +198 -198
  70. package/skill/references/classes/EDA.md +1001 -961
  71. package/skill/references/classes/IPCB_ComplexPolygon.md +299 -299
  72. package/skill/references/classes/IPCB_Polygon.md +175 -175
  73. package/skill/references/classes/IPCB_PrimitiveArc.md +1901 -1901
  74. package/skill/references/classes/IPCB_PrimitiveAttribute.md +2993 -2993
  75. package/skill/references/classes/IPCB_PrimitiveComponent.md +2624 -2627
  76. package/skill/references/classes/IPCB_PrimitiveComponentPad.md +410 -410
  77. package/skill/references/classes/IPCB_PrimitiveDimension.md +1419 -1419
  78. package/skill/references/classes/IPCB_PrimitiveFill.md +1325 -1325
  79. package/skill/references/classes/IPCB_PrimitiveImage.md +1461 -1461
  80. package/skill/references/classes/IPCB_PrimitiveLine.md +1639 -1639
  81. package/skill/references/classes/IPCB_PrimitiveObject.md +1700 -1700
  82. package/skill/references/classes/IPCB_PrimitivePad.md +3155 -3155
  83. package/skill/references/classes/IPCB_PrimitivePolyline.md +1193 -1193
  84. package/skill/references/classes/IPCB_PrimitivePour.md +1858 -1858
  85. package/skill/references/classes/IPCB_PrimitivePoured.md +556 -556
  86. package/skill/references/classes/IPCB_PrimitiveRegion.md +1332 -1332
  87. package/skill/references/classes/IPCB_PrimitiveString.md +2315 -2315
  88. package/skill/references/classes/IPCB_PrimitiveVia.md +1588 -1588
  89. package/skill/references/classes/ISCH_PrimitiveArc.md +1676 -1676
  90. package/skill/references/classes/ISCH_PrimitiveAttribute.md +2541 -2541
  91. package/skill/references/classes/ISCH_PrimitiveBus.md +973 -973
  92. package/skill/references/classes/ISCH_PrimitiveCbbSymbolComponent.md +260 -260
  93. package/skill/references/classes/ISCH_PrimitiveCircle.md +1392 -1392
  94. package/skill/references/classes/ISCH_PrimitiveComponent.md +2910 -2913
  95. package/skill/references/classes/ISCH_PrimitiveComponentPin.md +155 -155
  96. package/skill/references/classes/ISCH_PrimitiveObject.md +960 -960
  97. package/skill/references/classes/ISCH_PrimitivePin.md +2402 -2402
  98. package/skill/references/classes/ISCH_PrimitivePolygon.md +1028 -1028
  99. package/skill/references/classes/ISCH_PrimitiveRectangle.md +1777 -1777
  100. package/skill/references/classes/ISCH_PrimitiveText.md +1771 -1771
  101. package/skill/references/classes/ISCH_PrimitiveWire.md +973 -973
  102. package/skill/references/classes/LIB_3DModel.md +782 -780
  103. package/skill/references/classes/LIB_Cbb.md +957 -957
  104. package/skill/references/classes/LIB_Classification.md +969 -965
  105. package/skill/references/classes/LIB_Device.md +1222 -1221
  106. package/skill/references/classes/LIB_Footprint.md +1298 -1153
  107. package/skill/references/classes/LIB_LibrariesList.md +361 -329
  108. package/skill/references/classes/LIB_PanelLibrary.md +855 -855
  109. package/skill/references/classes/LIB_SelectControl.md +89 -89
  110. package/skill/references/classes/LIB_SimulationModel.md +807 -821
  111. package/skill/references/classes/LIB_Symbol.md +1341 -1195
  112. package/skill/references/classes/PCB_Document.md +1770 -1754
  113. package/skill/references/classes/PCB_Drc.md +3379 -3375
  114. package/skill/references/classes/PCB_Event.md +1166 -1081
  115. package/skill/references/classes/PCB_ImageTool.md +363 -0
  116. package/skill/references/classes/PCB_Layer.md +1915 -1911
  117. package/skill/references/classes/PCB_ManufactureData.md +2968 -2968
  118. package/skill/references/classes/PCB_MathPolygon.md +916 -785
  119. package/skill/references/classes/PCB_Net.md +1128 -1128
  120. package/skill/references/classes/PCB_Primitive.md +217 -217
  121. package/skill/references/classes/PCB_PrimitiveArc.md +820 -894
  122. package/skill/references/classes/PCB_PrimitiveAttribute.md +635 -717
  123. package/skill/references/classes/PCB_PrimitiveComponent.md +1050 -1050
  124. package/skill/references/classes/PCB_PrimitiveDimension.md +789 -833
  125. package/skill/references/classes/PCB_PrimitiveFill.md +783 -861
  126. package/skill/references/classes/PCB_PrimitiveImage.md +803 -875
  127. package/skill/references/classes/PCB_PrimitiveLine.md +787 -858
  128. package/skill/references/classes/PCB_PrimitiveObject.md +796 -800
  129. package/skill/references/classes/PCB_PrimitivePad.md +947 -944
  130. package/skill/references/classes/PCB_PrimitivePolyline.md +744 -819
  131. package/skill/references/classes/PCB_PrimitivePour.md +808 -845
  132. package/skill/references/classes/PCB_PrimitivePoured.md +363 -363
  133. package/skill/references/classes/PCB_PrimitiveRegion.md +765 -799
  134. package/skill/references/classes/PCB_PrimitiveString.md +828 -910
  135. package/skill/references/classes/PCB_PrimitiveVia.md +761 -765
  136. package/skill/references/classes/PCB_RayTracerEngine.md +603 -263
  137. package/skill/references/classes/PCB_SelectControl.md +495 -495
  138. package/skill/references/classes/PCB_Tool.md +9 -0
  139. package/skill/references/classes/PNL_Document.md +83 -83
  140. package/skill/references/classes/SCH_Document.md +797 -809
  141. package/skill/references/classes/SCH_Drc.md +246 -242
  142. package/skill/references/classes/SCH_Event.md +583 -583
  143. package/skill/references/classes/SCH_ManufactureData.md +1209 -1205
  144. package/skill/references/classes/SCH_Net.md +200 -200
  145. package/skill/references/classes/SCH_Netlist.md +191 -191
  146. package/skill/references/classes/SCH_Primitive.md +337 -337
  147. package/skill/references/classes/SCH_PrimitiveArc.md +686 -692
  148. package/skill/references/classes/SCH_PrimitiveAttribute.md +579 -590
  149. package/skill/references/classes/SCH_PrimitiveBus.md +618 -624
  150. package/skill/references/classes/SCH_PrimitiveCircle.md +667 -683
  151. package/skill/references/classes/SCH_PrimitiveComponent.md +2256 -2240
  152. package/skill/references/classes/SCH_PrimitiveObject.md +666 -666
  153. package/skill/references/classes/SCH_PrimitivePin.md +737 -754
  154. package/skill/references/classes/SCH_PrimitivePolygon.md +621 -627
  155. package/skill/references/classes/SCH_PrimitiveRectangle.md +715 -731
  156. package/skill/references/classes/SCH_PrimitiveText.md +736 -746
  157. package/skill/references/classes/SCH_PrimitiveWire.md +701 -703
  158. package/skill/references/classes/SCH_SelectControl.md +520 -520
  159. package/skill/references/classes/SCH_SimulationEngine.md +133 -133
  160. package/skill/references/classes/SCH_Utils.md +121 -121
  161. package/skill/references/classes/SYS_ClientUrl.md +173 -173
  162. package/skill/references/classes/SYS_Dialog.md +825 -825
  163. package/skill/references/classes/SYS_Environment.md +640 -502
  164. package/skill/references/classes/SYS_ExternalApi.md +246 -0
  165. package/skill/references/classes/SYS_FileManager.md +1664 -1686
  166. package/skill/references/classes/SYS_FileSystem.md +1366 -1171
  167. package/skill/references/classes/SYS_FontManager.md +224 -224
  168. package/skill/references/classes/SYS_FormatConversion.md +349 -349
  169. package/skill/references/classes/SYS_HeaderMenu.md +480 -479
  170. package/skill/references/classes/SYS_Help.md +141 -0
  171. package/skill/references/classes/SYS_I18n.md +861 -861
  172. package/skill/references/classes/SYS_IFrame.md +541 -535
  173. package/skill/references/classes/SYS_LoadingAndProgressBar.md +246 -246
  174. package/skill/references/classes/SYS_Log.md +422 -424
  175. package/skill/references/classes/SYS_Math.md +1565 -1565
  176. package/skill/references/classes/SYS_Message.md +363 -363
  177. package/skill/references/classes/SYS_MessageBox.md +285 -285
  178. package/skill/references/classes/SYS_MessageBus.md +1618 -1618
  179. package/skill/references/classes/SYS_PanelControl.md +696 -696
  180. package/skill/references/classes/SYS_RightClickMenu.md +175 -175
  181. package/skill/references/classes/SYS_Setting.md +134 -85
  182. package/skill/references/classes/SYS_ShortcutKey.md +623 -623
  183. package/skill/references/classes/SYS_Storage.md +484 -484
  184. package/skill/references/classes/SYS_Timer.md +447 -447
  185. package/skill/references/classes/SYS_ToastMessage.md +194 -194
  186. package/skill/references/classes/SYS_Tool.md +317 -241
  187. package/skill/references/classes/SYS_Unit.md +594 -594
  188. package/skill/references/classes/SYS_WebSocket.md +401 -401
  189. package/skill/references/classes/SYS_Window.md +849 -850
  190. package/skill/references/enums/EDMT_EditorDocumentType.md +324 -278
  191. package/skill/references/enums/EDMT_EditorSplitScreenDirection.md +51 -47
  192. package/skill/references/enums/EDMT_EditorTabEventType.md +68 -62
  193. package/skill/references/enums/EDMT_IndicatorMarkerType.md +90 -80
  194. package/skill/references/enums/EDMT_ItemType.md +181 -157
  195. package/skill/references/enums/EDMT_ProjectCollaborationMode.md +51 -47
  196. package/skill/references/enums/EDMT_ProjectFileFormat.md +60 -0
  197. package/skill/references/enums/EDMT_ProjectReadyState.md +82 -0
  198. package/skill/references/enums/ELIB_DeviceJlcLibraryCategory.md +51 -47
  199. package/skill/references/enums/ELIB_LibraryType.md +129 -113
  200. package/skill/references/enums/ELIB_PreviewType.md +77 -69
  201. package/skill/references/enums/ELIB_SimulationModelType.md +51 -47
  202. package/skill/references/enums/ELIB_SymbolType.md +142 -124
  203. package/skill/references/enums/EPCB_AutoRoutingCornerStyle.md +51 -47
  204. package/skill/references/enums/EPCB_AutoRoutingExistingPrimitiveMode.md +51 -47
  205. package/skill/references/enums/EPCB_AutoRoutingOptimization.md +51 -47
  206. package/skill/references/enums/EPCB_DocumentCanvasUpdateCalculationActiveStatus.md +51 -47
  207. package/skill/references/enums/EPCB_DocumentRatlineCalculatingActiveStatus.md +55 -51
  208. package/skill/references/enums/EPCB_InactiveLayerDisplayMode.md +64 -58
  209. package/skill/references/enums/EPCB_LayerColorConfiguration.md +90 -80
  210. package/skill/references/enums/EPCB_LayerId.md +1169 -881
  211. package/skill/references/enums/EPCB_LayerStatus.md +64 -58
  212. package/skill/references/enums/EPCB_LayerType.md +129 -113
  213. package/skill/references/enums/EPCB_MouseEventType.md +64 -58
  214. package/skill/references/enums/EPCB_NetEventType.md +64 -58
  215. package/skill/references/enums/EPCB_PcbPlateType.md +51 -47
  216. package/skill/references/enums/EPCB_PdfOutputMethod.md +64 -58
  217. package/skill/references/enums/EPCB_PrimitiveArcInteractiveMode.md +51 -47
  218. package/skill/references/enums/EPCB_PrimitiveDimensionType.md +64 -58
  219. package/skill/references/enums/EPCB_PrimitiveEventType.md +64 -58
  220. package/skill/references/enums/EPCB_PrimitiveFillMode.md +68 -62
  221. package/skill/references/enums/EPCB_PrimitivePadHeatWeldingConnectionMethod.md +64 -58
  222. package/skill/references/enums/EPCB_PrimitivePadHoleType.md +64 -58
  223. package/skill/references/enums/EPCB_PrimitivePadShapeType.md +90 -80
  224. package/skill/references/enums/EPCB_PrimitivePadType.md +64 -58
  225. package/skill/references/enums/EPCB_PrimitivePourFillMethod.md +64 -58
  226. package/skill/references/enums/EPCB_PrimitiveRegionRuleType.md +107 -95
  227. package/skill/references/enums/EPCB_PrimitiveStringAlignMode.md +142 -124
  228. package/skill/references/enums/EPCB_PrimitiveType.md +233 -201
  229. package/skill/references/enums/EPCB_PrimitiveViaType.md +64 -58
  230. package/skill/references/enums/ESCH_DynamicSimulationEnginePullEventType.md +116 -102
  231. package/skill/references/enums/ESCH_DynamicSimulationEnginePushEventType.md +90 -80
  232. package/skill/references/enums/ESCH_ExportDocumentFileType.md +64 -58
  233. package/skill/references/enums/ESCH_MouseEventType.md +51 -47
  234. package/skill/references/enums/ESCH_PrimitiveComponentType.md +142 -124
  235. package/skill/references/enums/ESCH_PrimitiveEventType.md +77 -69
  236. package/skill/references/enums/ESCH_PrimitiveFillStyle.md +129 -113
  237. package/skill/references/enums/ESCH_PrimitiveLineType.md +77 -69
  238. package/skill/references/enums/ESCH_PrimitivePinShape.md +77 -69
  239. package/skill/references/enums/ESCH_PrimitivePinType.md +168 -146
  240. package/skill/references/enums/ESCH_PrimitiveTextAlignMode.md +142 -124
  241. package/skill/references/enums/ESCH_PrimitiveType.md +207 -179
  242. package/skill/references/enums/ESCH_SimulationNetlistType.md +38 -36
  243. package/skill/references/enums/ESCH_SpiceSimulationEnginePullEventType.md +51 -47
  244. package/skill/references/enums/ESCH_SpiceSimulationEnginePushEventType.md +77 -69
  245. package/skill/references/enums/ESYS_BottomPanelTab.md +94 -80
  246. package/skill/references/enums/ESYS_HeaderMenuEnvironment.md +181 -157
  247. package/skill/references/enums/ESYS_ImportProjectBoardOutlineSource.md +55 -51
  248. package/skill/references/enums/ESYS_ImportProjectImportOption.md +64 -58
  249. package/skill/references/enums/ESYS_ImportProjectSchematicObjectStyle.md +51 -47
  250. package/skill/references/enums/ESYS_ImportProjectViaSolderMaskExpansion.md +55 -51
  251. package/skill/references/enums/ESYS_JobState.md +95 -0
  252. package/skill/references/enums/ESYS_LeftPanelTab.md +94 -80
  253. package/skill/references/enums/ESYS_LogType.md +77 -102
  254. package/skill/references/enums/ESYS_NetlistType.md +129 -113
  255. package/skill/references/enums/ESYS_PanelPosition.md +69 -0
  256. package/skill/references/enums/ESYS_PanelTab.md +368 -0
  257. package/skill/references/enums/ESYS_RightPanelTab.md +237 -201
  258. package/skill/references/enums/ESYS_ShortcutKeyEffectiveEditorRange.md +220 -190
  259. package/skill/references/enums/ESYS_ShortcutKeyEffectiveEditorScene.md +103 -91
  260. package/skill/references/enums/ESYS_StartPageQuickStartItem.md +237 -205
  261. package/skill/references/enums/ESYS_Theme.md +51 -47
  262. package/skill/references/enums/ESYS_ToastMessageType.md +90 -80
  263. package/skill/references/enums/ESYS_Unit.md +116 -102
  264. package/skill/references/enums/ESYS_WindowEventType.md +64 -47
  265. package/skill/references/enums/ESYS_WindowOpenTarget.md +51 -47
  266. package/skill/references/enums/NetportDeviceName.md +146 -146
  267. package/skill/references/enums/SchToolBarDeviceName.md +278 -278
  268. package/skill/references/interfaces/BoardProps.md +169 -169
  269. package/skill/references/interfaces/BorderConfig.md +109 -0
  270. package/skill/references/interfaces/ButtonProps.md +196 -169
  271. package/skill/references/interfaces/CellClickInfo.md +142 -0
  272. package/skill/references/interfaces/CellCoord.md +88 -0
  273. package/skill/references/interfaces/CheckBoxProps.md +223 -196
  274. package/skill/references/interfaces/CheckChangeDetail.md +88 -0
  275. package/skill/references/interfaces/CheckboxEditConfig.md +159 -0
  276. package/skill/references/interfaces/ClipboardCellData.md +142 -0
  277. package/skill/references/interfaces/ClipboardConfig.md +115 -0
  278. package/skill/references/interfaces/ColorPickerProps.md +169 -0
  279. package/skill/references/interfaces/ColumnDef.md +605 -0
  280. package/skill/references/interfaces/ColumnEditTrigger.md +57 -0
  281. package/skill/references/interfaces/ColumnGroupDef.md +192 -0
  282. package/skill/references/interfaces/ColumnResizeConfig.md +142 -0
  283. package/skill/references/interfaces/ComponentPropsMap.md +517 -448
  284. package/skill/references/interfaces/CustomHeaderConfig.md +169 -0
  285. package/skill/references/interfaces/DialogProps.md +385 -385
  286. package/skill/references/interfaces/DragSortConfig.md +115 -0
  287. package/skill/references/interfaces/EditingConfig.md +196 -0
  288. package/skill/references/interfaces/FilteringConfig.md +250 -0
  289. package/skill/references/interfaces/FixedColumnConfig.md +88 -0
  290. package/skill/references/interfaces/FlexItemProps.md +116 -116
  291. package/skill/references/interfaces/FlexProps.md +224 -224
  292. package/skill/references/interfaces/GridItemProps.md +143 -143
  293. package/skill/references/interfaces/GridProps.md +143 -143
  294. package/skill/references/interfaces/IDMT_BoardItem.md +171 -171
  295. package/skill/references/interfaces/IDMT_BriefProjectItem.md +171 -171
  296. package/skill/references/interfaces/IDMT_EditorDocumentItem.md +169 -169
  297. package/skill/references/interfaces/IDMT_EditorSplitScreenItem.md +173 -173
  298. package/skill/references/interfaces/IDMT_EditorTabItem.md +169 -169
  299. package/skill/references/interfaces/IDMT_FolderItem.md +225 -225
  300. package/skill/references/interfaces/IDMT_IndicatorMarkerShape.md +393 -393
  301. package/skill/references/interfaces/IDMT_PanelItem.md +144 -144
  302. package/skill/references/interfaces/IDMT_PcbItem.md +171 -171
  303. package/skill/references/interfaces/IDMT_ProjectItem.md +143 -143
  304. package/skill/references/interfaces/IDMT_SchematicItem.md +225 -225
  305. package/skill/references/interfaces/IDMT_SchematicPageItem.md +198 -198
  306. package/skill/references/interfaces/IDMT_TeamItem.md +144 -144
  307. package/skill/references/interfaces/IDMT_WorkspaceItem.md +117 -117
  308. package/skill/references/interfaces/IDesignPortal.md +103 -103
  309. package/skill/references/interfaces/ILIB_3DModelItem.md +198 -198
  310. package/skill/references/interfaces/ILIB_3DModelSearchItem.md +277 -277
  311. package/skill/references/interfaces/ILIB_CbbItem.md +225 -225
  312. package/skill/references/interfaces/ILIB_CbbSearchItem.md +277 -277
  313. package/skill/references/interfaces/ILIB_ClassificationIndex.md +150 -150
  314. package/skill/references/interfaces/ILIB_ClassificationNode.md +98 -0
  315. package/skill/references/interfaces/ILIB_DeviceAssociationItem.md +210 -210
  316. package/skill/references/interfaces/ILIB_DeviceExtendPropertyItem.md +304 -304
  317. package/skill/references/interfaces/ILIB_DeviceItem.md +279 -279
  318. package/skill/references/interfaces/ILIB_DevicePropertiesForSearch.md +250 -250
  319. package/skill/references/interfaces/ILIB_DeviceSearchItem.md +521 -521
  320. package/skill/references/interfaces/ILIB_ExtendLibrary3DModelFunctions.md +64 -64
  321. package/skill/references/interfaces/ILIB_ExtendLibraryCbbFunctions.md +93 -99
  322. package/skill/references/interfaces/ILIB_ExtendLibraryClassificationIndex.md +150 -150
  323. package/skill/references/interfaces/ILIB_ExtendLibraryDeviceFunctions.md +143 -157
  324. package/skill/references/interfaces/ILIB_ExtendLibraryFootprintFunctions.md +63 -63
  325. package/skill/references/interfaces/ILIB_ExtendLibraryFunctions.md +123 -123
  326. package/skill/references/interfaces/ILIB_ExtendLibraryItem.md +97 -97
  327. package/skill/references/interfaces/ILIB_ExtendLibraryItemIndex.md +98 -98
  328. package/skill/references/interfaces/ILIB_ExtendLibrarySearchProperty.md +115 -115
  329. package/skill/references/interfaces/ILIB_ExtendLibrarySearchResult.md +169 -169
  330. package/skill/references/interfaces/ILIB_ExtendLibrarySearchResultDataLine.md +234 -234
  331. package/skill/references/interfaces/ILIB_ExtendLibrarySymbolFunctions.md +91 -105
  332. package/skill/references/interfaces/ILIB_ExtendLibraryUserIndex.md +96 -96
  333. package/skill/references/interfaces/ILIB_FootprintItem.md +256 -198
  334. package/skill/references/interfaces/ILIB_FootprintPropertiesForSearch.md +61 -61
  335. package/skill/references/interfaces/ILIB_FootprintSearchItem.md +277 -277
  336. package/skill/references/interfaces/ILIB_LibraryInfo.md +92 -92
  337. package/skill/references/interfaces/ILIB_LibraryItem.md +115 -115
  338. package/skill/references/interfaces/ILIB_PanelLibraryItem.md +198 -198
  339. package/skill/references/interfaces/ILIB_PanelLibrarySearchItem.md +277 -277
  340. package/skill/references/interfaces/ILIB_RegisterExtendLibraryProps.md +71 -0
  341. package/skill/references/interfaces/ILIB_SimulationModelItem.md +306 -306
  342. package/skill/references/interfaces/ILIB_SimulationModelSearchItem.md +304 -304
  343. package/skill/references/interfaces/ILIB_SymbolItem.md +306 -279
  344. package/skill/references/interfaces/ILIB_SymbolPropertiesForSearch.md +61 -61
  345. package/skill/references/interfaces/ILIB_SymbolSearchItem.md +304 -304
  346. package/skill/references/interfaces/IPCB_AutoLayoutResult.md +169 -169
  347. package/skill/references/interfaces/IPCB_AutoRoutingProps.md +220 -220
  348. package/skill/references/interfaces/IPCB_AutoRoutingResult.md +169 -169
  349. package/skill/references/interfaces/IPCB_BomPropertiesTableColumns.md +169 -169
  350. package/skill/references/interfaces/IPCB_DifferentialPairItem.md +115 -115
  351. package/skill/references/interfaces/IPCB_DiscretizeOptions.md +65 -65
  352. package/skill/references/interfaces/IPCB_DiscretizedPoint.md +88 -88
  353. package/skill/references/interfaces/IPCB_EqualLengthNetGroupItem.md +115 -115
  354. package/skill/references/interfaces/IPCB_LayerItem.md +277 -277
  355. package/skill/references/interfaces/IPCB_NetClassItem.md +115 -115
  356. package/skill/references/interfaces/IPCB_NetInfo.md +115 -115
  357. package/skill/references/interfaces/IPCB_PadPairGroupItem.md +88 -88
  358. package/skill/references/interfaces/IPCB_PadPairMinWireLengthItem.md +88 -88
  359. package/skill/references/interfaces/IPCB_PhysicalStackingConfiguration.md +115 -115
  360. package/skill/references/interfaces/IPCB_Primitive.md +218 -218
  361. package/skill/references/interfaces/IPCB_PrimitiveAPI.md +174 -175
  362. package/skill/references/interfaces/IPCB_PrimitivePadHeatWelding.md +151 -151
  363. package/skill/references/interfaces/IPCB_PrimitivePouredPourFill.md +142 -142
  364. package/skill/references/interfaces/IPCB_PrimitiveSolderMaskAndPasteMaskExpansion.md +154 -154
  365. package/skill/references/interfaces/IPCB_RayTracerBackgroundConfig.md +223 -0
  366. package/skill/references/interfaces/IPCB_RayTracerLightConfig.md +412 -0
  367. package/skill/references/interfaces/IPCB_RayTracerMaterialConfig.md +547 -0
  368. package/skill/references/interfaces/IPCB_RayTracerPcbMaterialConfig.md +196 -0
  369. package/skill/references/interfaces/IPCB_RayTracerRenderConfigurations.md +200 -0
  370. package/skill/references/interfaces/IPCB_RayTracerRendererConfig.md +196 -0
  371. package/skill/references/interfaces/IPCB_RayTracerSceneElement.md +115 -0
  372. package/skill/references/interfaces/IPCB_RayTracerSceneElementTransform.md +123 -0
  373. package/skill/references/interfaces/IPCB_RayTracerTexture.md +88 -0
  374. package/skill/references/interfaces/IPCB_SubstratePhysicalProperties.md +88 -88
  375. package/skill/references/interfaces/IRawNet.md +103 -103
  376. package/skill/references/interfaces/IRawPureSchematic.md +80 -80
  377. package/skill/references/interfaces/IRawSchematic.md +103 -103
  378. package/skill/references/interfaces/IRawWire.md +149 -149
  379. package/skill/references/interfaces/ISCH_DrcError.md +142 -142
  380. package/skill/references/interfaces/ISCH_DrcErrorPrimitive.md +142 -142
  381. package/skill/references/interfaces/ISCH_ExportPngResolution.md +94 -94
  382. package/skill/references/interfaces/ISCH_NetInfo.md +88 -88
  383. package/skill/references/interfaces/ISCH_Primitive.md +218 -219
  384. package/skill/references/interfaces/ISCH_PrimitiveAPI.md +174 -175
  385. package/skill/references/interfaces/ISCH_ProjectNetInfo.md +142 -142
  386. package/skill/references/interfaces/ISCH_WireInfo.md +169 -169
  387. package/skill/references/interfaces/ISYS_ComparisonResponse.md +115 -0
  388. package/skill/references/interfaces/ISYS_ExtensionExternalApiIndex.md +13 -0
  389. package/skill/references/interfaces/ISYS_ExtensionRegisteredExternalApis.md +13 -0
  390. package/skill/references/interfaces/ISYS_ExternalApiHelp.md +173 -0
  391. package/skill/references/interfaces/ISYS_ExternalApiRegistration.md +146 -0
  392. package/skill/references/interfaces/ISYS_FileSystemFileList.md +169 -169
  393. package/skill/references/interfaces/ISYS_HeaderMenuSub1MenuItem.md +205 -174
  394. package/skill/references/interfaces/ISYS_HeaderMenuSub2MenuItem.md +178 -147
  395. package/skill/references/interfaces/ISYS_HeaderMenuTopMenuItem.md +115 -115
  396. package/skill/references/interfaces/ISYS_HeaderMenus.md +408 -408
  397. package/skill/references/interfaces/ISYS_HelpAudienceEntry.md +92 -0
  398. package/skill/references/interfaces/ISYS_HelpClassSummary.md +205 -0
  399. package/skill/references/interfaces/ISYS_HelpData.md +92 -0
  400. package/skill/references/interfaces/ISYS_HelpMethodDetail.md +310 -0
  401. package/skill/references/interfaces/ISYS_JobHandle.md +65 -0
  402. package/skill/references/interfaces/ISYS_JobLogEntry.md +142 -0
  403. package/skill/references/interfaces/ISYS_JobStatus.md +176 -0
  404. package/skill/references/interfaces/ISYS_LogLine.md +115 -115
  405. package/skill/references/interfaces/ISYS_MathBBox.md +142 -142
  406. package/skill/references/interfaces/ISYS_MathPoint.md +88 -88
  407. package/skill/references/interfaces/ISYS_MathPolygonWithHoles.md +92 -92
  408. package/skill/references/interfaces/ISYS_MessageBusTask.md +115 -115
  409. package/skill/references/interfaces/ISYS_MultilingualLanguagesData.md +12 -12
  410. package/skill/references/interfaces/ISYS_RightClickMenuItem.md +174 -174
  411. package/skill/references/interfaces/ISYS_ShortcutKeyData.md +169 -169
  412. package/skill/references/interfaces/ISYS_ShortcutKeyDataWithCallFn.md +62 -62
  413. package/skill/references/interfaces/ISYS_ShortcutKeyDataWithUserDefinedShortcutKey.md +62 -62
  414. package/skill/references/interfaces/ISYS_WindowEventListenerRemovableObject.md +109 -109
  415. package/skill/references/interfaces/IconProps.md +88 -88
  416. package/skill/references/interfaces/ImageProps.md +115 -115
  417. package/skill/references/interfaces/InputEditConfig.md +182 -0
  418. package/skill/references/interfaces/InputProps.md +547 -520
  419. package/skill/references/interfaces/KeyboardConfig.md +61 -0
  420. package/skill/references/interfaces/ListChildren.md +223 -223
  421. package/skill/references/interfaces/ListProps.md +250 -223
  422. package/skill/references/interfaces/ModalProps.md +358 -358
  423. package/skill/references/interfaces/NumberEditConfig.md +234 -0
  424. package/skill/references/interfaces/RadioGroupProps.md +196 -196
  425. package/skill/references/interfaces/RadioItem.md +115 -115
  426. package/skill/references/interfaces/RichTableProps.md +1357 -0
  427. package/skill/references/interfaces/RowMetaConfig.md +142 -0
  428. package/skill/references/interfaces/ScrollerProps.md +169 -169
  429. package/skill/references/interfaces/SelectEditConfig.md +211 -0
  430. package/skill/references/interfaces/SelectListItem.md +142 -142
  431. package/skill/references/interfaces/SelectOption.md +142 -0
  432. package/skill/references/interfaces/SelectProps.md +169 -169
  433. package/skill/references/interfaces/SelectionConfig.md +358 -0
  434. package/skill/references/interfaces/SliderProps.md +142 -0
  435. package/skill/references/interfaces/SlotProps.md +88 -88
  436. package/skill/references/interfaces/SortState.md +88 -0
  437. package/skill/references/interfaces/SortingConfig.md +169 -0
  438. package/skill/references/interfaces/StyleProps.md +439 -385
  439. package/skill/references/interfaces/TextAreaProps.md +196 -196
  440. package/skill/references/interfaces/TextProps.md +169 -169
  441. package/skill/references/interfaces/TextareaEditConfig.md +182 -0
  442. package/skill/references/interfaces/ValidationRule.md +223 -0
  443. package/skill/references/interfaces/VirtualScrollConfig.md +115 -0
  444. package/skill/references/types/Align.md +9 -0
  445. package/skill/references/types/CellContentType.md +9 -0
  446. package/skill/references/types/ColumnDefOrGroup.md +12 -0
  447. package/skill/references/types/ColumnEditConfig.md +13 -0
  448. package/skill/references/types/ColumnType.md +9 -0
  449. package/skill/references/types/DataChangeType.md +9 -0
  450. package/skill/references/types/FilterMatchMode.md +9 -0
  451. package/skill/references/types/RichTableRow.md +12 -0
  452. package/skill/references/types/Serializable.md +10 -0
  453. package/skill/references/types/SerializablePrimitive.md +9 -0
  454. package/skill/references/types/SortOrder.md +9 -0
  455. package/skill/references/types/TPCB_LayerTypesOfInnerLayer.md +11 -11
  456. package/skill/references/types/TPCB_LayersInTheSelectable.md +42 -42
  457. package/skill/references/types/TPCB_LayersOfComponent.md +11 -11
  458. package/skill/references/types/TPCB_LayersOfCopper.md +15 -15
  459. package/skill/references/types/TPCB_LayersOfCustom.md +41 -41
  460. package/skill/references/types/TPCB_LayersOfDimension.md +16 -16
  461. package/skill/references/types/TPCB_LayersOfFill.md +28 -28
  462. package/skill/references/types/TPCB_LayersOfImage.md +22 -22
  463. package/skill/references/types/TPCB_LayersOfInner.md +41 -41
  464. package/skill/references/types/TPCB_LayersOfLine.md +25 -25
  465. package/skill/references/types/TPCB_LayersOfObject.md +12 -12
  466. package/skill/references/types/TPCB_LayersOfPad.md +11 -11
  467. package/skill/references/types/TPCB_LayersOfRegion.md +11 -11
  468. package/skill/references/types/TPCB_NumberOfCopperLayers.md +9 -9
  469. package/skill/references/types/TPCB_PolygonSourceArray.md +85 -83
  470. package/skill/references/types/TPCB_PrimitiveDimensionCoordinateSet.md +66 -66
  471. package/skill/references/types/TPCB_PrimitivePadHole.md +30 -30
  472. package/skill/references/types/TPCB_PrimitivePadShape.md +61 -61
  473. package/skill/references/types/TPCB_PrimitiveSpecialPadShape.md +19 -19
  474. package/skill/references/types/TSYS_ComparisonErrorCode.md +15 -0
  475. package/skill/references/types/TSYS_LanguageKeyValuePairs.md +13 -0
  476. package/skill/references/types/TSYS_MathPolygonGroup.md +15 -15
  477. package/skill/references/types/TSYS_MathPolygonInput.md +20 -20
  478. package/skill/references/types/TSYS_ShortcutKeys.md +96 -96
  479. package/skill/user-guide/using-extension.md +47 -47
  480. package/src/json-gen.test.js +430 -0
  481. package/skill/guide/ancillary-projects/pro-api-sdk.md +0 -1
  482. package/skill/references/interfaces/ISYS_PcbComparisonResponse.md +0 -115
  483. package/skill/references/types/ISYS_LanguageKeyValuePairs.md +0 -13
  484. package/skill/references/types/TSYS_PcbComparisonErrorCode.md +0 -10
@@ -1,1639 +1,1639 @@
1
- # IPCB\_PrimitiveLine class
2
-
3
- Line primitive
4
-
5
- ## Signature
6
-
7
- ```typescript
8
- class IPCB_PrimitiveLine implements IPCB_Primitive
9
- ```
10
- **Implements:** [IPCB\_Primitive](../interfaces/IPCB_Primitive.md)
11
-
12
- ## Remarks
13
-
14
- Both lines and arc lines are wires, corresponding to the line traces and arc traces on the canvas
15
-
16
- ## Methods
17
-
18
- <table><thead><tr><th>
19
-
20
- Method
21
-
22
- </th><th>
23
-
24
- Modifiers
25
-
26
- </th><th>
27
-
28
- Description
29
-
30
- </th></tr></thead>
31
- <tbody><tr><td>
32
-
33
- [done()](./IPCB_PrimitiveLine.md)
34
-
35
- </td><td>
36
-
37
- </td><td>
38
-
39
- **_(BETA)_** Apply the changes to the primitives to the canvas
40
-
41
- </td></tr>
42
- <tr><td>
43
-
44
- [getAdjacentPrimitives()](./IPCB_PrimitiveLine.md)
45
-
46
- </td><td>
47
-
48
- </td><td>
49
-
50
- **_(BETA)_** Get Adjacent primitive objects
51
-
52
- </td></tr>
53
- <tr><td>
54
-
55
- [getEntireTrack(includeVias)](./IPCB_PrimitiveLine.md)
56
-
57
- </td><td>
58
-
59
- </td><td>
60
-
61
- **_(BETA)_** Get the entire wire
62
-
63
- </td></tr>
64
- <tr><td>
65
-
66
- [getEntireTrack(includeVias)](./IPCB_PrimitiveLine.md)
67
-
68
- </td><td>
69
-
70
- </td><td>
71
-
72
- **_(BETA)_** Get the entire wire
73
-
74
- </td></tr>
75
- <tr><td>
76
-
77
- [getState\_EndX()](./IPCB_PrimitiveLine.md)
78
-
79
- </td><td>
80
-
81
- </td><td>
82
-
83
- Get the property state: end position X
84
-
85
- </td></tr>
86
- <tr><td>
87
-
88
- [getState\_EndY()](./IPCB_PrimitiveLine.md)
89
-
90
- </td><td>
91
-
92
- </td><td>
93
-
94
- Get the property state: end position Y
95
-
96
- </td></tr>
97
- <tr><td>
98
-
99
- [getState\_Layer()](./IPCB_PrimitiveLine.md)
100
-
101
- </td><td>
102
-
103
- </td><td>
104
-
105
- Get the property state: Layer
106
-
107
- </td></tr>
108
- <tr><td>
109
-
110
- [getState\_LineWidth()](./IPCB_PrimitiveLine.md)
111
-
112
- </td><td>
113
-
114
- </td><td>
115
-
116
- Get the property state: Line width
117
-
118
- </td></tr>
119
- <tr><td>
120
-
121
- [getState\_Net()](./IPCB_PrimitiveLine.md)
122
-
123
- </td><td>
124
-
125
- </td><td>
126
-
127
- Get the property state: net name
128
-
129
- </td></tr>
130
- <tr><td>
131
-
132
- [getState\_PrimitiveId()](./IPCB_PrimitiveLine.md)
133
-
134
- </td><td>
135
-
136
- </td><td>
137
-
138
- Get the property state: primitive ID
139
-
140
- </td></tr>
141
- <tr><td>
142
-
143
- [getState\_PrimitiveLock()](./IPCB_PrimitiveLine.md)
144
-
145
- </td><td>
146
-
147
- </td><td>
148
-
149
- Get the property state: whether it is locked
150
-
151
- </td></tr>
152
- <tr><td>
153
-
154
- [getState\_PrimitiveType()](./IPCB_PrimitiveLine.md)
155
-
156
- </td><td>
157
-
158
- </td><td>
159
-
160
- Get the property state: primitive type
161
-
162
- </td></tr>
163
- <tr><td>
164
-
165
- [getState\_StartX()](./IPCB_PrimitiveLine.md)
166
-
167
- </td><td>
168
-
169
- </td><td>
170
-
171
- Get the property state: start position X
172
-
173
- </td></tr>
174
- <tr><td>
175
-
176
- [getState\_StartY()](./IPCB_PrimitiveLine.md)
177
-
178
- </td><td>
179
-
180
- </td><td>
181
-
182
- Get the property state: start position Y
183
-
184
- </td></tr>
185
- <tr><td>
186
-
187
- [isAsync()](./IPCB_PrimitiveLine.md)
188
-
189
- </td><td>
190
-
191
- </td><td>
192
-
193
- Query whether the primitive is an async primitive
194
-
195
- </td></tr>
196
- <tr><td>
197
-
198
- [reset()](./IPCB_PrimitiveLine.md)
199
-
200
- </td><td>
201
-
202
- </td><td>
203
-
204
- **_(BETA)_** Reset the async primitive to the current canvas state
205
-
206
- </td></tr>
207
- <tr><td>
208
-
209
- [setState\_EndX(endX)](./IPCB_PrimitiveLine.md)
210
-
211
- </td><td>
212
-
213
- </td><td>
214
-
215
- **_(BETA)_** Set the property state: end position X
216
-
217
- </td></tr>
218
- <tr><td>
219
-
220
- [setState\_EndY(endY)](./IPCB_PrimitiveLine.md)
221
-
222
- </td><td>
223
-
224
- </td><td>
225
-
226
- **_(BETA)_** Set the property state: end position Y
227
-
228
- </td></tr>
229
- <tr><td>
230
-
231
- [setState\_Layer(layer)](./IPCB_PrimitiveLine.md)
232
-
233
- </td><td>
234
-
235
- </td><td>
236
-
237
- **_(BETA)_** Set the property state: Layer
238
-
239
- </td></tr>
240
- <tr><td>
241
-
242
- [setState\_LineWidth(lineWidth)](./IPCB_PrimitiveLine.md)
243
-
244
- </td><td>
245
-
246
- </td><td>
247
-
248
- **_(BETA)_** Set the property state: Line width
249
-
250
- </td></tr>
251
- <tr><td>
252
-
253
- [setState\_Net(net)](./IPCB_PrimitiveLine.md)
254
-
255
- </td><td>
256
-
257
- </td><td>
258
-
259
- **_(BETA)_** Set the property state: net name
260
-
261
- </td></tr>
262
- <tr><td>
263
-
264
- [setState\_PrimitiveLock(primitiveLock)](./IPCB_PrimitiveLine.md)
265
-
266
- </td><td>
267
-
268
- </td><td>
269
-
270
- **_(BETA)_** Set the property state: whether it is locked
271
-
272
- </td></tr>
273
- <tr><td>
274
-
275
- [setState\_StartX(startX)](./IPCB_PrimitiveLine.md)
276
-
277
- </td><td>
278
-
279
- </td><td>
280
-
281
- **_(BETA)_** Set the property state: start position X
282
-
283
- </td></tr>
284
- <tr><td>
285
-
286
- [setState\_StartY(startY)](./IPCB_PrimitiveLine.md)
287
-
288
- </td><td>
289
-
290
- </td><td>
291
-
292
- **_(BETA)_** Set the property state: start position Y
293
-
294
- </td></tr>
295
- <tr><td>
296
-
297
- [toAsync()](./IPCB_PrimitiveLine.md)
298
-
299
- </td><td>
300
-
301
- </td><td>
302
-
303
- Convert Primitive to Async primitive
304
-
305
- </td></tr>
306
- <tr><td>
307
-
308
- [toSync()](./IPCB_PrimitiveLine.md)
309
-
310
- </td><td>
311
-
312
- </td><td>
313
-
314
- Convert Primitive to Sync primitive
315
-
316
- </td></tr>
317
- </tbody></table>
318
-
319
- ---
320
-
321
- ## 方法详情
322
-
323
- ### done
324
-
325
- # IPCB\_PrimitiveLine.done() method
326
-
327
- > 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.
328
-
329
- Apply the changes to the primitives to the canvas
330
-
331
- ## Signature
332
-
333
- ```typescript
334
- function done(): Promise<IPCB_PrimitiveLine>;
335
- ```
336
-
337
- ## Returns
338
-
339
- Promise&lt;[IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md)<!-- -->&gt;
340
-
341
- Line primitive object
342
-
343
- ## Example
344
-
345
- ```javascript
346
- // 1. 生成本次运行专用的坐标,避免与之前保留的测试走线重合
347
- const x = 42000 + (Math.floor(Math.random() * 100000));
348
- const y = 2000 + (Math.floor(Math.random() * 100000));
349
-
350
- // 2. 创建一条测试直线走线
351
- const line = await eda.pcb_PrimitiveLine.create('', 1, x, y, x + 600, y, 10);
352
-
353
- // 3. 切换异步模式,连续累计两处修改(线宽 + 换层)
354
- const asyncLine = line.toAsync();
355
- asyncLine.setState_LineWidth(24);
356
- asyncLine.setState_Layer(2);
357
-
358
- // 4. 一次性提交到画布
359
- await asyncLine.done();
360
-
361
- // 5. 从画布重新读取,确认两处修改都已生效(保留现场供观察)
362
- const refetched = await eda.pcb_PrimitiveLine.get(line.getState_PrimitiveId());
363
-
364
- console.log('lineWidth:', 10, '→', refetched.getState_LineWidth());
365
- console.log('layer:', 1, '→', refetched.getState_Layer());
366
- ```
367
-
368
- ### getadjacentprimitives
369
-
370
- # IPCB\_PrimitiveLine.getAdjacentPrimitives() method
371
-
372
- > 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.
373
-
374
- Get Adjacent primitive objects
375
-
376
- ## Signature
377
-
378
- ```typescript
379
- function getAdjacentPrimitives(): Promise<
380
- Array<IPCB_PrimitiveLine | IPCB_PrimitiveVia | IPCB_PrimitiveArc>
381
- >;
382
- ```
383
-
384
- ## Returns
385
-
386
- Promise&lt;Array&lt;[IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md) \| [IPCB\_PrimitiveVia](./IPCB_PrimitiveVia.md) \| [IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md)<!-- -->&gt;&gt;
387
-
388
- Adjacent line, via, and arc-line primitive objects
389
-
390
- ## Remarks
391
-
392
- It will get the line, via, and arc-line primitive objects directly connected to both ends of the line
393
-
394
- ## Example
395
-
396
- ```javascript
397
- // 1. 创建一条直线走线,终点落在 (7500, 7000)
398
- const line = await eda.pcb_PrimitiveLine.create('', 1, 7000, 7000, 7500, 7000, 10);
399
-
400
- // 2. 创建一段圆弧,起点与直线终点重合,两段构成一整段导线
401
- const arc = await eda.pcb_PrimitiveArc.create('', 1, 7500, 7000, 7800, 7300, 90, 10, 1, false);
402
-
403
- // 3. 获取与直线直接相连的图元,并读出各自的类型
404
- const adjacent = await line.getAdjacentPrimitives();
405
-
406
- // 4. 清理测试图元(查询类案例不留测试对象)
407
- await eda.pcb_PrimitiveLine.delete([line.getState_PrimitiveId()]);
408
- await eda.pcb_PrimitiveArc.delete([arc.getState_PrimitiveId()]);
409
-
410
- console.log('adjacent count:', adjacent.length);
411
- adjacent.forEach((p, i) => {
412
- console.log(`adjacent[${i}] type:`, p.getState_PrimitiveType());
413
- });
414
- ```
415
-
416
- ### getentiretrack
417
-
418
- # IPCB\_PrimitiveLine.getEntireTrack() method
419
-
420
- > 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.
421
-
422
- Get the entire wire
423
-
424
- ## Signature
425
-
426
- ```typescript
427
- function getEntireTrack(includeVias: false): Promise<Array<IPCB_PrimitiveLine | IPCB_PrimitiveArc>>;
428
- ```
429
-
430
- ## Parameters
431
-
432
- <table><thead><tr><th>
433
-
434
- Parameter
435
-
436
- </th><th>
437
-
438
- Type
439
-
440
- </th><th>
441
-
442
- Description
443
-
444
- </th></tr></thead>
445
- <tbody><tr><td>
446
-
447
- includeVias
448
-
449
- </td><td>
450
-
451
- false
452
-
453
- </td><td>
454
-
455
- Whether to include the vias at both ends of the wire
456
-
457
- </td></tr>
458
- </tbody></table>
459
-
460
- ## Returns
461
-
462
- Promise&lt;Array&lt;[IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md) \| [IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md)<!-- -->&gt;&gt;
463
-
464
- All lines and arc lines in the entire wire
465
-
466
- ## Example
467
-
468
- ```javascript
469
- // 1. 创建一条直线走线,终点落在 (7500, 7000)
470
- const line = await eda.pcb_PrimitiveLine.create('', 1, 7000, 7000, 7500, 7000, 10);
471
-
472
- // 2. 创建一段圆弧,起点与直线终点重合,两段构成一整段导线
473
- const arc = await eda.pcb_PrimitiveArc.create('', 1, 7500, 7000, 7800, 7300, 90, 10, 1, false);
474
-
475
- // 3. 只取导线内的直线和圆弧
476
- const trackOnly = await line.getEntireTrack(false);
477
-
478
- // 4. 连两端过孔一起取(本例两端没有过孔,数量不变)
479
- const trackWithVias = await line.getEntireTrack(true);
480
-
481
- // 5. 清理测试图元(查询类案例不留测试对象)
482
- await eda.pcb_PrimitiveLine.delete([line.getState_PrimitiveId()]);
483
- await eda.pcb_PrimitiveArc.delete([arc.getState_PrimitiveId()]);
484
-
485
- console.log('track(false) count:', trackOnly.length);
486
- trackOnly.forEach((p, i) => {
487
- console.log(`track(false)[${i}] type:`, p.getState_PrimitiveType());
488
- });
489
- console.log('track(true) count:', trackWithVias.length);
490
- ```
491
-
492
- ### getentiretrack_1
493
-
494
- # IPCB\_PrimitiveLine.getEntireTrack() method
495
-
496
- > 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.
497
-
498
- Get the entire wire
499
-
500
- ## Signature
501
-
502
- ```typescript
503
- function getEntireTrack(
504
- includeVias: true,
505
- ): Promise<Array<IPCB_PrimitiveLine | IPCB_PrimitiveArc | IPCB_PrimitiveVia>>;
506
- ```
507
-
508
- ## Parameters
509
-
510
- <table><thead><tr><th>
511
-
512
- Parameter
513
-
514
- </th><th>
515
-
516
- Type
517
-
518
- </th><th>
519
-
520
- Description
521
-
522
- </th></tr></thead>
523
- <tbody><tr><td>
524
-
525
- includeVias
526
-
527
- </td><td>
528
-
529
- true
530
-
531
- </td><td>
532
-
533
- Whether to include the vias at both ends of the wire
534
-
535
- </td></tr>
536
- </tbody></table>
537
-
538
- ## Returns
539
-
540
- Promise&lt;Array&lt;[IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md) \| [IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md) \| [IPCB\_PrimitiveVia](./IPCB_PrimitiveVia.md)<!-- -->&gt;&gt;
541
-
542
- All lines and arc lines in the entire wire, as well as the vias connected at both ends (if any)
543
-
544
- ### getstate_endx
545
-
546
- # IPCB\_PrimitiveLine.getState\_EndX() method
547
-
548
- Get the property state: end position X
549
-
550
- ## Signature
551
-
552
- ```typescript
553
- function getState_EndX(): number;
554
- ```
555
-
556
- ## Returns
557
-
558
- number
559
-
560
- End position X
561
-
562
- ## Example
563
-
564
- ```javascript
565
- // 1. 创建一条测试直线,终点 (1600, 1000)
566
- const line = await eda.pcb_PrimitiveLine.create('', 1, 1000, 1000, 1600, 1000, 10);
567
-
568
- // 2. 读取终点 X
569
- const endX = line.getState_EndX();
570
-
571
- // 3. 清理测试图元(查询类案例不留测试对象)
572
- await eda.pcb_PrimitiveLine.delete([line.getState_PrimitiveId()]);
573
-
574
- console.log('endX:', endX);
575
- ```
576
-
577
- ### getstate_endy
578
-
579
- # IPCB\_PrimitiveLine.getState\_EndY() method
580
-
581
- Get the property state: end position Y
582
-
583
- ## Signature
584
-
585
- ```typescript
586
- function getState_EndY(): number;
587
- ```
588
-
589
- ## Returns
590
-
591
- number
592
-
593
- End position Y
594
-
595
- ## Example
596
-
597
- ```javascript
598
- // 1. 创建一条测试直线,终点 (1600, 1000)
599
- const line = await eda.pcb_PrimitiveLine.create('', 1, 1000, 1000, 1600, 1000, 10);
600
-
601
- // 2. 读取终点 Y
602
- const endY = line.getState_EndY();
603
-
604
- // 3. 清理测试图元(查询类案例不留测试对象)
605
- await eda.pcb_PrimitiveLine.delete([line.getState_PrimitiveId()]);
606
-
607
- console.log('endY:', endY);
608
- ```
609
-
610
- ### getstate_layer
611
-
612
- # IPCB\_PrimitiveLine.getState\_Layer() method
613
-
614
- Get the property state: Layer
615
-
616
- ## Signature
617
-
618
- ```typescript
619
- function getState_Layer(): TPCB_LayersOfLine;
620
- ```
621
-
622
- ## Returns
623
-
624
- [TPCB\_LayersOfLine](../types/TPCB_LayersOfLine.md)
625
-
626
- Layer
627
-
628
- ## Example
629
-
630
- ```javascript
631
- // 1. 创建一条顶层(1)测试直线
632
- const line = await eda.pcb_PrimitiveLine.create('', 1, 1000, 1000, 1600, 1000, 10);
633
-
634
- // 2. 读取所在层
635
- const layer = line.getState_Layer();
636
-
637
- // 3. 清理测试图元(查询类案例不留测试对象)
638
- await eda.pcb_PrimitiveLine.delete([line.getState_PrimitiveId()]);
639
-
640
- console.log('layer:', layer);
641
- ```
642
-
643
- ### getstate_linewidth
644
-
645
- # IPCB\_PrimitiveLine.getState\_LineWidth() method
646
-
647
- Get the property state: Line width
648
-
649
- ## Signature
650
-
651
- ```typescript
652
- function getState_LineWidth(): number;
653
- ```
654
-
655
- ## Returns
656
-
657
- number
658
-
659
- Line width
660
-
661
- ## Example
662
-
663
- ```javascript
664
- // 1. 创建一条 10mil 线宽的测试直线
665
- const line = await eda.pcb_PrimitiveLine.create('', 1, 1000, 1000, 1600, 1000, 10);
666
-
667
- // 2. 读取线宽
668
- const lineWidth = line.getState_LineWidth();
669
-
670
- // 3. 清理测试图元(查询类案例不留测试对象)
671
- await eda.pcb_PrimitiveLine.delete([line.getState_PrimitiveId()]);
672
-
673
- console.log('lineWidth:', lineWidth);
674
- ```
675
-
676
- ### getstate_net
677
-
678
- # IPCB\_PrimitiveLine.getState\_Net() method
679
-
680
- Get the property state: net name
681
-
682
- ## Signature
683
-
684
- ```typescript
685
- function getState_Net(): string;
686
- ```
687
-
688
- ## Returns
689
-
690
- string
691
-
692
- Net name
693
-
694
- ## Example
695
-
696
- ```javascript
697
- // 1. 创建一条指定网络的测试直线
698
- const line = await eda.pcb_PrimitiveLine.create('嘉立创示例_NET', 1, 1000, 1000, 1600, 1000, 10);
699
-
700
- // 2. 读取网络名称
701
- const net = line.getState_Net();
702
-
703
- // 3. 清理测试图元(查询类案例不留测试对象)
704
- await eda.pcb_PrimitiveLine.delete([line.getState_PrimitiveId()]);
705
-
706
- console.log('net:', net);
707
- ```
708
-
709
- ### getstate_primitiveid
710
-
711
- # IPCB\_PrimitiveLine.getState\_PrimitiveId() method
712
-
713
- Get the property state: primitive ID
714
-
715
- ## Signature
716
-
717
- ```typescript
718
- function getState_PrimitiveId(): string;
719
- ```
720
-
721
- ## Returns
722
-
723
- string
724
-
725
- Primitive ID
726
-
727
- ## Example
728
-
729
- ```javascript
730
- // 1. 创建一条测试直线
731
- const line = await eda.pcb_PrimitiveLine.create('', 1, 1000, 1000, 1600, 1000, 10);
732
-
733
- // 2. 读取图元 ID
734
- const primitiveId = line.getState_PrimitiveId();
735
-
736
- // 3. 用该 ID 从画布重新取回直线,验证 ID 有效
737
- const refetched = await eda.pcb_PrimitiveLine.get(primitiveId);
738
-
739
- // 4. 清理测试图元(查询类案例不留测试对象)
740
- await eda.pcb_PrimitiveLine.delete([primitiveId]);
741
-
742
- console.log('primitiveId:', primitiveId);
743
- console.log('refetched type:', refetched.getState_PrimitiveType());
744
- ```
745
-
746
- ### getstate_primitivelock
747
-
748
- # IPCB\_PrimitiveLine.getState\_PrimitiveLock() method
749
-
750
- Get the property state: whether it is locked
751
-
752
- ## Signature
753
-
754
- ```typescript
755
- function getState_PrimitiveLock(): boolean;
756
- ```
757
-
758
- ## Returns
759
-
760
- boolean
761
-
762
- Whether it is locked
763
-
764
- ## Example
765
-
766
- ```javascript
767
- // 1. 创建一条测试直线(默认不锁定)
768
- const line = await eda.pcb_PrimitiveLine.create('', 1, 1000, 1000, 1600, 1000, 10);
769
-
770
- // 2. 读取锁定状态
771
- const locked = line.getState_PrimitiveLock();
772
-
773
- // 3. 清理测试图元(查询类案例不留测试对象)
774
- await eda.pcb_PrimitiveLine.delete([line.getState_PrimitiveId()]);
775
-
776
- console.log('locked:', locked);
777
- ```
778
-
779
- ### getstate_primitivetype
780
-
781
- # IPCB\_PrimitiveLine.getState\_PrimitiveType() method
782
-
783
- Get the property state: primitive type
784
-
785
- ## Signature
786
-
787
- ```typescript
788
- function getState_PrimitiveType(): EPCB_PrimitiveType;
789
- ```
790
-
791
- ## Returns
792
-
793
- [EPCB\_PrimitiveType](../enums/EPCB_PrimitiveType.md)
794
-
795
- Primitive type
796
-
797
- ## Example
798
-
799
- ```javascript
800
- // 1. 创建一条测试直线
801
- const line = await eda.pcb_PrimitiveLine.create('', 1, 1000, 1000, 1600, 1000, 10);
802
-
803
- // 2. 读取图元类型
804
- const type = line.getState_PrimitiveType();
805
-
806
- // 3. 清理测试图元(查询类案例不留测试对象)
807
- await eda.pcb_PrimitiveLine.delete([line.getState_PrimitiveId()]);
808
-
809
- console.log('type:', type);
810
- ```
811
-
812
- ### getstate_startx
813
-
814
- # IPCB\_PrimitiveLine.getState\_StartX() method
815
-
816
- Get the property state: start position X
817
-
818
- ## Signature
819
-
820
- ```typescript
821
- function getState_StartX(): number;
822
- ```
823
-
824
- ## Returns
825
-
826
- number
827
-
828
- Start position X
829
-
830
- ## Example
831
-
832
- ```javascript
833
- // 1. 创建一条测试直线,起点 (1000, 1000)
834
- const line = await eda.pcb_PrimitiveLine.create('', 1, 1000, 1000, 1600, 1000, 10);
835
-
836
- // 2. 读取起点 X
837
- const startX = line.getState_StartX();
838
-
839
- // 3. 清理测试图元(查询类案例不留测试对象)
840
- await eda.pcb_PrimitiveLine.delete([line.getState_PrimitiveId()]);
841
-
842
- console.log('startX:', startX);
843
- ```
844
-
845
- ### getstate_starty
846
-
847
- # IPCB\_PrimitiveLine.getState\_StartY() method
848
-
849
- Get the property state: start position Y
850
-
851
- ## Signature
852
-
853
- ```typescript
854
- function getState_StartY(): number;
855
- ```
856
-
857
- ## Returns
858
-
859
- number
860
-
861
- Start position Y
862
-
863
- ## Example
864
-
865
- ```javascript
866
- // 1. 创建一条测试直线,起点 (1000, 1000)
867
- const line = await eda.pcb_PrimitiveLine.create('', 1, 1000, 1000, 1600, 1000, 10);
868
-
869
- // 2. 读取起点 Y
870
- const startY = line.getState_StartY();
871
-
872
- // 3. 清理测试图元(查询类案例不留测试对象)
873
- await eda.pcb_PrimitiveLine.delete([line.getState_PrimitiveId()]);
874
-
875
- console.log('startY:', startY);
876
- ```
877
-
878
- ### isasync
879
-
880
- # IPCB\_PrimitiveLine.isAsync() method
881
-
882
- Query whether the primitive is an async primitive
883
-
884
- ## Signature
885
-
886
- ```typescript
887
- function isAsync(): boolean;
888
- ```
889
-
890
- ## Returns
891
-
892
- boolean
893
-
894
- Whether Is async primitive
895
-
896
- ## Example
897
-
898
- ```javascript
899
- // 1. 创建一条测试直线,读出创建后的默认模式
900
- const line = await eda.pcb_PrimitiveLine.create('', 1, 1000, 1000, 1600, 1000, 10);
901
- const asyncOnCreate = line.isAsync();
902
-
903
- // 2. 切换到同步模式再查询一次,对比两种模式
904
- line.toSync();
905
- const asyncAfterToSync = line.isAsync();
906
-
907
- // 3. 清理测试图元(查询类案例不留测试对象)
908
- await eda.pcb_PrimitiveLine.delete([line.getState_PrimitiveId()]);
909
-
910
- console.log('isAsync on create:', asyncOnCreate);
911
- console.log('isAsync after toSync:', asyncAfterToSync);
912
- ```
913
-
914
- ### reset
915
-
916
- # IPCB\_PrimitiveLine.reset() method
917
-
918
- > 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.
919
-
920
- Reset the async primitive to the current canvas state
921
-
922
- ## Signature
923
-
924
- ```typescript
925
- function reset(): Promise<IPCB_PrimitiveLine>;
926
- ```
927
-
928
- ## Returns
929
-
930
- Promise&lt;[IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md)<!-- -->&gt;
931
-
932
- Line primitive object
933
-
934
- ## Example
935
-
936
- ```javascript
937
- // 1. 生成本次运行专用的坐标,避免与之前保留的测试走线重合
938
- const x = 46000 + (Math.floor(Math.random() * 100000));
939
- const y = 2000 + (Math.floor(Math.random() * 100000));
940
-
941
- // 2. 创建一条 10mil 线宽的测试直线
942
- const line = await eda.pcb_PrimitiveLine.create('', 1, x, y, x + 600, y, 10);
943
-
944
- // 3. 切换异步模式,累计一处未提交的线宽修改(10 → 99)
945
- const asyncLine = line.toAsync();
946
- asyncLine.setState_LineWidth(99);
947
-
948
- // 4. 重置:丢弃未提交的修改,回到画布当前状态
949
- await asyncLine.reset();
950
-
951
- // 5. 从画布重新读取,线宽仍是 10(保留现场供观察)
952
- const refetched = await eda.pcb_PrimitiveLine.get(line.getState_PrimitiveId());
953
-
954
- console.log('lineWidth after reset:', refetched.getState_LineWidth());
955
- ```
956
-
957
- ### setstate_endx
958
-
959
- # IPCB\_PrimitiveLine.setState\_EndX() method
960
-
961
- > 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.
962
-
963
- Set the property state: end position X
964
-
965
- ## Signature
966
-
967
- ```typescript
968
- function setState_EndX(endX: number): IPCB_PrimitiveLine;
969
- ```
970
-
971
- ## Parameters
972
-
973
- <table><thead><tr><th>
974
-
975
- Parameter
976
-
977
- </th><th>
978
-
979
- Type
980
-
981
- </th><th>
982
-
983
- Description
984
-
985
- </th></tr></thead>
986
- <tbody><tr><td>
987
-
988
- endX
989
-
990
- </td><td>
991
-
992
- number
993
-
994
- </td><td>
995
-
996
- End position X
997
-
998
- </td></tr>
999
- </tbody></table>
1000
-
1001
- ## Returns
1002
-
1003
- [IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md)
1004
-
1005
- Line primitive object
1006
-
1007
- ## Example
1008
-
1009
- ```javascript
1010
- // 1. 生成本次运行专用的坐标,避免与之前保留的测试走线重合
1011
- const x = 14000 + (Math.floor(Math.random() * 100000));
1012
- const y = 2000 + (Math.floor(Math.random() * 100000));
1013
-
1014
- // 2. 创建一条测试直线,终点 (x + 600, y)
1015
- const line = await eda.pcb_PrimitiveLine.create('', 1, x, y, x + 600, y, 10);
1016
-
1017
- // 3. 读取修改前的终点 X
1018
- const before = line.getState_EndX();
1019
-
1020
- // 4. 切换异步模式并拉长终点(右移 300mil)
1021
- const asyncLine = line.toAsync();
1022
- asyncLine.setState_EndX(x + 900);
1023
- await asyncLine.done();
1024
-
1025
- // 5. 从画布重新读取,确认修改已生效(保留现场供观察)
1026
- const refetched = await eda.pcb_PrimitiveLine.get(line.getState_PrimitiveId());
1027
- const after = refetched.getState_EndX();
1028
-
1029
- console.log('endX:', before, '→', after);
1030
- ```
1031
-
1032
- ### setstate_endy
1033
-
1034
- # IPCB\_PrimitiveLine.setState\_EndY() method
1035
-
1036
- > 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.
1037
-
1038
- Set the property state: end position Y
1039
-
1040
- ## Signature
1041
-
1042
- ```typescript
1043
- function setState_EndY(endY: number): IPCB_PrimitiveLine;
1044
- ```
1045
-
1046
- ## Parameters
1047
-
1048
- <table><thead><tr><th>
1049
-
1050
- Parameter
1051
-
1052
- </th><th>
1053
-
1054
- Type
1055
-
1056
- </th><th>
1057
-
1058
- Description
1059
-
1060
- </th></tr></thead>
1061
- <tbody><tr><td>
1062
-
1063
- endY
1064
-
1065
- </td><td>
1066
-
1067
- number
1068
-
1069
- </td><td>
1070
-
1071
- End position Y
1072
-
1073
- </td></tr>
1074
- </tbody></table>
1075
-
1076
- ## Returns
1077
-
1078
- [IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md)
1079
-
1080
- Line primitive object
1081
-
1082
- ## Example
1083
-
1084
- ```javascript
1085
- // 1. 生成本次运行专用的坐标,避免与之前保留的测试走线重合
1086
- const x = 18000 + (Math.floor(Math.random() * 100000));
1087
- const y = 2000 + (Math.floor(Math.random() * 100000));
1088
-
1089
- // 2. 创建一条测试直线,终点 (x + 600, y)
1090
- const line = await eda.pcb_PrimitiveLine.create('', 1, x, y, x + 600, y, 10);
1091
-
1092
- // 3. 读取修改前的终点 Y
1093
- const before = line.getState_EndY();
1094
-
1095
- // 4. 切换异步模式并抬高终点(上移 300mil)
1096
- const asyncLine = line.toAsync();
1097
- asyncLine.setState_EndY(y + 300);
1098
- await asyncLine.done();
1099
-
1100
- // 5. 从画布重新读取,确认修改已生效(保留现场供观察)
1101
- const refetched = await eda.pcb_PrimitiveLine.get(line.getState_PrimitiveId());
1102
- const after = refetched.getState_EndY();
1103
-
1104
- console.log('endY:', before, '→', after);
1105
- ```
1106
-
1107
- ### setstate_layer
1108
-
1109
- # IPCB\_PrimitiveLine.setState\_Layer() method
1110
-
1111
- > 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.
1112
-
1113
- Set the property state: Layer
1114
-
1115
- ## Signature
1116
-
1117
- ```typescript
1118
- function setState_Layer(layer: TPCB_LayersOfLine): IPCB_PrimitiveLine;
1119
- ```
1120
-
1121
- ## Parameters
1122
-
1123
- <table><thead><tr><th>
1124
-
1125
- Parameter
1126
-
1127
- </th><th>
1128
-
1129
- Type
1130
-
1131
- </th><th>
1132
-
1133
- Description
1134
-
1135
- </th></tr></thead>
1136
- <tbody><tr><td>
1137
-
1138
- layer
1139
-
1140
- </td><td>
1141
-
1142
- [TPCB\_LayersOfLine](../types/TPCB_LayersOfLine.md)
1143
-
1144
- </td><td>
1145
-
1146
- Layer
1147
-
1148
- </td></tr>
1149
- </tbody></table>
1150
-
1151
- ## Returns
1152
-
1153
- [IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md)
1154
-
1155
- Line primitive object
1156
-
1157
- ## Example
1158
-
1159
- ```javascript
1160
- // 1. 生成本次运行专用的坐标,避免与之前保留的测试走线重合
1161
- const x = 22000 + (Math.floor(Math.random() * 100000));
1162
- const y = 2000 + (Math.floor(Math.random() * 100000));
1163
-
1164
- // 2. 创建一条顶层(1)测试直线
1165
- const line = await eda.pcb_PrimitiveLine.create('', 1, x, y, x + 600, y, 10);
1166
-
1167
- // 3. 读取修改前的层
1168
- const before = line.getState_Layer();
1169
-
1170
- // 4. 切换异步模式并换层(顶层 1 → 底层 2)
1171
- const asyncLine = line.toAsync();
1172
- asyncLine.setState_Layer(2);
1173
- await asyncLine.done();
1174
-
1175
- // 5. 从画布重新读取,确认修改已生效(保留现场供观察)
1176
- const refetched = await eda.pcb_PrimitiveLine.get(line.getState_PrimitiveId());
1177
- const after = refetched.getState_Layer();
1178
-
1179
- console.log('layer:', before, '→', after);
1180
- ```
1181
-
1182
- ### setstate_linewidth
1183
-
1184
- # IPCB\_PrimitiveLine.setState\_LineWidth() method
1185
-
1186
- > 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.
1187
-
1188
- Set the property state: Line width
1189
-
1190
- ## Signature
1191
-
1192
- ```typescript
1193
- function setState_LineWidth(lineWidth: number): IPCB_PrimitiveLine;
1194
- ```
1195
-
1196
- ## Parameters
1197
-
1198
- <table><thead><tr><th>
1199
-
1200
- Parameter
1201
-
1202
- </th><th>
1203
-
1204
- Type
1205
-
1206
- </th><th>
1207
-
1208
- Description
1209
-
1210
- </th></tr></thead>
1211
- <tbody><tr><td>
1212
-
1213
- lineWidth
1214
-
1215
- </td><td>
1216
-
1217
- number
1218
-
1219
- </td><td>
1220
-
1221
- Line width
1222
-
1223
- </td></tr>
1224
- </tbody></table>
1225
-
1226
- ## Returns
1227
-
1228
- [IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md)
1229
-
1230
- Line primitive object
1231
-
1232
- ## Example
1233
-
1234
- ```javascript
1235
- // 1. 生成本次运行专用的坐标,避免与之前保留的测试走线重合
1236
- const x = 26000 + (Math.floor(Math.random() * 100000));
1237
- const y = 2000 + (Math.floor(Math.random() * 100000));
1238
-
1239
- // 2. 创建一条 10mil 线宽的测试直线
1240
- const line = await eda.pcb_PrimitiveLine.create('', 1, x, y, x + 600, y, 10);
1241
-
1242
- // 3. 读取修改前的线宽
1243
- const before = line.getState_LineWidth();
1244
-
1245
- // 4. 切换异步模式并加宽(10 → 24)
1246
- const asyncLine = line.toAsync();
1247
- asyncLine.setState_LineWidth(24);
1248
- await asyncLine.done();
1249
-
1250
- // 5. 从画布重新读取,确认修改已生效(保留现场供观察)
1251
- const refetched = await eda.pcb_PrimitiveLine.get(line.getState_PrimitiveId());
1252
- const after = refetched.getState_LineWidth();
1253
-
1254
- console.log('lineWidth:', before, '→', after);
1255
- ```
1256
-
1257
- ### setstate_net
1258
-
1259
- # IPCB\_PrimitiveLine.setState\_Net() method
1260
-
1261
- > 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.
1262
-
1263
- Set the property state: net name
1264
-
1265
- ## Signature
1266
-
1267
- ```typescript
1268
- function setState_Net(net: string): IPCB_PrimitiveLine;
1269
- ```
1270
-
1271
- ## Parameters
1272
-
1273
- <table><thead><tr><th>
1274
-
1275
- Parameter
1276
-
1277
- </th><th>
1278
-
1279
- Type
1280
-
1281
- </th><th>
1282
-
1283
- Description
1284
-
1285
- </th></tr></thead>
1286
- <tbody><tr><td>
1287
-
1288
- net
1289
-
1290
- </td><td>
1291
-
1292
- string
1293
-
1294
- </td><td>
1295
-
1296
- Net name
1297
-
1298
- </td></tr>
1299
- </tbody></table>
1300
-
1301
- ## Returns
1302
-
1303
- [IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md)
1304
-
1305
- Line primitive object
1306
-
1307
- ## Example
1308
-
1309
- ```javascript
1310
- // 1. 生成本次运行专用的坐标,避免与之前保留的测试走线重合
1311
- const x = 30000 + (Math.floor(Math.random() * 100000));
1312
- const y = 2000 + (Math.floor(Math.random() * 100000));
1313
-
1314
- // 2. 创建一条无网络的测试直线
1315
- const line = await eda.pcb_PrimitiveLine.create('', 1, x, y, x + 600, y, 10);
1316
-
1317
- // 3. 读取修改前的网络名称
1318
- const before = line.getState_Net();
1319
-
1320
- // 4. 切换异步模式并指定网络('' → '嘉立创示例_NET')
1321
- const asyncLine = line.toAsync();
1322
- asyncLine.setState_Net('嘉立创示例_NET');
1323
- await asyncLine.done();
1324
-
1325
- // 5. 从画布重新读取,确认修改已生效(保留现场供观察)
1326
- const refetched = await eda.pcb_PrimitiveLine.get(line.getState_PrimitiveId());
1327
- const after = refetched.getState_Net();
1328
-
1329
- console.log('net:', before, '→', after);
1330
- ```
1331
-
1332
- ### setstate_primitivelock
1333
-
1334
- # IPCB\_PrimitiveLine.setState\_PrimitiveLock() method
1335
-
1336
- > 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.
1337
-
1338
- Set the property state: whether it is locked
1339
-
1340
- ## Signature
1341
-
1342
- ```typescript
1343
- function setState_PrimitiveLock(primitiveLock: boolean): IPCB_PrimitiveLine;
1344
- ```
1345
-
1346
- ## Parameters
1347
-
1348
- <table><thead><tr><th>
1349
-
1350
- Parameter
1351
-
1352
- </th><th>
1353
-
1354
- Type
1355
-
1356
- </th><th>
1357
-
1358
- Description
1359
-
1360
- </th></tr></thead>
1361
- <tbody><tr><td>
1362
-
1363
- primitiveLock
1364
-
1365
- </td><td>
1366
-
1367
- boolean
1368
-
1369
- </td><td>
1370
-
1371
- Whether it is locked
1372
-
1373
- </td></tr>
1374
- </tbody></table>
1375
-
1376
- ## Returns
1377
-
1378
- [IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md)
1379
-
1380
- Line primitive object
1381
-
1382
- ## Example
1383
-
1384
- ```javascript
1385
- // 1. 生成本次运行专用的坐标,避免与之前保留的测试走线重合
1386
- const x = 34000 + (Math.floor(Math.random() * 100000));
1387
- const y = 2000 + (Math.floor(Math.random() * 100000));
1388
-
1389
- // 2. 创建一条测试直线(默认不锁定)
1390
- const line = await eda.pcb_PrimitiveLine.create('', 1, x, y, x + 600, y, 10);
1391
-
1392
- // 3. 读取修改前的锁定状态
1393
- const before = line.getState_PrimitiveLock();
1394
-
1395
- // 4. 切换异步模式并锁定(false → true)
1396
- const asyncLine = line.toAsync();
1397
- asyncLine.setState_PrimitiveLock(true);
1398
- await asyncLine.done();
1399
-
1400
- // 5. 从画布重新读取,确认修改已生效(保留现场供观察)
1401
- const refetched = await eda.pcb_PrimitiveLine.get(line.getState_PrimitiveId());
1402
- const after = refetched.getState_PrimitiveLock();
1403
-
1404
- console.log('locked:', before, '→', after);
1405
- ```
1406
-
1407
- ### setstate_startx
1408
-
1409
- # IPCB\_PrimitiveLine.setState\_StartX() method
1410
-
1411
- > 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.
1412
-
1413
- Set the property state: start position X
1414
-
1415
- ## Signature
1416
-
1417
- ```typescript
1418
- function setState_StartX(startX: number): IPCB_PrimitiveLine;
1419
- ```
1420
-
1421
- ## Parameters
1422
-
1423
- <table><thead><tr><th>
1424
-
1425
- Parameter
1426
-
1427
- </th><th>
1428
-
1429
- Type
1430
-
1431
- </th><th>
1432
-
1433
- Description
1434
-
1435
- </th></tr></thead>
1436
- <tbody><tr><td>
1437
-
1438
- startX
1439
-
1440
- </td><td>
1441
-
1442
- number
1443
-
1444
- </td><td>
1445
-
1446
- Start position X
1447
-
1448
- </td></tr>
1449
- </tbody></table>
1450
-
1451
- ## Returns
1452
-
1453
- [IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md)
1454
-
1455
- Line primitive object
1456
-
1457
- ## Example
1458
-
1459
- ```javascript
1460
- // 1. 生成本次运行专用的坐标,避免与之前保留的测试走线重合
1461
- const x = 6000 + (Math.floor(Math.random() * 100000));
1462
- const y = 2000 + (Math.floor(Math.random() * 100000));
1463
-
1464
- // 2. 创建一条测试直线,起点 (x, y)
1465
- const line = await eda.pcb_PrimitiveLine.create('', 1, x, y, x + 600, y, 10);
1466
-
1467
- // 3. 读取修改前的起点 X
1468
- const before = line.getState_StartX();
1469
-
1470
- // 4. 切换异步模式并平移起点 X(右移 300mil)
1471
- const asyncLine = line.toAsync();
1472
- asyncLine.setState_StartX(x + 300);
1473
- await asyncLine.done();
1474
-
1475
- // 5. 从画布重新读取,确认修改已生效(保留现场供观察)
1476
- const refetched = await eda.pcb_PrimitiveLine.get(line.getState_PrimitiveId());
1477
- const after = refetched.getState_StartX();
1478
-
1479
- console.log('startX:', before, '→', after);
1480
- ```
1481
-
1482
- ### setstate_starty
1483
-
1484
- # IPCB\_PrimitiveLine.setState\_StartY() method
1485
-
1486
- > 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.
1487
-
1488
- Set the property state: start position Y
1489
-
1490
- ## Signature
1491
-
1492
- ```typescript
1493
- function setState_StartY(startY: number): IPCB_PrimitiveLine;
1494
- ```
1495
-
1496
- ## Parameters
1497
-
1498
- <table><thead><tr><th>
1499
-
1500
- Parameter
1501
-
1502
- </th><th>
1503
-
1504
- Type
1505
-
1506
- </th><th>
1507
-
1508
- Description
1509
-
1510
- </th></tr></thead>
1511
- <tbody><tr><td>
1512
-
1513
- startY
1514
-
1515
- </td><td>
1516
-
1517
- number
1518
-
1519
- </td><td>
1520
-
1521
- Start position Y
1522
-
1523
- </td></tr>
1524
- </tbody></table>
1525
-
1526
- ## Returns
1527
-
1528
- [IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md)
1529
-
1530
- Line primitive object
1531
-
1532
- ## Example
1533
-
1534
- ```javascript
1535
- // 1. 生成本次运行专用的坐标,避免与之前保留的测试走线重合
1536
- const x = 10000 + (Math.floor(Math.random() * 100000));
1537
- const y = 2000 + (Math.floor(Math.random() * 100000));
1538
-
1539
- // 2. 创建一条测试直线,起点 (x, y)
1540
- const line = await eda.pcb_PrimitiveLine.create('', 1, x, y, x + 600, y, 10);
1541
-
1542
- // 3. 读取修改前的起点 Y
1543
- const before = line.getState_StartY();
1544
-
1545
- // 4. 切换异步模式并平移起点 Y(上移 300mil)
1546
- const asyncLine = line.toAsync();
1547
- asyncLine.setState_StartY(y + 300);
1548
- await asyncLine.done();
1549
-
1550
- // 5. 从画布重新读取,确认修改已生效(保留现场供观察)
1551
- const refetched = await eda.pcb_PrimitiveLine.get(line.getState_PrimitiveId());
1552
- const after = refetched.getState_StartY();
1553
-
1554
- console.log('startY:', before, '→', after);
1555
- ```
1556
-
1557
- ### toasync
1558
-
1559
- # IPCB\_PrimitiveLine.toAsync() method
1560
-
1561
- Convert Primitive to Async primitive
1562
-
1563
- ## Signature
1564
-
1565
- ```typescript
1566
- function toAsync(): IPCB_PrimitiveLine;
1567
- ```
1568
-
1569
- ## Returns
1570
-
1571
- [IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md)
1572
-
1573
- Line primitive object
1574
-
1575
- ## Example
1576
-
1577
- ```javascript
1578
- // 1. 生成本次运行专用的坐标,避免与之前保留的测试走线重合
1579
- const x = 52000 + (Math.floor(Math.random() * 100000));
1580
- const y = 2000 + (Math.floor(Math.random() * 100000));
1581
-
1582
- // 2. 创建一条测试直线,切换到同步模式,让模式变化可观察
1583
- const line = await eda.pcb_PrimitiveLine.create('', 1, x, y, x + 600, y, 10);
1584
- line.toSync();
1585
-
1586
- // 3. 转换为异步图元
1587
- const asyncLine = line.toAsync();
1588
-
1589
- // 4. 异步模式下累计修改并提交
1590
- asyncLine.setState_LineWidth(24);
1591
- await asyncLine.done();
1592
-
1593
- // 5. 从画布重新读取,确认提交生效(保留现场供观察)
1594
- const refetched = await eda.pcb_PrimitiveLine.get(line.getState_PrimitiveId());
1595
-
1596
- console.log('isAsync after toAsync:', line.isAsync());
1597
- console.log('lineWidth:', 10, '→', refetched.getState_LineWidth());
1598
- ```
1599
-
1600
- ### tosync
1601
-
1602
- # IPCB\_PrimitiveLine.toSync() method
1603
-
1604
- Convert Primitive to Sync primitive
1605
-
1606
- ## Signature
1607
-
1608
- ```typescript
1609
- function toSync(): IPCB_PrimitiveLine;
1610
- ```
1611
-
1612
- ## Returns
1613
-
1614
- [IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md)
1615
-
1616
- Line primitive object
1617
-
1618
- ## Example
1619
-
1620
- ```javascript
1621
- // 1. 生成本次运行专用的坐标,避免与之前保留的测试走线重合
1622
- const x = 56000 + (Math.floor(Math.random() * 100000));
1623
- const y = 2000 + (Math.floor(Math.random() * 100000));
1624
-
1625
- // 2. 创建一条测试直线
1626
- const line = await eda.pcb_PrimitiveLine.create('', 1, x, y, x + 600, y, 10);
1627
-
1628
- // 3. 转换为同步图元
1629
- const syncLine = line.toSync();
1630
-
1631
- // 4. 同步模式下修改线宽,立即生效(无需 done())
1632
- syncLine.setState_LineWidth(40);
1633
-
1634
- // 5. 从画布重新读取,确认修改已生效(保留现场供观察)
1635
- const refetched = await eda.pcb_PrimitiveLine.get(line.getState_PrimitiveId());
1636
-
1637
- console.log('isSync after toSync:', !syncLine.isAsync());
1638
- console.log('lineWidth:', 10, '→', refetched.getState_LineWidth());
1639
- ```
1
+ # IPCB\_PrimitiveLine class
2
+
3
+ Line primitive
4
+
5
+ ## Signature
6
+
7
+ ```typescript
8
+ class IPCB_PrimitiveLine implements IPCB_Primitive
9
+ ```
10
+ **Implements:** [IPCB\_Primitive](../interfaces/IPCB_Primitive.md)
11
+
12
+ ## Remarks
13
+
14
+ Both lines and arc lines are wires, corresponding to the line traces and arc traces on the canvas
15
+
16
+ ## Methods
17
+
18
+ <table><thead><tr><th>
19
+
20
+ Method
21
+
22
+ </th><th>
23
+
24
+ Modifiers
25
+
26
+ </th><th>
27
+
28
+ Description
29
+
30
+ </th></tr></thead>
31
+ <tbody><tr><td>
32
+
33
+ [done()](./IPCB_PrimitiveLine.md)
34
+
35
+ </td><td>
36
+
37
+ </td><td>
38
+
39
+ **_(BETA)_** Apply the changes to the primitives to the canvas
40
+
41
+ </td></tr>
42
+ <tr><td>
43
+
44
+ [getAdjacentPrimitives()](./IPCB_PrimitiveLine.md)
45
+
46
+ </td><td>
47
+
48
+ </td><td>
49
+
50
+ **_(BETA)_** Get Adjacent primitive objects
51
+
52
+ </td></tr>
53
+ <tr><td>
54
+
55
+ [getEntireTrack(includeVias)](./IPCB_PrimitiveLine.md)
56
+
57
+ </td><td>
58
+
59
+ </td><td>
60
+
61
+ **_(BETA)_** Get the entire wire
62
+
63
+ </td></tr>
64
+ <tr><td>
65
+
66
+ [getEntireTrack(includeVias)](./IPCB_PrimitiveLine.md)
67
+
68
+ </td><td>
69
+
70
+ </td><td>
71
+
72
+ **_(BETA)_** Get the entire wire
73
+
74
+ </td></tr>
75
+ <tr><td>
76
+
77
+ [getState\_EndX()](./IPCB_PrimitiveLine.md)
78
+
79
+ </td><td>
80
+
81
+ </td><td>
82
+
83
+ Get the property state: end position X
84
+
85
+ </td></tr>
86
+ <tr><td>
87
+
88
+ [getState\_EndY()](./IPCB_PrimitiveLine.md)
89
+
90
+ </td><td>
91
+
92
+ </td><td>
93
+
94
+ Get the property state: end position Y
95
+
96
+ </td></tr>
97
+ <tr><td>
98
+
99
+ [getState\_Layer()](./IPCB_PrimitiveLine.md)
100
+
101
+ </td><td>
102
+
103
+ </td><td>
104
+
105
+ Get the property state: Layer
106
+
107
+ </td></tr>
108
+ <tr><td>
109
+
110
+ [getState\_LineWidth()](./IPCB_PrimitiveLine.md)
111
+
112
+ </td><td>
113
+
114
+ </td><td>
115
+
116
+ Get the property state: Line width
117
+
118
+ </td></tr>
119
+ <tr><td>
120
+
121
+ [getState\_Net()](./IPCB_PrimitiveLine.md)
122
+
123
+ </td><td>
124
+
125
+ </td><td>
126
+
127
+ Get the property state: net name
128
+
129
+ </td></tr>
130
+ <tr><td>
131
+
132
+ [getState\_PrimitiveId()](./IPCB_PrimitiveLine.md)
133
+
134
+ </td><td>
135
+
136
+ </td><td>
137
+
138
+ Get the property state: primitive ID
139
+
140
+ </td></tr>
141
+ <tr><td>
142
+
143
+ [getState\_PrimitiveLock()](./IPCB_PrimitiveLine.md)
144
+
145
+ </td><td>
146
+
147
+ </td><td>
148
+
149
+ Get the property state: whether it is locked
150
+
151
+ </td></tr>
152
+ <tr><td>
153
+
154
+ [getState\_PrimitiveType()](./IPCB_PrimitiveLine.md)
155
+
156
+ </td><td>
157
+
158
+ </td><td>
159
+
160
+ Get the property state: primitive type
161
+
162
+ </td></tr>
163
+ <tr><td>
164
+
165
+ [getState\_StartX()](./IPCB_PrimitiveLine.md)
166
+
167
+ </td><td>
168
+
169
+ </td><td>
170
+
171
+ Get the property state: start position X
172
+
173
+ </td></tr>
174
+ <tr><td>
175
+
176
+ [getState\_StartY()](./IPCB_PrimitiveLine.md)
177
+
178
+ </td><td>
179
+
180
+ </td><td>
181
+
182
+ Get the property state: start position Y
183
+
184
+ </td></tr>
185
+ <tr><td>
186
+
187
+ [isAsync()](./IPCB_PrimitiveLine.md)
188
+
189
+ </td><td>
190
+
191
+ </td><td>
192
+
193
+ Query whether the primitive is an async primitive
194
+
195
+ </td></tr>
196
+ <tr><td>
197
+
198
+ [reset()](./IPCB_PrimitiveLine.md)
199
+
200
+ </td><td>
201
+
202
+ </td><td>
203
+
204
+ **_(BETA)_** Reset the async primitive to the current canvas state
205
+
206
+ </td></tr>
207
+ <tr><td>
208
+
209
+ [setState\_EndX(endX)](./IPCB_PrimitiveLine.md)
210
+
211
+ </td><td>
212
+
213
+ </td><td>
214
+
215
+ **_(BETA)_** Set the property state: end position X
216
+
217
+ </td></tr>
218
+ <tr><td>
219
+
220
+ [setState\_EndY(endY)](./IPCB_PrimitiveLine.md)
221
+
222
+ </td><td>
223
+
224
+ </td><td>
225
+
226
+ **_(BETA)_** Set the property state: end position Y
227
+
228
+ </td></tr>
229
+ <tr><td>
230
+
231
+ [setState\_Layer(layer)](./IPCB_PrimitiveLine.md)
232
+
233
+ </td><td>
234
+
235
+ </td><td>
236
+
237
+ **_(BETA)_** Set the property state: Layer
238
+
239
+ </td></tr>
240
+ <tr><td>
241
+
242
+ [setState\_LineWidth(lineWidth)](./IPCB_PrimitiveLine.md)
243
+
244
+ </td><td>
245
+
246
+ </td><td>
247
+
248
+ **_(BETA)_** Set the property state: Line width
249
+
250
+ </td></tr>
251
+ <tr><td>
252
+
253
+ [setState\_Net(net)](./IPCB_PrimitiveLine.md)
254
+
255
+ </td><td>
256
+
257
+ </td><td>
258
+
259
+ **_(BETA)_** Set the property state: net name
260
+
261
+ </td></tr>
262
+ <tr><td>
263
+
264
+ [setState\_PrimitiveLock(primitiveLock)](./IPCB_PrimitiveLine.md)
265
+
266
+ </td><td>
267
+
268
+ </td><td>
269
+
270
+ **_(BETA)_** Set the property state: whether it is locked
271
+
272
+ </td></tr>
273
+ <tr><td>
274
+
275
+ [setState\_StartX(startX)](./IPCB_PrimitiveLine.md)
276
+
277
+ </td><td>
278
+
279
+ </td><td>
280
+
281
+ **_(BETA)_** Set the property state: start position X
282
+
283
+ </td></tr>
284
+ <tr><td>
285
+
286
+ [setState\_StartY(startY)](./IPCB_PrimitiveLine.md)
287
+
288
+ </td><td>
289
+
290
+ </td><td>
291
+
292
+ **_(BETA)_** Set the property state: start position Y
293
+
294
+ </td></tr>
295
+ <tr><td>
296
+
297
+ [toAsync()](./IPCB_PrimitiveLine.md)
298
+
299
+ </td><td>
300
+
301
+ </td><td>
302
+
303
+ Convert Primitive to Async primitive
304
+
305
+ </td></tr>
306
+ <tr><td>
307
+
308
+ [toSync()](./IPCB_PrimitiveLine.md)
309
+
310
+ </td><td>
311
+
312
+ </td><td>
313
+
314
+ Convert Primitive to Sync primitive
315
+
316
+ </td></tr>
317
+ </tbody></table>
318
+
319
+ ---
320
+
321
+ ## 方法详情
322
+
323
+ ### done
324
+
325
+ # IPCB\_PrimitiveLine.done() method
326
+
327
+ > 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.
328
+
329
+ Apply the changes to the primitives to the canvas
330
+
331
+ ## Signature
332
+
333
+ ```typescript
334
+ function done(): Promise<IPCB_PrimitiveLine>;
335
+ ```
336
+
337
+ ## Returns
338
+
339
+ Promise&lt;[IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md)<!-- -->&gt;
340
+
341
+ Line primitive object
342
+
343
+ ## Example
344
+
345
+ ```javascript
346
+ // 1. 生成本次运行专用的坐标,避免与之前保留的测试走线重合
347
+ const x = 42000 + (Math.floor(Math.random() * 100000));
348
+ const y = 2000 + (Math.floor(Math.random() * 100000));
349
+
350
+ // 2. 创建一条测试直线走线
351
+ const line = await eda.pcb_PrimitiveLine.create('', 1, x, y, x + 600, y, 10);
352
+
353
+ // 3. 切换异步模式,连续累计两处修改(线宽 + 换层)
354
+ const asyncLine = line.toAsync();
355
+ asyncLine.setState_LineWidth(24);
356
+ asyncLine.setState_Layer(2);
357
+
358
+ // 4. 一次性提交到画布
359
+ await asyncLine.done();
360
+
361
+ // 5. 从画布重新读取,确认两处修改都已生效(保留现场供观察)
362
+ const refetched = await eda.pcb_PrimitiveLine.get(line.getState_PrimitiveId());
363
+
364
+ console.log('lineWidth:', 10, '→', refetched.getState_LineWidth());
365
+ console.log('layer:', 1, '→', refetched.getState_Layer());
366
+ ```
367
+
368
+ ### getadjacentprimitives
369
+
370
+ # IPCB\_PrimitiveLine.getAdjacentPrimitives() method
371
+
372
+ > 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.
373
+
374
+ Get Adjacent primitive objects
375
+
376
+ ## Signature
377
+
378
+ ```typescript
379
+ function getAdjacentPrimitives(): Promise<
380
+ Array<IPCB_PrimitiveLine | IPCB_PrimitiveVia | IPCB_PrimitiveArc>
381
+ >;
382
+ ```
383
+
384
+ ## Returns
385
+
386
+ Promise&lt;Array&lt;[IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md) \| [IPCB\_PrimitiveVia](./IPCB_PrimitiveVia.md) \| [IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md)<!-- -->&gt;&gt;
387
+
388
+ Adjacent line, via, and arc-line primitive objects
389
+
390
+ ## Remarks
391
+
392
+ It will get the line, via, and arc-line primitive objects directly connected to both ends of the line
393
+
394
+ ## Example
395
+
396
+ ```javascript
397
+ // 1. 创建一条直线走线,终点落在 (7500, 7000)
398
+ const line = await eda.pcb_PrimitiveLine.create('', 1, 7000, 7000, 7500, 7000, 10);
399
+
400
+ // 2. 创建一段圆弧,起点与直线终点重合,两段构成一整段导线
401
+ const arc = await eda.pcb_PrimitiveArc.create('', 1, 7500, 7000, 7800, 7300, 90, 10, 1, false);
402
+
403
+ // 3. 获取与直线直接相连的图元,并读出各自的类型
404
+ const adjacent = await line.getAdjacentPrimitives();
405
+
406
+ // 4. 清理测试图元(查询类案例不留测试对象)
407
+ await eda.pcb_PrimitiveLine.delete([line.getState_PrimitiveId()]);
408
+ await eda.pcb_PrimitiveArc.delete([arc.getState_PrimitiveId()]);
409
+
410
+ console.log('adjacent count:', adjacent.length);
411
+ adjacent.forEach((p, i) => {
412
+ console.log(`adjacent[${i}] type:`, p.getState_PrimitiveType());
413
+ });
414
+ ```
415
+
416
+ ### getentiretrack
417
+
418
+ # IPCB\_PrimitiveLine.getEntireTrack() method
419
+
420
+ > 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.
421
+
422
+ Get the entire wire
423
+
424
+ ## Signature
425
+
426
+ ```typescript
427
+ function getEntireTrack(includeVias: false): Promise<Array<IPCB_PrimitiveLine | IPCB_PrimitiveArc>>;
428
+ ```
429
+
430
+ ## Parameters
431
+
432
+ <table><thead><tr><th>
433
+
434
+ Parameter
435
+
436
+ </th><th>
437
+
438
+ Type
439
+
440
+ </th><th>
441
+
442
+ Description
443
+
444
+ </th></tr></thead>
445
+ <tbody><tr><td>
446
+
447
+ includeVias
448
+
449
+ </td><td>
450
+
451
+ false
452
+
453
+ </td><td>
454
+
455
+ Whether to include the vias at both ends of the wire
456
+
457
+ </td></tr>
458
+ </tbody></table>
459
+
460
+ ## Returns
461
+
462
+ Promise&lt;Array&lt;[IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md) \| [IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md)<!-- -->&gt;&gt;
463
+
464
+ All lines and arc lines in the entire wire
465
+
466
+ ## Example
467
+
468
+ ```javascript
469
+ // 1. 创建一条直线走线,终点落在 (7500, 7000)
470
+ const line = await eda.pcb_PrimitiveLine.create('', 1, 7000, 7000, 7500, 7000, 10);
471
+
472
+ // 2. 创建一段圆弧,起点与直线终点重合,两段构成一整段导线
473
+ const arc = await eda.pcb_PrimitiveArc.create('', 1, 7500, 7000, 7800, 7300, 90, 10, 1, false);
474
+
475
+ // 3. 只取导线内的直线和圆弧
476
+ const trackOnly = await line.getEntireTrack(false);
477
+
478
+ // 4. 连两端过孔一起取(本例两端没有过孔,数量不变)
479
+ const trackWithVias = await line.getEntireTrack(true);
480
+
481
+ // 5. 清理测试图元(查询类案例不留测试对象)
482
+ await eda.pcb_PrimitiveLine.delete([line.getState_PrimitiveId()]);
483
+ await eda.pcb_PrimitiveArc.delete([arc.getState_PrimitiveId()]);
484
+
485
+ console.log('track(false) count:', trackOnly.length);
486
+ trackOnly.forEach((p, i) => {
487
+ console.log(`track(false)[${i}] type:`, p.getState_PrimitiveType());
488
+ });
489
+ console.log('track(true) count:', trackWithVias.length);
490
+ ```
491
+
492
+ ### getentiretrack_1
493
+
494
+ # IPCB\_PrimitiveLine.getEntireTrack() method
495
+
496
+ > 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.
497
+
498
+ Get the entire wire
499
+
500
+ ## Signature
501
+
502
+ ```typescript
503
+ function getEntireTrack(
504
+ includeVias: true,
505
+ ): Promise<Array<IPCB_PrimitiveLine | IPCB_PrimitiveArc | IPCB_PrimitiveVia>>;
506
+ ```
507
+
508
+ ## Parameters
509
+
510
+ <table><thead><tr><th>
511
+
512
+ Parameter
513
+
514
+ </th><th>
515
+
516
+ Type
517
+
518
+ </th><th>
519
+
520
+ Description
521
+
522
+ </th></tr></thead>
523
+ <tbody><tr><td>
524
+
525
+ includeVias
526
+
527
+ </td><td>
528
+
529
+ true
530
+
531
+ </td><td>
532
+
533
+ Whether to include the vias at both ends of the wire
534
+
535
+ </td></tr>
536
+ </tbody></table>
537
+
538
+ ## Returns
539
+
540
+ Promise&lt;Array&lt;[IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md) \| [IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md) \| [IPCB\_PrimitiveVia](./IPCB_PrimitiveVia.md)<!-- -->&gt;&gt;
541
+
542
+ All lines and arc lines in the entire wire, as well as the vias connected at both ends (if any)
543
+
544
+ ### getstate_endx
545
+
546
+ # IPCB\_PrimitiveLine.getState\_EndX() method
547
+
548
+ Get the property state: end position X
549
+
550
+ ## Signature
551
+
552
+ ```typescript
553
+ function getState_EndX(): number;
554
+ ```
555
+
556
+ ## Returns
557
+
558
+ number
559
+
560
+ End position X
561
+
562
+ ## Example
563
+
564
+ ```javascript
565
+ // 1. 创建一条测试直线,终点 (1600, 1000)
566
+ const line = await eda.pcb_PrimitiveLine.create('', 1, 1000, 1000, 1600, 1000, 10);
567
+
568
+ // 2. 读取终点 X
569
+ const endX = line.getState_EndX();
570
+
571
+ // 3. 清理测试图元(查询类案例不留测试对象)
572
+ await eda.pcb_PrimitiveLine.delete([line.getState_PrimitiveId()]);
573
+
574
+ console.log('endX:', endX);
575
+ ```
576
+
577
+ ### getstate_endy
578
+
579
+ # IPCB\_PrimitiveLine.getState\_EndY() method
580
+
581
+ Get the property state: end position Y
582
+
583
+ ## Signature
584
+
585
+ ```typescript
586
+ function getState_EndY(): number;
587
+ ```
588
+
589
+ ## Returns
590
+
591
+ number
592
+
593
+ End position Y
594
+
595
+ ## Example
596
+
597
+ ```javascript
598
+ // 1. 创建一条测试直线,终点 (1600, 1000)
599
+ const line = await eda.pcb_PrimitiveLine.create('', 1, 1000, 1000, 1600, 1000, 10);
600
+
601
+ // 2. 读取终点 Y
602
+ const endY = line.getState_EndY();
603
+
604
+ // 3. 清理测试图元(查询类案例不留测试对象)
605
+ await eda.pcb_PrimitiveLine.delete([line.getState_PrimitiveId()]);
606
+
607
+ console.log('endY:', endY);
608
+ ```
609
+
610
+ ### getstate_layer
611
+
612
+ # IPCB\_PrimitiveLine.getState\_Layer() method
613
+
614
+ Get the property state: Layer
615
+
616
+ ## Signature
617
+
618
+ ```typescript
619
+ function getState_Layer(): TPCB_LayersOfLine;
620
+ ```
621
+
622
+ ## Returns
623
+
624
+ [TPCB\_LayersOfLine](../types/TPCB_LayersOfLine.md)
625
+
626
+ Layer
627
+
628
+ ## Example
629
+
630
+ ```javascript
631
+ // 1. 创建一条顶层(1)测试直线
632
+ const line = await eda.pcb_PrimitiveLine.create('', 1, 1000, 1000, 1600, 1000, 10);
633
+
634
+ // 2. 读取所在层
635
+ const layer = line.getState_Layer();
636
+
637
+ // 3. 清理测试图元(查询类案例不留测试对象)
638
+ await eda.pcb_PrimitiveLine.delete([line.getState_PrimitiveId()]);
639
+
640
+ console.log('layer:', layer);
641
+ ```
642
+
643
+ ### getstate_linewidth
644
+
645
+ # IPCB\_PrimitiveLine.getState\_LineWidth() method
646
+
647
+ Get the property state: Line width
648
+
649
+ ## Signature
650
+
651
+ ```typescript
652
+ function getState_LineWidth(): number;
653
+ ```
654
+
655
+ ## Returns
656
+
657
+ number
658
+
659
+ Line width
660
+
661
+ ## Example
662
+
663
+ ```javascript
664
+ // 1. 创建一条 10mil 线宽的测试直线
665
+ const line = await eda.pcb_PrimitiveLine.create('', 1, 1000, 1000, 1600, 1000, 10);
666
+
667
+ // 2. 读取线宽
668
+ const lineWidth = line.getState_LineWidth();
669
+
670
+ // 3. 清理测试图元(查询类案例不留测试对象)
671
+ await eda.pcb_PrimitiveLine.delete([line.getState_PrimitiveId()]);
672
+
673
+ console.log('lineWidth:', lineWidth);
674
+ ```
675
+
676
+ ### getstate_net
677
+
678
+ # IPCB\_PrimitiveLine.getState\_Net() method
679
+
680
+ Get the property state: net name
681
+
682
+ ## Signature
683
+
684
+ ```typescript
685
+ function getState_Net(): string;
686
+ ```
687
+
688
+ ## Returns
689
+
690
+ string
691
+
692
+ Net name
693
+
694
+ ## Example
695
+
696
+ ```javascript
697
+ // 1. 创建一条指定网络的测试直线
698
+ const line = await eda.pcb_PrimitiveLine.create('嘉立创示例_NET', 1, 1000, 1000, 1600, 1000, 10);
699
+
700
+ // 2. 读取网络名称
701
+ const net = line.getState_Net();
702
+
703
+ // 3. 清理测试图元(查询类案例不留测试对象)
704
+ await eda.pcb_PrimitiveLine.delete([line.getState_PrimitiveId()]);
705
+
706
+ console.log('net:', net);
707
+ ```
708
+
709
+ ### getstate_primitiveid
710
+
711
+ # IPCB\_PrimitiveLine.getState\_PrimitiveId() method
712
+
713
+ Get the property state: primitive ID
714
+
715
+ ## Signature
716
+
717
+ ```typescript
718
+ function getState_PrimitiveId(): string;
719
+ ```
720
+
721
+ ## Returns
722
+
723
+ string
724
+
725
+ Primitive ID
726
+
727
+ ## Example
728
+
729
+ ```javascript
730
+ // 1. 创建一条测试直线
731
+ const line = await eda.pcb_PrimitiveLine.create('', 1, 1000, 1000, 1600, 1000, 10);
732
+
733
+ // 2. 读取图元 ID
734
+ const primitiveId = line.getState_PrimitiveId();
735
+
736
+ // 3. 用该 ID 从画布重新取回直线,验证 ID 有效
737
+ const refetched = await eda.pcb_PrimitiveLine.get(primitiveId);
738
+
739
+ // 4. 清理测试图元(查询类案例不留测试对象)
740
+ await eda.pcb_PrimitiveLine.delete([primitiveId]);
741
+
742
+ console.log('primitiveId:', primitiveId);
743
+ console.log('refetched type:', refetched.getState_PrimitiveType());
744
+ ```
745
+
746
+ ### getstate_primitivelock
747
+
748
+ # IPCB\_PrimitiveLine.getState\_PrimitiveLock() method
749
+
750
+ Get the property state: whether it is locked
751
+
752
+ ## Signature
753
+
754
+ ```typescript
755
+ function getState_PrimitiveLock(): boolean;
756
+ ```
757
+
758
+ ## Returns
759
+
760
+ boolean
761
+
762
+ Whether it is locked
763
+
764
+ ## Example
765
+
766
+ ```javascript
767
+ // 1. 创建一条测试直线(默认不锁定)
768
+ const line = await eda.pcb_PrimitiveLine.create('', 1, 1000, 1000, 1600, 1000, 10);
769
+
770
+ // 2. 读取锁定状态
771
+ const locked = line.getState_PrimitiveLock();
772
+
773
+ // 3. 清理测试图元(查询类案例不留测试对象)
774
+ await eda.pcb_PrimitiveLine.delete([line.getState_PrimitiveId()]);
775
+
776
+ console.log('locked:', locked);
777
+ ```
778
+
779
+ ### getstate_primitivetype
780
+
781
+ # IPCB\_PrimitiveLine.getState\_PrimitiveType() method
782
+
783
+ Get the property state: primitive type
784
+
785
+ ## Signature
786
+
787
+ ```typescript
788
+ function getState_PrimitiveType(): EPCB_PrimitiveType;
789
+ ```
790
+
791
+ ## Returns
792
+
793
+ [EPCB\_PrimitiveType](../enums/EPCB_PrimitiveType.md)
794
+
795
+ Primitive type
796
+
797
+ ## Example
798
+
799
+ ```javascript
800
+ // 1. 创建一条测试直线
801
+ const line = await eda.pcb_PrimitiveLine.create('', 1, 1000, 1000, 1600, 1000, 10);
802
+
803
+ // 2. 读取图元类型
804
+ const type = line.getState_PrimitiveType();
805
+
806
+ // 3. 清理测试图元(查询类案例不留测试对象)
807
+ await eda.pcb_PrimitiveLine.delete([line.getState_PrimitiveId()]);
808
+
809
+ console.log('type:', type);
810
+ ```
811
+
812
+ ### getstate_startx
813
+
814
+ # IPCB\_PrimitiveLine.getState\_StartX() method
815
+
816
+ Get the property state: start position X
817
+
818
+ ## Signature
819
+
820
+ ```typescript
821
+ function getState_StartX(): number;
822
+ ```
823
+
824
+ ## Returns
825
+
826
+ number
827
+
828
+ Start position X
829
+
830
+ ## Example
831
+
832
+ ```javascript
833
+ // 1. 创建一条测试直线,起点 (1000, 1000)
834
+ const line = await eda.pcb_PrimitiveLine.create('', 1, 1000, 1000, 1600, 1000, 10);
835
+
836
+ // 2. 读取起点 X
837
+ const startX = line.getState_StartX();
838
+
839
+ // 3. 清理测试图元(查询类案例不留测试对象)
840
+ await eda.pcb_PrimitiveLine.delete([line.getState_PrimitiveId()]);
841
+
842
+ console.log('startX:', startX);
843
+ ```
844
+
845
+ ### getstate_starty
846
+
847
+ # IPCB\_PrimitiveLine.getState\_StartY() method
848
+
849
+ Get the property state: start position Y
850
+
851
+ ## Signature
852
+
853
+ ```typescript
854
+ function getState_StartY(): number;
855
+ ```
856
+
857
+ ## Returns
858
+
859
+ number
860
+
861
+ Start position Y
862
+
863
+ ## Example
864
+
865
+ ```javascript
866
+ // 1. 创建一条测试直线,起点 (1000, 1000)
867
+ const line = await eda.pcb_PrimitiveLine.create('', 1, 1000, 1000, 1600, 1000, 10);
868
+
869
+ // 2. 读取起点 Y
870
+ const startY = line.getState_StartY();
871
+
872
+ // 3. 清理测试图元(查询类案例不留测试对象)
873
+ await eda.pcb_PrimitiveLine.delete([line.getState_PrimitiveId()]);
874
+
875
+ console.log('startY:', startY);
876
+ ```
877
+
878
+ ### isasync
879
+
880
+ # IPCB\_PrimitiveLine.isAsync() method
881
+
882
+ Query whether the primitive is an async primitive
883
+
884
+ ## Signature
885
+
886
+ ```typescript
887
+ function isAsync(): boolean;
888
+ ```
889
+
890
+ ## Returns
891
+
892
+ boolean
893
+
894
+ Whether Is async primitive
895
+
896
+ ## Example
897
+
898
+ ```javascript
899
+ // 1. 创建一条测试直线,读出创建后的默认模式
900
+ const line = await eda.pcb_PrimitiveLine.create('', 1, 1000, 1000, 1600, 1000, 10);
901
+ const asyncOnCreate = line.isAsync();
902
+
903
+ // 2. 切换到同步模式再查询一次,对比两种模式
904
+ line.toSync();
905
+ const asyncAfterToSync = line.isAsync();
906
+
907
+ // 3. 清理测试图元(查询类案例不留测试对象)
908
+ await eda.pcb_PrimitiveLine.delete([line.getState_PrimitiveId()]);
909
+
910
+ console.log('isAsync on create:', asyncOnCreate);
911
+ console.log('isAsync after toSync:', asyncAfterToSync);
912
+ ```
913
+
914
+ ### reset
915
+
916
+ # IPCB\_PrimitiveLine.reset() method
917
+
918
+ > 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.
919
+
920
+ Reset the async primitive to the current canvas state
921
+
922
+ ## Signature
923
+
924
+ ```typescript
925
+ function reset(): Promise<IPCB_PrimitiveLine>;
926
+ ```
927
+
928
+ ## Returns
929
+
930
+ Promise&lt;[IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md)<!-- -->&gt;
931
+
932
+ Line primitive object
933
+
934
+ ## Example
935
+
936
+ ```javascript
937
+ // 1. 生成本次运行专用的坐标,避免与之前保留的测试走线重合
938
+ const x = 46000 + (Math.floor(Math.random() * 100000));
939
+ const y = 2000 + (Math.floor(Math.random() * 100000));
940
+
941
+ // 2. 创建一条 10mil 线宽的测试直线
942
+ const line = await eda.pcb_PrimitiveLine.create('', 1, x, y, x + 600, y, 10);
943
+
944
+ // 3. 切换异步模式,累计一处未提交的线宽修改(10 → 99)
945
+ const asyncLine = line.toAsync();
946
+ asyncLine.setState_LineWidth(99);
947
+
948
+ // 4. 重置:丢弃未提交的修改,回到画布当前状态
949
+ await asyncLine.reset();
950
+
951
+ // 5. 从画布重新读取,线宽仍是 10(保留现场供观察)
952
+ const refetched = await eda.pcb_PrimitiveLine.get(line.getState_PrimitiveId());
953
+
954
+ console.log('lineWidth after reset:', refetched.getState_LineWidth());
955
+ ```
956
+
957
+ ### setstate_endx
958
+
959
+ # IPCB\_PrimitiveLine.setState\_EndX() method
960
+
961
+ > 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.
962
+
963
+ Set the property state: end position X
964
+
965
+ ## Signature
966
+
967
+ ```typescript
968
+ function setState_EndX(endX: number): IPCB_PrimitiveLine;
969
+ ```
970
+
971
+ ## Parameters
972
+
973
+ <table><thead><tr><th>
974
+
975
+ Parameter
976
+
977
+ </th><th>
978
+
979
+ Type
980
+
981
+ </th><th>
982
+
983
+ Description
984
+
985
+ </th></tr></thead>
986
+ <tbody><tr><td>
987
+
988
+ endX
989
+
990
+ </td><td>
991
+
992
+ number
993
+
994
+ </td><td>
995
+
996
+ End position X
997
+
998
+ </td></tr>
999
+ </tbody></table>
1000
+
1001
+ ## Returns
1002
+
1003
+ [IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md)
1004
+
1005
+ Line primitive object
1006
+
1007
+ ## Example
1008
+
1009
+ ```javascript
1010
+ // 1. 生成本次运行专用的坐标,避免与之前保留的测试走线重合
1011
+ const x = 14000 + (Math.floor(Math.random() * 100000));
1012
+ const y = 2000 + (Math.floor(Math.random() * 100000));
1013
+
1014
+ // 2. 创建一条测试直线,终点 (x + 600, y)
1015
+ const line = await eda.pcb_PrimitiveLine.create('', 1, x, y, x + 600, y, 10);
1016
+
1017
+ // 3. 读取修改前的终点 X
1018
+ const before = line.getState_EndX();
1019
+
1020
+ // 4. 切换异步模式并拉长终点(右移 300mil)
1021
+ const asyncLine = line.toAsync();
1022
+ asyncLine.setState_EndX(x + 900);
1023
+ await asyncLine.done();
1024
+
1025
+ // 5. 从画布重新读取,确认修改已生效(保留现场供观察)
1026
+ const refetched = await eda.pcb_PrimitiveLine.get(line.getState_PrimitiveId());
1027
+ const after = refetched.getState_EndX();
1028
+
1029
+ console.log('endX:', before, '→', after);
1030
+ ```
1031
+
1032
+ ### setstate_endy
1033
+
1034
+ # IPCB\_PrimitiveLine.setState\_EndY() method
1035
+
1036
+ > 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.
1037
+
1038
+ Set the property state: end position Y
1039
+
1040
+ ## Signature
1041
+
1042
+ ```typescript
1043
+ function setState_EndY(endY: number): IPCB_PrimitiveLine;
1044
+ ```
1045
+
1046
+ ## Parameters
1047
+
1048
+ <table><thead><tr><th>
1049
+
1050
+ Parameter
1051
+
1052
+ </th><th>
1053
+
1054
+ Type
1055
+
1056
+ </th><th>
1057
+
1058
+ Description
1059
+
1060
+ </th></tr></thead>
1061
+ <tbody><tr><td>
1062
+
1063
+ endY
1064
+
1065
+ </td><td>
1066
+
1067
+ number
1068
+
1069
+ </td><td>
1070
+
1071
+ End position Y
1072
+
1073
+ </td></tr>
1074
+ </tbody></table>
1075
+
1076
+ ## Returns
1077
+
1078
+ [IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md)
1079
+
1080
+ Line primitive object
1081
+
1082
+ ## Example
1083
+
1084
+ ```javascript
1085
+ // 1. 生成本次运行专用的坐标,避免与之前保留的测试走线重合
1086
+ const x = 18000 + (Math.floor(Math.random() * 100000));
1087
+ const y = 2000 + (Math.floor(Math.random() * 100000));
1088
+
1089
+ // 2. 创建一条测试直线,终点 (x + 600, y)
1090
+ const line = await eda.pcb_PrimitiveLine.create('', 1, x, y, x + 600, y, 10);
1091
+
1092
+ // 3. 读取修改前的终点 Y
1093
+ const before = line.getState_EndY();
1094
+
1095
+ // 4. 切换异步模式并抬高终点(上移 300mil)
1096
+ const asyncLine = line.toAsync();
1097
+ asyncLine.setState_EndY(y + 300);
1098
+ await asyncLine.done();
1099
+
1100
+ // 5. 从画布重新读取,确认修改已生效(保留现场供观察)
1101
+ const refetched = await eda.pcb_PrimitiveLine.get(line.getState_PrimitiveId());
1102
+ const after = refetched.getState_EndY();
1103
+
1104
+ console.log('endY:', before, '→', after);
1105
+ ```
1106
+
1107
+ ### setstate_layer
1108
+
1109
+ # IPCB\_PrimitiveLine.setState\_Layer() method
1110
+
1111
+ > 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.
1112
+
1113
+ Set the property state: Layer
1114
+
1115
+ ## Signature
1116
+
1117
+ ```typescript
1118
+ function setState_Layer(layer: TPCB_LayersOfLine): IPCB_PrimitiveLine;
1119
+ ```
1120
+
1121
+ ## Parameters
1122
+
1123
+ <table><thead><tr><th>
1124
+
1125
+ Parameter
1126
+
1127
+ </th><th>
1128
+
1129
+ Type
1130
+
1131
+ </th><th>
1132
+
1133
+ Description
1134
+
1135
+ </th></tr></thead>
1136
+ <tbody><tr><td>
1137
+
1138
+ layer
1139
+
1140
+ </td><td>
1141
+
1142
+ [TPCB\_LayersOfLine](../types/TPCB_LayersOfLine.md)
1143
+
1144
+ </td><td>
1145
+
1146
+ Layer
1147
+
1148
+ </td></tr>
1149
+ </tbody></table>
1150
+
1151
+ ## Returns
1152
+
1153
+ [IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md)
1154
+
1155
+ Line primitive object
1156
+
1157
+ ## Example
1158
+
1159
+ ```javascript
1160
+ // 1. 生成本次运行专用的坐标,避免与之前保留的测试走线重合
1161
+ const x = 22000 + (Math.floor(Math.random() * 100000));
1162
+ const y = 2000 + (Math.floor(Math.random() * 100000));
1163
+
1164
+ // 2. 创建一条顶层(1)测试直线
1165
+ const line = await eda.pcb_PrimitiveLine.create('', 1, x, y, x + 600, y, 10);
1166
+
1167
+ // 3. 读取修改前的层
1168
+ const before = line.getState_Layer();
1169
+
1170
+ // 4. 切换异步模式并换层(顶层 1 → 底层 2)
1171
+ const asyncLine = line.toAsync();
1172
+ asyncLine.setState_Layer(2);
1173
+ await asyncLine.done();
1174
+
1175
+ // 5. 从画布重新读取,确认修改已生效(保留现场供观察)
1176
+ const refetched = await eda.pcb_PrimitiveLine.get(line.getState_PrimitiveId());
1177
+ const after = refetched.getState_Layer();
1178
+
1179
+ console.log('layer:', before, '→', after);
1180
+ ```
1181
+
1182
+ ### setstate_linewidth
1183
+
1184
+ # IPCB\_PrimitiveLine.setState\_LineWidth() method
1185
+
1186
+ > 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.
1187
+
1188
+ Set the property state: Line width
1189
+
1190
+ ## Signature
1191
+
1192
+ ```typescript
1193
+ function setState_LineWidth(lineWidth: number): IPCB_PrimitiveLine;
1194
+ ```
1195
+
1196
+ ## Parameters
1197
+
1198
+ <table><thead><tr><th>
1199
+
1200
+ Parameter
1201
+
1202
+ </th><th>
1203
+
1204
+ Type
1205
+
1206
+ </th><th>
1207
+
1208
+ Description
1209
+
1210
+ </th></tr></thead>
1211
+ <tbody><tr><td>
1212
+
1213
+ lineWidth
1214
+
1215
+ </td><td>
1216
+
1217
+ number
1218
+
1219
+ </td><td>
1220
+
1221
+ Line width
1222
+
1223
+ </td></tr>
1224
+ </tbody></table>
1225
+
1226
+ ## Returns
1227
+
1228
+ [IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md)
1229
+
1230
+ Line primitive object
1231
+
1232
+ ## Example
1233
+
1234
+ ```javascript
1235
+ // 1. 生成本次运行专用的坐标,避免与之前保留的测试走线重合
1236
+ const x = 26000 + (Math.floor(Math.random() * 100000));
1237
+ const y = 2000 + (Math.floor(Math.random() * 100000));
1238
+
1239
+ // 2. 创建一条 10mil 线宽的测试直线
1240
+ const line = await eda.pcb_PrimitiveLine.create('', 1, x, y, x + 600, y, 10);
1241
+
1242
+ // 3. 读取修改前的线宽
1243
+ const before = line.getState_LineWidth();
1244
+
1245
+ // 4. 切换异步模式并加宽(10 → 24)
1246
+ const asyncLine = line.toAsync();
1247
+ asyncLine.setState_LineWidth(24);
1248
+ await asyncLine.done();
1249
+
1250
+ // 5. 从画布重新读取,确认修改已生效(保留现场供观察)
1251
+ const refetched = await eda.pcb_PrimitiveLine.get(line.getState_PrimitiveId());
1252
+ const after = refetched.getState_LineWidth();
1253
+
1254
+ console.log('lineWidth:', before, '→', after);
1255
+ ```
1256
+
1257
+ ### setstate_net
1258
+
1259
+ # IPCB\_PrimitiveLine.setState\_Net() method
1260
+
1261
+ > 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.
1262
+
1263
+ Set the property state: net name
1264
+
1265
+ ## Signature
1266
+
1267
+ ```typescript
1268
+ function setState_Net(net: string): IPCB_PrimitiveLine;
1269
+ ```
1270
+
1271
+ ## Parameters
1272
+
1273
+ <table><thead><tr><th>
1274
+
1275
+ Parameter
1276
+
1277
+ </th><th>
1278
+
1279
+ Type
1280
+
1281
+ </th><th>
1282
+
1283
+ Description
1284
+
1285
+ </th></tr></thead>
1286
+ <tbody><tr><td>
1287
+
1288
+ net
1289
+
1290
+ </td><td>
1291
+
1292
+ string
1293
+
1294
+ </td><td>
1295
+
1296
+ Net name
1297
+
1298
+ </td></tr>
1299
+ </tbody></table>
1300
+
1301
+ ## Returns
1302
+
1303
+ [IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md)
1304
+
1305
+ Line primitive object
1306
+
1307
+ ## Example
1308
+
1309
+ ```javascript
1310
+ // 1. 生成本次运行专用的坐标,避免与之前保留的测试走线重合
1311
+ const x = 30000 + (Math.floor(Math.random() * 100000));
1312
+ const y = 2000 + (Math.floor(Math.random() * 100000));
1313
+
1314
+ // 2. 创建一条无网络的测试直线
1315
+ const line = await eda.pcb_PrimitiveLine.create('', 1, x, y, x + 600, y, 10);
1316
+
1317
+ // 3. 读取修改前的网络名称
1318
+ const before = line.getState_Net();
1319
+
1320
+ // 4. 切换异步模式并指定网络('' → '嘉立创示例_NET')
1321
+ const asyncLine = line.toAsync();
1322
+ asyncLine.setState_Net('嘉立创示例_NET');
1323
+ await asyncLine.done();
1324
+
1325
+ // 5. 从画布重新读取,确认修改已生效(保留现场供观察)
1326
+ const refetched = await eda.pcb_PrimitiveLine.get(line.getState_PrimitiveId());
1327
+ const after = refetched.getState_Net();
1328
+
1329
+ console.log('net:', before, '→', after);
1330
+ ```
1331
+
1332
+ ### setstate_primitivelock
1333
+
1334
+ # IPCB\_PrimitiveLine.setState\_PrimitiveLock() method
1335
+
1336
+ > 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.
1337
+
1338
+ Set the property state: whether it is locked
1339
+
1340
+ ## Signature
1341
+
1342
+ ```typescript
1343
+ function setState_PrimitiveLock(primitiveLock: boolean): IPCB_PrimitiveLine;
1344
+ ```
1345
+
1346
+ ## Parameters
1347
+
1348
+ <table><thead><tr><th>
1349
+
1350
+ Parameter
1351
+
1352
+ </th><th>
1353
+
1354
+ Type
1355
+
1356
+ </th><th>
1357
+
1358
+ Description
1359
+
1360
+ </th></tr></thead>
1361
+ <tbody><tr><td>
1362
+
1363
+ primitiveLock
1364
+
1365
+ </td><td>
1366
+
1367
+ boolean
1368
+
1369
+ </td><td>
1370
+
1371
+ Whether it is locked
1372
+
1373
+ </td></tr>
1374
+ </tbody></table>
1375
+
1376
+ ## Returns
1377
+
1378
+ [IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md)
1379
+
1380
+ Line primitive object
1381
+
1382
+ ## Example
1383
+
1384
+ ```javascript
1385
+ // 1. 生成本次运行专用的坐标,避免与之前保留的测试走线重合
1386
+ const x = 34000 + (Math.floor(Math.random() * 100000));
1387
+ const y = 2000 + (Math.floor(Math.random() * 100000));
1388
+
1389
+ // 2. 创建一条测试直线(默认不锁定)
1390
+ const line = await eda.pcb_PrimitiveLine.create('', 1, x, y, x + 600, y, 10);
1391
+
1392
+ // 3. 读取修改前的锁定状态
1393
+ const before = line.getState_PrimitiveLock();
1394
+
1395
+ // 4. 切换异步模式并锁定(false → true)
1396
+ const asyncLine = line.toAsync();
1397
+ asyncLine.setState_PrimitiveLock(true);
1398
+ await asyncLine.done();
1399
+
1400
+ // 5. 从画布重新读取,确认修改已生效(保留现场供观察)
1401
+ const refetched = await eda.pcb_PrimitiveLine.get(line.getState_PrimitiveId());
1402
+ const after = refetched.getState_PrimitiveLock();
1403
+
1404
+ console.log('locked:', before, '→', after);
1405
+ ```
1406
+
1407
+ ### setstate_startx
1408
+
1409
+ # IPCB\_PrimitiveLine.setState\_StartX() method
1410
+
1411
+ > 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.
1412
+
1413
+ Set the property state: start position X
1414
+
1415
+ ## Signature
1416
+
1417
+ ```typescript
1418
+ function setState_StartX(startX: number): IPCB_PrimitiveLine;
1419
+ ```
1420
+
1421
+ ## Parameters
1422
+
1423
+ <table><thead><tr><th>
1424
+
1425
+ Parameter
1426
+
1427
+ </th><th>
1428
+
1429
+ Type
1430
+
1431
+ </th><th>
1432
+
1433
+ Description
1434
+
1435
+ </th></tr></thead>
1436
+ <tbody><tr><td>
1437
+
1438
+ startX
1439
+
1440
+ </td><td>
1441
+
1442
+ number
1443
+
1444
+ </td><td>
1445
+
1446
+ Start position X
1447
+
1448
+ </td></tr>
1449
+ </tbody></table>
1450
+
1451
+ ## Returns
1452
+
1453
+ [IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md)
1454
+
1455
+ Line primitive object
1456
+
1457
+ ## Example
1458
+
1459
+ ```javascript
1460
+ // 1. 生成本次运行专用的坐标,避免与之前保留的测试走线重合
1461
+ const x = 6000 + (Math.floor(Math.random() * 100000));
1462
+ const y = 2000 + (Math.floor(Math.random() * 100000));
1463
+
1464
+ // 2. 创建一条测试直线,起点 (x, y)
1465
+ const line = await eda.pcb_PrimitiveLine.create('', 1, x, y, x + 600, y, 10);
1466
+
1467
+ // 3. 读取修改前的起点 X
1468
+ const before = line.getState_StartX();
1469
+
1470
+ // 4. 切换异步模式并平移起点 X(右移 300mil)
1471
+ const asyncLine = line.toAsync();
1472
+ asyncLine.setState_StartX(x + 300);
1473
+ await asyncLine.done();
1474
+
1475
+ // 5. 从画布重新读取,确认修改已生效(保留现场供观察)
1476
+ const refetched = await eda.pcb_PrimitiveLine.get(line.getState_PrimitiveId());
1477
+ const after = refetched.getState_StartX();
1478
+
1479
+ console.log('startX:', before, '→', after);
1480
+ ```
1481
+
1482
+ ### setstate_starty
1483
+
1484
+ # IPCB\_PrimitiveLine.setState\_StartY() method
1485
+
1486
+ > 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.
1487
+
1488
+ Set the property state: start position Y
1489
+
1490
+ ## Signature
1491
+
1492
+ ```typescript
1493
+ function setState_StartY(startY: number): IPCB_PrimitiveLine;
1494
+ ```
1495
+
1496
+ ## Parameters
1497
+
1498
+ <table><thead><tr><th>
1499
+
1500
+ Parameter
1501
+
1502
+ </th><th>
1503
+
1504
+ Type
1505
+
1506
+ </th><th>
1507
+
1508
+ Description
1509
+
1510
+ </th></tr></thead>
1511
+ <tbody><tr><td>
1512
+
1513
+ startY
1514
+
1515
+ </td><td>
1516
+
1517
+ number
1518
+
1519
+ </td><td>
1520
+
1521
+ Start position Y
1522
+
1523
+ </td></tr>
1524
+ </tbody></table>
1525
+
1526
+ ## Returns
1527
+
1528
+ [IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md)
1529
+
1530
+ Line primitive object
1531
+
1532
+ ## Example
1533
+
1534
+ ```javascript
1535
+ // 1. 生成本次运行专用的坐标,避免与之前保留的测试走线重合
1536
+ const x = 10000 + (Math.floor(Math.random() * 100000));
1537
+ const y = 2000 + (Math.floor(Math.random() * 100000));
1538
+
1539
+ // 2. 创建一条测试直线,起点 (x, y)
1540
+ const line = await eda.pcb_PrimitiveLine.create('', 1, x, y, x + 600, y, 10);
1541
+
1542
+ // 3. 读取修改前的起点 Y
1543
+ const before = line.getState_StartY();
1544
+
1545
+ // 4. 切换异步模式并平移起点 Y(上移 300mil)
1546
+ const asyncLine = line.toAsync();
1547
+ asyncLine.setState_StartY(y + 300);
1548
+ await asyncLine.done();
1549
+
1550
+ // 5. 从画布重新读取,确认修改已生效(保留现场供观察)
1551
+ const refetched = await eda.pcb_PrimitiveLine.get(line.getState_PrimitiveId());
1552
+ const after = refetched.getState_StartY();
1553
+
1554
+ console.log('startY:', before, '→', after);
1555
+ ```
1556
+
1557
+ ### toasync
1558
+
1559
+ # IPCB\_PrimitiveLine.toAsync() method
1560
+
1561
+ Convert Primitive to Async primitive
1562
+
1563
+ ## Signature
1564
+
1565
+ ```typescript
1566
+ function toAsync(): IPCB_PrimitiveLine;
1567
+ ```
1568
+
1569
+ ## Returns
1570
+
1571
+ [IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md)
1572
+
1573
+ Line primitive object
1574
+
1575
+ ## Example
1576
+
1577
+ ```javascript
1578
+ // 1. 生成本次运行专用的坐标,避免与之前保留的测试走线重合
1579
+ const x = 52000 + (Math.floor(Math.random() * 100000));
1580
+ const y = 2000 + (Math.floor(Math.random() * 100000));
1581
+
1582
+ // 2. 创建一条测试直线,切换到同步模式,让模式变化可观察
1583
+ const line = await eda.pcb_PrimitiveLine.create('', 1, x, y, x + 600, y, 10);
1584
+ line.toSync();
1585
+
1586
+ // 3. 转换为异步图元
1587
+ const asyncLine = line.toAsync();
1588
+
1589
+ // 4. 异步模式下累计修改并提交
1590
+ asyncLine.setState_LineWidth(24);
1591
+ await asyncLine.done();
1592
+
1593
+ // 5. 从画布重新读取,确认提交生效(保留现场供观察)
1594
+ const refetched = await eda.pcb_PrimitiveLine.get(line.getState_PrimitiveId());
1595
+
1596
+ console.log('isAsync after toAsync:', line.isAsync());
1597
+ console.log('lineWidth:', 10, '→', refetched.getState_LineWidth());
1598
+ ```
1599
+
1600
+ ### tosync
1601
+
1602
+ # IPCB\_PrimitiveLine.toSync() method
1603
+
1604
+ Convert Primitive to Sync primitive
1605
+
1606
+ ## Signature
1607
+
1608
+ ```typescript
1609
+ function toSync(): IPCB_PrimitiveLine;
1610
+ ```
1611
+
1612
+ ## Returns
1613
+
1614
+ [IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md)
1615
+
1616
+ Line primitive object
1617
+
1618
+ ## Example
1619
+
1620
+ ```javascript
1621
+ // 1. 生成本次运行专用的坐标,避免与之前保留的测试走线重合
1622
+ const x = 56000 + (Math.floor(Math.random() * 100000));
1623
+ const y = 2000 + (Math.floor(Math.random() * 100000));
1624
+
1625
+ // 2. 创建一条测试直线
1626
+ const line = await eda.pcb_PrimitiveLine.create('', 1, x, y, x + 600, y, 10);
1627
+
1628
+ // 3. 转换为同步图元
1629
+ const syncLine = line.toSync();
1630
+
1631
+ // 4. 同步模式下修改线宽,立即生效(无需 done())
1632
+ syncLine.setState_LineWidth(40);
1633
+
1634
+ // 5. 从画布重新读取,确认修改已生效(保留现场供观察)
1635
+ const refetched = await eda.pcb_PrimitiveLine.get(line.getState_PrimitiveId());
1636
+
1637
+ console.log('isSync after toSync:', !syncLine.isAsync());
1638
+ console.log('lineWidth:', 10, '→', refetched.getState_LineWidth());
1639
+ ```