@windypro-rourou/dsh-eda 0.1.4 → 0.1.5

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