@windypro-rourou/dsh-eda 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (484) hide show
  1. package/README.md +1 -1
  2. package/lib/backend.js +49 -0
  3. package/lib/capabilities.js +6 -2
  4. package/lib/client.js +33 -0
  5. package/lib/index.js +197 -3
  6. package/package.json +10 -1
  7. package/skill/INDEX.md +10 -8
  8. package/skill/README.md +125 -0
  9. package/skill/README.zh-Hans.md +125 -0
  10. package/skill/SKILL.md +746 -746
  11. package/skill/format/index.md +152 -152
  12. package/skill/format/pcb/3d.md +166 -166
  13. package/skill/format/pcb/attr.md +63 -63
  14. package/skill/format/pcb/common.md +306 -306
  15. package/skill/format/pcb/component.md +132 -132
  16. package/skill/format/pcb/dimension.md +58 -58
  17. package/skill/format/pcb/index.md +17 -17
  18. package/skill/format/pcb/obj.md +43 -43
  19. package/skill/format/pcb/pad_via.md +151 -151
  20. package/skill/format/pcb/panel.md +64 -64
  21. package/skill/format/pcb/partition.md +43 -43
  22. package/skill/format/pcb/primitive.md +196 -196
  23. package/skill/format/pcb/rule.md +71 -71
  24. package/skill/format/pcb/shape.md +441 -441
  25. package/skill/format/pcb/text.md +62 -62
  26. package/skill/format/project/blob.md +30 -30
  27. package/skill/format/project/common.md +42 -42
  28. package/skill/format/project/group.md +62 -62
  29. package/skill/format/project/index.md +12 -12
  30. package/skill/format/project/instance.md +32 -32
  31. package/skill/format/project/meta.md +189 -189
  32. package/skill/format/project/variant.md +30 -30
  33. package/skill/format/schematic/attr.md +41 -41
  34. package/skill/format/schematic/common.md +47 -47
  35. package/skill/format/schematic/component.md +91 -91
  36. package/skill/format/schematic/index.md +14 -14
  37. package/skill/format/schematic/obj.md +41 -41
  38. package/skill/format/schematic/pin.md +59 -59
  39. package/skill/format/schematic/shape.md +231 -231
  40. package/skill/format/schematic/structure.md +53 -53
  41. package/skill/format/schematic/table.md +109 -109
  42. package/skill/format/schematic/text.md +47 -47
  43. package/skill/format/schematic/wire.md +132 -132
  44. package/skill/guide/ancillary-projects/easyeda-api-sdk.md +1 -0
  45. package/skill/guide/ancillary-projects/pro-api-types.md +5 -5
  46. package/skill/guide/ancillary-projects.md +10 -10
  47. package/skill/guide/cli.md +1510 -0
  48. package/skill/guide/error-handling.md +38 -38
  49. package/skill/guide/extension-json.md +135 -135
  50. package/skill/guide/extensions-marketplace.md +61 -61
  51. package/skill/guide/how-to-start.md +316 -301
  52. package/skill/guide/i18n.md +57 -57
  53. package/skill/guide/index.md +7 -7
  54. package/skill/guide/inline-frame.md +20 -20
  55. package/skill/guide/invoke-apis.md +81 -81
  56. package/skill/guide/stability.md +37 -37
  57. package/skill/references/_index.md +471 -398
  58. package/skill/references/_quick-reference.md +3103 -3028
  59. package/skill/references/classes/DMT_Board.md +537 -533
  60. package/skill/references/classes/DMT_EditorControl.md +1736 -1736
  61. package/skill/references/classes/DMT_Event.md +356 -356
  62. package/skill/references/classes/DMT_Folder.md +775 -775
  63. package/skill/references/classes/DMT_Panel.md +531 -531
  64. package/skill/references/classes/DMT_Pcb.md +579 -575
  65. package/skill/references/classes/DMT_Project.md +734 -573
  66. package/skill/references/classes/DMT_Schematic.md +1482 -1477
  67. package/skill/references/classes/DMT_SelectControl.md +96 -96
  68. package/skill/references/classes/DMT_Team.md +172 -172
  69. package/skill/references/classes/DMT_Workspace.md +198 -198
  70. package/skill/references/classes/EDA.md +1001 -961
  71. package/skill/references/classes/IPCB_ComplexPolygon.md +299 -299
  72. package/skill/references/classes/IPCB_Polygon.md +175 -175
  73. package/skill/references/classes/IPCB_PrimitiveArc.md +1901 -1901
  74. package/skill/references/classes/IPCB_PrimitiveAttribute.md +2993 -2993
  75. package/skill/references/classes/IPCB_PrimitiveComponent.md +2624 -2627
  76. package/skill/references/classes/IPCB_PrimitiveComponentPad.md +410 -410
  77. package/skill/references/classes/IPCB_PrimitiveDimension.md +1419 -1419
  78. package/skill/references/classes/IPCB_PrimitiveFill.md +1325 -1325
  79. package/skill/references/classes/IPCB_PrimitiveImage.md +1461 -1461
  80. package/skill/references/classes/IPCB_PrimitiveLine.md +1639 -1639
  81. package/skill/references/classes/IPCB_PrimitiveObject.md +1700 -1700
  82. package/skill/references/classes/IPCB_PrimitivePad.md +3155 -3155
  83. package/skill/references/classes/IPCB_PrimitivePolyline.md +1193 -1193
  84. package/skill/references/classes/IPCB_PrimitivePour.md +1858 -1858
  85. package/skill/references/classes/IPCB_PrimitivePoured.md +556 -556
  86. package/skill/references/classes/IPCB_PrimitiveRegion.md +1332 -1332
  87. package/skill/references/classes/IPCB_PrimitiveString.md +2315 -2315
  88. package/skill/references/classes/IPCB_PrimitiveVia.md +1588 -1588
  89. package/skill/references/classes/ISCH_PrimitiveArc.md +1676 -1676
  90. package/skill/references/classes/ISCH_PrimitiveAttribute.md +2541 -2541
  91. package/skill/references/classes/ISCH_PrimitiveBus.md +973 -973
  92. package/skill/references/classes/ISCH_PrimitiveCbbSymbolComponent.md +260 -260
  93. package/skill/references/classes/ISCH_PrimitiveCircle.md +1392 -1392
  94. package/skill/references/classes/ISCH_PrimitiveComponent.md +2910 -2913
  95. package/skill/references/classes/ISCH_PrimitiveComponentPin.md +155 -155
  96. package/skill/references/classes/ISCH_PrimitiveObject.md +960 -960
  97. package/skill/references/classes/ISCH_PrimitivePin.md +2402 -2402
  98. package/skill/references/classes/ISCH_PrimitivePolygon.md +1028 -1028
  99. package/skill/references/classes/ISCH_PrimitiveRectangle.md +1777 -1777
  100. package/skill/references/classes/ISCH_PrimitiveText.md +1771 -1771
  101. package/skill/references/classes/ISCH_PrimitiveWire.md +973 -973
  102. package/skill/references/classes/LIB_3DModel.md +782 -780
  103. package/skill/references/classes/LIB_Cbb.md +957 -957
  104. package/skill/references/classes/LIB_Classification.md +969 -965
  105. package/skill/references/classes/LIB_Device.md +1222 -1221
  106. package/skill/references/classes/LIB_Footprint.md +1298 -1153
  107. package/skill/references/classes/LIB_LibrariesList.md +361 -329
  108. package/skill/references/classes/LIB_PanelLibrary.md +855 -855
  109. package/skill/references/classes/LIB_SelectControl.md +89 -89
  110. package/skill/references/classes/LIB_SimulationModel.md +807 -821
  111. package/skill/references/classes/LIB_Symbol.md +1341 -1195
  112. package/skill/references/classes/PCB_Document.md +1770 -1754
  113. package/skill/references/classes/PCB_Drc.md +3379 -3375
  114. package/skill/references/classes/PCB_Event.md +1166 -1081
  115. package/skill/references/classes/PCB_ImageTool.md +363 -0
  116. package/skill/references/classes/PCB_Layer.md +1915 -1911
  117. package/skill/references/classes/PCB_ManufactureData.md +2968 -2968
  118. package/skill/references/classes/PCB_MathPolygon.md +916 -785
  119. package/skill/references/classes/PCB_Net.md +1128 -1128
  120. package/skill/references/classes/PCB_Primitive.md +217 -217
  121. package/skill/references/classes/PCB_PrimitiveArc.md +820 -894
  122. package/skill/references/classes/PCB_PrimitiveAttribute.md +635 -717
  123. package/skill/references/classes/PCB_PrimitiveComponent.md +1050 -1050
  124. package/skill/references/classes/PCB_PrimitiveDimension.md +789 -833
  125. package/skill/references/classes/PCB_PrimitiveFill.md +783 -861
  126. package/skill/references/classes/PCB_PrimitiveImage.md +803 -875
  127. package/skill/references/classes/PCB_PrimitiveLine.md +787 -858
  128. package/skill/references/classes/PCB_PrimitiveObject.md +796 -800
  129. package/skill/references/classes/PCB_PrimitivePad.md +947 -944
  130. package/skill/references/classes/PCB_PrimitivePolyline.md +744 -819
  131. package/skill/references/classes/PCB_PrimitivePour.md +808 -845
  132. package/skill/references/classes/PCB_PrimitivePoured.md +363 -363
  133. package/skill/references/classes/PCB_PrimitiveRegion.md +765 -799
  134. package/skill/references/classes/PCB_PrimitiveString.md +828 -910
  135. package/skill/references/classes/PCB_PrimitiveVia.md +761 -765
  136. package/skill/references/classes/PCB_RayTracerEngine.md +603 -263
  137. package/skill/references/classes/PCB_SelectControl.md +495 -495
  138. package/skill/references/classes/PCB_Tool.md +9 -0
  139. package/skill/references/classes/PNL_Document.md +83 -83
  140. package/skill/references/classes/SCH_Document.md +797 -809
  141. package/skill/references/classes/SCH_Drc.md +246 -242
  142. package/skill/references/classes/SCH_Event.md +583 -583
  143. package/skill/references/classes/SCH_ManufactureData.md +1209 -1205
  144. package/skill/references/classes/SCH_Net.md +200 -200
  145. package/skill/references/classes/SCH_Netlist.md +191 -191
  146. package/skill/references/classes/SCH_Primitive.md +337 -337
  147. package/skill/references/classes/SCH_PrimitiveArc.md +686 -692
  148. package/skill/references/classes/SCH_PrimitiveAttribute.md +579 -590
  149. package/skill/references/classes/SCH_PrimitiveBus.md +618 -624
  150. package/skill/references/classes/SCH_PrimitiveCircle.md +667 -683
  151. package/skill/references/classes/SCH_PrimitiveComponent.md +2256 -2240
  152. package/skill/references/classes/SCH_PrimitiveObject.md +666 -666
  153. package/skill/references/classes/SCH_PrimitivePin.md +737 -754
  154. package/skill/references/classes/SCH_PrimitivePolygon.md +621 -627
  155. package/skill/references/classes/SCH_PrimitiveRectangle.md +715 -731
  156. package/skill/references/classes/SCH_PrimitiveText.md +736 -746
  157. package/skill/references/classes/SCH_PrimitiveWire.md +701 -703
  158. package/skill/references/classes/SCH_SelectControl.md +520 -520
  159. package/skill/references/classes/SCH_SimulationEngine.md +133 -133
  160. package/skill/references/classes/SCH_Utils.md +121 -121
  161. package/skill/references/classes/SYS_ClientUrl.md +173 -173
  162. package/skill/references/classes/SYS_Dialog.md +825 -825
  163. package/skill/references/classes/SYS_Environment.md +640 -502
  164. package/skill/references/classes/SYS_ExternalApi.md +246 -0
  165. package/skill/references/classes/SYS_FileManager.md +1664 -1686
  166. package/skill/references/classes/SYS_FileSystem.md +1366 -1171
  167. package/skill/references/classes/SYS_FontManager.md +224 -224
  168. package/skill/references/classes/SYS_FormatConversion.md +349 -349
  169. package/skill/references/classes/SYS_HeaderMenu.md +480 -479
  170. package/skill/references/classes/SYS_Help.md +141 -0
  171. package/skill/references/classes/SYS_I18n.md +861 -861
  172. package/skill/references/classes/SYS_IFrame.md +541 -535
  173. package/skill/references/classes/SYS_LoadingAndProgressBar.md +246 -246
  174. package/skill/references/classes/SYS_Log.md +422 -424
  175. package/skill/references/classes/SYS_Math.md +1565 -1565
  176. package/skill/references/classes/SYS_Message.md +363 -363
  177. package/skill/references/classes/SYS_MessageBox.md +285 -285
  178. package/skill/references/classes/SYS_MessageBus.md +1618 -1618
  179. package/skill/references/classes/SYS_PanelControl.md +696 -696
  180. package/skill/references/classes/SYS_RightClickMenu.md +175 -175
  181. package/skill/references/classes/SYS_Setting.md +134 -85
  182. package/skill/references/classes/SYS_ShortcutKey.md +623 -623
  183. package/skill/references/classes/SYS_Storage.md +484 -484
  184. package/skill/references/classes/SYS_Timer.md +447 -447
  185. package/skill/references/classes/SYS_ToastMessage.md +194 -194
  186. package/skill/references/classes/SYS_Tool.md +317 -241
  187. package/skill/references/classes/SYS_Unit.md +594 -594
  188. package/skill/references/classes/SYS_WebSocket.md +401 -401
  189. package/skill/references/classes/SYS_Window.md +849 -850
  190. package/skill/references/enums/EDMT_EditorDocumentType.md +324 -278
  191. package/skill/references/enums/EDMT_EditorSplitScreenDirection.md +51 -47
  192. package/skill/references/enums/EDMT_EditorTabEventType.md +68 -62
  193. package/skill/references/enums/EDMT_IndicatorMarkerType.md +90 -80
  194. package/skill/references/enums/EDMT_ItemType.md +181 -157
  195. package/skill/references/enums/EDMT_ProjectCollaborationMode.md +51 -47
  196. package/skill/references/enums/EDMT_ProjectFileFormat.md +60 -0
  197. package/skill/references/enums/EDMT_ProjectReadyState.md +82 -0
  198. package/skill/references/enums/ELIB_DeviceJlcLibraryCategory.md +51 -47
  199. package/skill/references/enums/ELIB_LibraryType.md +129 -113
  200. package/skill/references/enums/ELIB_PreviewType.md +77 -69
  201. package/skill/references/enums/ELIB_SimulationModelType.md +51 -47
  202. package/skill/references/enums/ELIB_SymbolType.md +142 -124
  203. package/skill/references/enums/EPCB_AutoRoutingCornerStyle.md +51 -47
  204. package/skill/references/enums/EPCB_AutoRoutingExistingPrimitiveMode.md +51 -47
  205. package/skill/references/enums/EPCB_AutoRoutingOptimization.md +51 -47
  206. package/skill/references/enums/EPCB_DocumentCanvasUpdateCalculationActiveStatus.md +51 -47
  207. package/skill/references/enums/EPCB_DocumentRatlineCalculatingActiveStatus.md +55 -51
  208. package/skill/references/enums/EPCB_InactiveLayerDisplayMode.md +64 -58
  209. package/skill/references/enums/EPCB_LayerColorConfiguration.md +90 -80
  210. package/skill/references/enums/EPCB_LayerId.md +1169 -881
  211. package/skill/references/enums/EPCB_LayerStatus.md +64 -58
  212. package/skill/references/enums/EPCB_LayerType.md +129 -113
  213. package/skill/references/enums/EPCB_MouseEventType.md +64 -58
  214. package/skill/references/enums/EPCB_NetEventType.md +64 -58
  215. package/skill/references/enums/EPCB_PcbPlateType.md +51 -47
  216. package/skill/references/enums/EPCB_PdfOutputMethod.md +64 -58
  217. package/skill/references/enums/EPCB_PrimitiveArcInteractiveMode.md +51 -47
  218. package/skill/references/enums/EPCB_PrimitiveDimensionType.md +64 -58
  219. package/skill/references/enums/EPCB_PrimitiveEventType.md +64 -58
  220. package/skill/references/enums/EPCB_PrimitiveFillMode.md +68 -62
  221. package/skill/references/enums/EPCB_PrimitivePadHeatWeldingConnectionMethod.md +64 -58
  222. package/skill/references/enums/EPCB_PrimitivePadHoleType.md +64 -58
  223. package/skill/references/enums/EPCB_PrimitivePadShapeType.md +90 -80
  224. package/skill/references/enums/EPCB_PrimitivePadType.md +64 -58
  225. package/skill/references/enums/EPCB_PrimitivePourFillMethod.md +64 -58
  226. package/skill/references/enums/EPCB_PrimitiveRegionRuleType.md +107 -95
  227. package/skill/references/enums/EPCB_PrimitiveStringAlignMode.md +142 -124
  228. package/skill/references/enums/EPCB_PrimitiveType.md +233 -201
  229. package/skill/references/enums/EPCB_PrimitiveViaType.md +64 -58
  230. package/skill/references/enums/ESCH_DynamicSimulationEnginePullEventType.md +116 -102
  231. package/skill/references/enums/ESCH_DynamicSimulationEnginePushEventType.md +90 -80
  232. package/skill/references/enums/ESCH_ExportDocumentFileType.md +64 -58
  233. package/skill/references/enums/ESCH_MouseEventType.md +51 -47
  234. package/skill/references/enums/ESCH_PrimitiveComponentType.md +142 -124
  235. package/skill/references/enums/ESCH_PrimitiveEventType.md +77 -69
  236. package/skill/references/enums/ESCH_PrimitiveFillStyle.md +129 -113
  237. package/skill/references/enums/ESCH_PrimitiveLineType.md +77 -69
  238. package/skill/references/enums/ESCH_PrimitivePinShape.md +77 -69
  239. package/skill/references/enums/ESCH_PrimitivePinType.md +168 -146
  240. package/skill/references/enums/ESCH_PrimitiveTextAlignMode.md +142 -124
  241. package/skill/references/enums/ESCH_PrimitiveType.md +207 -179
  242. package/skill/references/enums/ESCH_SimulationNetlistType.md +38 -36
  243. package/skill/references/enums/ESCH_SpiceSimulationEnginePullEventType.md +51 -47
  244. package/skill/references/enums/ESCH_SpiceSimulationEnginePushEventType.md +77 -69
  245. package/skill/references/enums/ESYS_BottomPanelTab.md +94 -80
  246. package/skill/references/enums/ESYS_HeaderMenuEnvironment.md +181 -157
  247. package/skill/references/enums/ESYS_ImportProjectBoardOutlineSource.md +55 -51
  248. package/skill/references/enums/ESYS_ImportProjectImportOption.md +64 -58
  249. package/skill/references/enums/ESYS_ImportProjectSchematicObjectStyle.md +51 -47
  250. package/skill/references/enums/ESYS_ImportProjectViaSolderMaskExpansion.md +55 -51
  251. package/skill/references/enums/ESYS_JobState.md +95 -0
  252. package/skill/references/enums/ESYS_LeftPanelTab.md +94 -80
  253. package/skill/references/enums/ESYS_LogType.md +77 -102
  254. package/skill/references/enums/ESYS_NetlistType.md +129 -113
  255. package/skill/references/enums/ESYS_PanelPosition.md +69 -0
  256. package/skill/references/enums/ESYS_PanelTab.md +368 -0
  257. package/skill/references/enums/ESYS_RightPanelTab.md +237 -201
  258. package/skill/references/enums/ESYS_ShortcutKeyEffectiveEditorRange.md +220 -190
  259. package/skill/references/enums/ESYS_ShortcutKeyEffectiveEditorScene.md +103 -91
  260. package/skill/references/enums/ESYS_StartPageQuickStartItem.md +237 -205
  261. package/skill/references/enums/ESYS_Theme.md +51 -47
  262. package/skill/references/enums/ESYS_ToastMessageType.md +90 -80
  263. package/skill/references/enums/ESYS_Unit.md +116 -102
  264. package/skill/references/enums/ESYS_WindowEventType.md +64 -47
  265. package/skill/references/enums/ESYS_WindowOpenTarget.md +51 -47
  266. package/skill/references/enums/NetportDeviceName.md +146 -146
  267. package/skill/references/enums/SchToolBarDeviceName.md +278 -278
  268. package/skill/references/interfaces/BoardProps.md +169 -169
  269. package/skill/references/interfaces/BorderConfig.md +109 -0
  270. package/skill/references/interfaces/ButtonProps.md +196 -169
  271. package/skill/references/interfaces/CellClickInfo.md +142 -0
  272. package/skill/references/interfaces/CellCoord.md +88 -0
  273. package/skill/references/interfaces/CheckBoxProps.md +223 -196
  274. package/skill/references/interfaces/CheckChangeDetail.md +88 -0
  275. package/skill/references/interfaces/CheckboxEditConfig.md +159 -0
  276. package/skill/references/interfaces/ClipboardCellData.md +142 -0
  277. package/skill/references/interfaces/ClipboardConfig.md +115 -0
  278. package/skill/references/interfaces/ColorPickerProps.md +169 -0
  279. package/skill/references/interfaces/ColumnDef.md +605 -0
  280. package/skill/references/interfaces/ColumnEditTrigger.md +57 -0
  281. package/skill/references/interfaces/ColumnGroupDef.md +192 -0
  282. package/skill/references/interfaces/ColumnResizeConfig.md +142 -0
  283. package/skill/references/interfaces/ComponentPropsMap.md +517 -448
  284. package/skill/references/interfaces/CustomHeaderConfig.md +169 -0
  285. package/skill/references/interfaces/DialogProps.md +385 -385
  286. package/skill/references/interfaces/DragSortConfig.md +115 -0
  287. package/skill/references/interfaces/EditingConfig.md +196 -0
  288. package/skill/references/interfaces/FilteringConfig.md +250 -0
  289. package/skill/references/interfaces/FixedColumnConfig.md +88 -0
  290. package/skill/references/interfaces/FlexItemProps.md +116 -116
  291. package/skill/references/interfaces/FlexProps.md +224 -224
  292. package/skill/references/interfaces/GridItemProps.md +143 -143
  293. package/skill/references/interfaces/GridProps.md +143 -143
  294. package/skill/references/interfaces/IDMT_BoardItem.md +171 -171
  295. package/skill/references/interfaces/IDMT_BriefProjectItem.md +171 -171
  296. package/skill/references/interfaces/IDMT_EditorDocumentItem.md +169 -169
  297. package/skill/references/interfaces/IDMT_EditorSplitScreenItem.md +173 -173
  298. package/skill/references/interfaces/IDMT_EditorTabItem.md +169 -169
  299. package/skill/references/interfaces/IDMT_FolderItem.md +225 -225
  300. package/skill/references/interfaces/IDMT_IndicatorMarkerShape.md +393 -393
  301. package/skill/references/interfaces/IDMT_PanelItem.md +144 -144
  302. package/skill/references/interfaces/IDMT_PcbItem.md +171 -171
  303. package/skill/references/interfaces/IDMT_ProjectItem.md +143 -143
  304. package/skill/references/interfaces/IDMT_SchematicItem.md +225 -225
  305. package/skill/references/interfaces/IDMT_SchematicPageItem.md +198 -198
  306. package/skill/references/interfaces/IDMT_TeamItem.md +144 -144
  307. package/skill/references/interfaces/IDMT_WorkspaceItem.md +117 -117
  308. package/skill/references/interfaces/IDesignPortal.md +103 -103
  309. package/skill/references/interfaces/ILIB_3DModelItem.md +198 -198
  310. package/skill/references/interfaces/ILIB_3DModelSearchItem.md +277 -277
  311. package/skill/references/interfaces/ILIB_CbbItem.md +225 -225
  312. package/skill/references/interfaces/ILIB_CbbSearchItem.md +277 -277
  313. package/skill/references/interfaces/ILIB_ClassificationIndex.md +150 -150
  314. package/skill/references/interfaces/ILIB_ClassificationNode.md +98 -0
  315. package/skill/references/interfaces/ILIB_DeviceAssociationItem.md +210 -210
  316. package/skill/references/interfaces/ILIB_DeviceExtendPropertyItem.md +304 -304
  317. package/skill/references/interfaces/ILIB_DeviceItem.md +279 -279
  318. package/skill/references/interfaces/ILIB_DevicePropertiesForSearch.md +250 -250
  319. package/skill/references/interfaces/ILIB_DeviceSearchItem.md +521 -521
  320. package/skill/references/interfaces/ILIB_ExtendLibrary3DModelFunctions.md +64 -64
  321. package/skill/references/interfaces/ILIB_ExtendLibraryCbbFunctions.md +93 -99
  322. package/skill/references/interfaces/ILIB_ExtendLibraryClassificationIndex.md +150 -150
  323. package/skill/references/interfaces/ILIB_ExtendLibraryDeviceFunctions.md +143 -157
  324. package/skill/references/interfaces/ILIB_ExtendLibraryFootprintFunctions.md +63 -63
  325. package/skill/references/interfaces/ILIB_ExtendLibraryFunctions.md +123 -123
  326. package/skill/references/interfaces/ILIB_ExtendLibraryItem.md +97 -97
  327. package/skill/references/interfaces/ILIB_ExtendLibraryItemIndex.md +98 -98
  328. package/skill/references/interfaces/ILIB_ExtendLibrarySearchProperty.md +115 -115
  329. package/skill/references/interfaces/ILIB_ExtendLibrarySearchResult.md +169 -169
  330. package/skill/references/interfaces/ILIB_ExtendLibrarySearchResultDataLine.md +234 -234
  331. package/skill/references/interfaces/ILIB_ExtendLibrarySymbolFunctions.md +91 -105
  332. package/skill/references/interfaces/ILIB_ExtendLibraryUserIndex.md +96 -96
  333. package/skill/references/interfaces/ILIB_FootprintItem.md +256 -198
  334. package/skill/references/interfaces/ILIB_FootprintPropertiesForSearch.md +61 -61
  335. package/skill/references/interfaces/ILIB_FootprintSearchItem.md +277 -277
  336. package/skill/references/interfaces/ILIB_LibraryInfo.md +92 -92
  337. package/skill/references/interfaces/ILIB_LibraryItem.md +115 -115
  338. package/skill/references/interfaces/ILIB_PanelLibraryItem.md +198 -198
  339. package/skill/references/interfaces/ILIB_PanelLibrarySearchItem.md +277 -277
  340. package/skill/references/interfaces/ILIB_RegisterExtendLibraryProps.md +71 -0
  341. package/skill/references/interfaces/ILIB_SimulationModelItem.md +306 -306
  342. package/skill/references/interfaces/ILIB_SimulationModelSearchItem.md +304 -304
  343. package/skill/references/interfaces/ILIB_SymbolItem.md +306 -279
  344. package/skill/references/interfaces/ILIB_SymbolPropertiesForSearch.md +61 -61
  345. package/skill/references/interfaces/ILIB_SymbolSearchItem.md +304 -304
  346. package/skill/references/interfaces/IPCB_AutoLayoutResult.md +169 -169
  347. package/skill/references/interfaces/IPCB_AutoRoutingProps.md +220 -220
  348. package/skill/references/interfaces/IPCB_AutoRoutingResult.md +169 -169
  349. package/skill/references/interfaces/IPCB_BomPropertiesTableColumns.md +169 -169
  350. package/skill/references/interfaces/IPCB_DifferentialPairItem.md +115 -115
  351. package/skill/references/interfaces/IPCB_DiscretizeOptions.md +65 -65
  352. package/skill/references/interfaces/IPCB_DiscretizedPoint.md +88 -88
  353. package/skill/references/interfaces/IPCB_EqualLengthNetGroupItem.md +115 -115
  354. package/skill/references/interfaces/IPCB_LayerItem.md +277 -277
  355. package/skill/references/interfaces/IPCB_NetClassItem.md +115 -115
  356. package/skill/references/interfaces/IPCB_NetInfo.md +115 -115
  357. package/skill/references/interfaces/IPCB_PadPairGroupItem.md +88 -88
  358. package/skill/references/interfaces/IPCB_PadPairMinWireLengthItem.md +88 -88
  359. package/skill/references/interfaces/IPCB_PhysicalStackingConfiguration.md +115 -115
  360. package/skill/references/interfaces/IPCB_Primitive.md +218 -218
  361. package/skill/references/interfaces/IPCB_PrimitiveAPI.md +174 -175
  362. package/skill/references/interfaces/IPCB_PrimitivePadHeatWelding.md +151 -151
  363. package/skill/references/interfaces/IPCB_PrimitivePouredPourFill.md +142 -142
  364. package/skill/references/interfaces/IPCB_PrimitiveSolderMaskAndPasteMaskExpansion.md +154 -154
  365. package/skill/references/interfaces/IPCB_RayTracerBackgroundConfig.md +223 -0
  366. package/skill/references/interfaces/IPCB_RayTracerLightConfig.md +412 -0
  367. package/skill/references/interfaces/IPCB_RayTracerMaterialConfig.md +547 -0
  368. package/skill/references/interfaces/IPCB_RayTracerPcbMaterialConfig.md +196 -0
  369. package/skill/references/interfaces/IPCB_RayTracerRenderConfigurations.md +200 -0
  370. package/skill/references/interfaces/IPCB_RayTracerRendererConfig.md +196 -0
  371. package/skill/references/interfaces/IPCB_RayTracerSceneElement.md +115 -0
  372. package/skill/references/interfaces/IPCB_RayTracerSceneElementTransform.md +123 -0
  373. package/skill/references/interfaces/IPCB_RayTracerTexture.md +88 -0
  374. package/skill/references/interfaces/IPCB_SubstratePhysicalProperties.md +88 -88
  375. package/skill/references/interfaces/IRawNet.md +103 -103
  376. package/skill/references/interfaces/IRawPureSchematic.md +80 -80
  377. package/skill/references/interfaces/IRawSchematic.md +103 -103
  378. package/skill/references/interfaces/IRawWire.md +149 -149
  379. package/skill/references/interfaces/ISCH_DrcError.md +142 -142
  380. package/skill/references/interfaces/ISCH_DrcErrorPrimitive.md +142 -142
  381. package/skill/references/interfaces/ISCH_ExportPngResolution.md +94 -94
  382. package/skill/references/interfaces/ISCH_NetInfo.md +88 -88
  383. package/skill/references/interfaces/ISCH_Primitive.md +218 -219
  384. package/skill/references/interfaces/ISCH_PrimitiveAPI.md +174 -175
  385. package/skill/references/interfaces/ISCH_ProjectNetInfo.md +142 -142
  386. package/skill/references/interfaces/ISCH_WireInfo.md +169 -169
  387. package/skill/references/interfaces/ISYS_ComparisonResponse.md +115 -0
  388. package/skill/references/interfaces/ISYS_ExtensionExternalApiIndex.md +13 -0
  389. package/skill/references/interfaces/ISYS_ExtensionRegisteredExternalApis.md +13 -0
  390. package/skill/references/interfaces/ISYS_ExternalApiHelp.md +173 -0
  391. package/skill/references/interfaces/ISYS_ExternalApiRegistration.md +146 -0
  392. package/skill/references/interfaces/ISYS_FileSystemFileList.md +169 -169
  393. package/skill/references/interfaces/ISYS_HeaderMenuSub1MenuItem.md +205 -174
  394. package/skill/references/interfaces/ISYS_HeaderMenuSub2MenuItem.md +178 -147
  395. package/skill/references/interfaces/ISYS_HeaderMenuTopMenuItem.md +115 -115
  396. package/skill/references/interfaces/ISYS_HeaderMenus.md +408 -408
  397. package/skill/references/interfaces/ISYS_HelpAudienceEntry.md +92 -0
  398. package/skill/references/interfaces/ISYS_HelpClassSummary.md +205 -0
  399. package/skill/references/interfaces/ISYS_HelpData.md +92 -0
  400. package/skill/references/interfaces/ISYS_HelpMethodDetail.md +310 -0
  401. package/skill/references/interfaces/ISYS_JobHandle.md +65 -0
  402. package/skill/references/interfaces/ISYS_JobLogEntry.md +142 -0
  403. package/skill/references/interfaces/ISYS_JobStatus.md +176 -0
  404. package/skill/references/interfaces/ISYS_LogLine.md +115 -115
  405. package/skill/references/interfaces/ISYS_MathBBox.md +142 -142
  406. package/skill/references/interfaces/ISYS_MathPoint.md +88 -88
  407. package/skill/references/interfaces/ISYS_MathPolygonWithHoles.md +92 -92
  408. package/skill/references/interfaces/ISYS_MessageBusTask.md +115 -115
  409. package/skill/references/interfaces/ISYS_MultilingualLanguagesData.md +12 -12
  410. package/skill/references/interfaces/ISYS_RightClickMenuItem.md +174 -174
  411. package/skill/references/interfaces/ISYS_ShortcutKeyData.md +169 -169
  412. package/skill/references/interfaces/ISYS_ShortcutKeyDataWithCallFn.md +62 -62
  413. package/skill/references/interfaces/ISYS_ShortcutKeyDataWithUserDefinedShortcutKey.md +62 -62
  414. package/skill/references/interfaces/ISYS_WindowEventListenerRemovableObject.md +109 -109
  415. package/skill/references/interfaces/IconProps.md +88 -88
  416. package/skill/references/interfaces/ImageProps.md +115 -115
  417. package/skill/references/interfaces/InputEditConfig.md +182 -0
  418. package/skill/references/interfaces/InputProps.md +547 -520
  419. package/skill/references/interfaces/KeyboardConfig.md +61 -0
  420. package/skill/references/interfaces/ListChildren.md +223 -223
  421. package/skill/references/interfaces/ListProps.md +250 -223
  422. package/skill/references/interfaces/ModalProps.md +358 -358
  423. package/skill/references/interfaces/NumberEditConfig.md +234 -0
  424. package/skill/references/interfaces/RadioGroupProps.md +196 -196
  425. package/skill/references/interfaces/RadioItem.md +115 -115
  426. package/skill/references/interfaces/RichTableProps.md +1357 -0
  427. package/skill/references/interfaces/RowMetaConfig.md +142 -0
  428. package/skill/references/interfaces/ScrollerProps.md +169 -169
  429. package/skill/references/interfaces/SelectEditConfig.md +211 -0
  430. package/skill/references/interfaces/SelectListItem.md +142 -142
  431. package/skill/references/interfaces/SelectOption.md +142 -0
  432. package/skill/references/interfaces/SelectProps.md +169 -169
  433. package/skill/references/interfaces/SelectionConfig.md +358 -0
  434. package/skill/references/interfaces/SliderProps.md +142 -0
  435. package/skill/references/interfaces/SlotProps.md +88 -88
  436. package/skill/references/interfaces/SortState.md +88 -0
  437. package/skill/references/interfaces/SortingConfig.md +169 -0
  438. package/skill/references/interfaces/StyleProps.md +439 -385
  439. package/skill/references/interfaces/TextAreaProps.md +196 -196
  440. package/skill/references/interfaces/TextProps.md +169 -169
  441. package/skill/references/interfaces/TextareaEditConfig.md +182 -0
  442. package/skill/references/interfaces/ValidationRule.md +223 -0
  443. package/skill/references/interfaces/VirtualScrollConfig.md +115 -0
  444. package/skill/references/types/Align.md +9 -0
  445. package/skill/references/types/CellContentType.md +9 -0
  446. package/skill/references/types/ColumnDefOrGroup.md +12 -0
  447. package/skill/references/types/ColumnEditConfig.md +13 -0
  448. package/skill/references/types/ColumnType.md +9 -0
  449. package/skill/references/types/DataChangeType.md +9 -0
  450. package/skill/references/types/FilterMatchMode.md +9 -0
  451. package/skill/references/types/RichTableRow.md +12 -0
  452. package/skill/references/types/Serializable.md +10 -0
  453. package/skill/references/types/SerializablePrimitive.md +9 -0
  454. package/skill/references/types/SortOrder.md +9 -0
  455. package/skill/references/types/TPCB_LayerTypesOfInnerLayer.md +11 -11
  456. package/skill/references/types/TPCB_LayersInTheSelectable.md +42 -42
  457. package/skill/references/types/TPCB_LayersOfComponent.md +11 -11
  458. package/skill/references/types/TPCB_LayersOfCopper.md +15 -15
  459. package/skill/references/types/TPCB_LayersOfCustom.md +41 -41
  460. package/skill/references/types/TPCB_LayersOfDimension.md +16 -16
  461. package/skill/references/types/TPCB_LayersOfFill.md +28 -28
  462. package/skill/references/types/TPCB_LayersOfImage.md +22 -22
  463. package/skill/references/types/TPCB_LayersOfInner.md +41 -41
  464. package/skill/references/types/TPCB_LayersOfLine.md +25 -25
  465. package/skill/references/types/TPCB_LayersOfObject.md +12 -12
  466. package/skill/references/types/TPCB_LayersOfPad.md +11 -11
  467. package/skill/references/types/TPCB_LayersOfRegion.md +11 -11
  468. package/skill/references/types/TPCB_NumberOfCopperLayers.md +9 -9
  469. package/skill/references/types/TPCB_PolygonSourceArray.md +85 -83
  470. package/skill/references/types/TPCB_PrimitiveDimensionCoordinateSet.md +66 -66
  471. package/skill/references/types/TPCB_PrimitivePadHole.md +30 -30
  472. package/skill/references/types/TPCB_PrimitivePadShape.md +61 -61
  473. package/skill/references/types/TPCB_PrimitiveSpecialPadShape.md +19 -19
  474. package/skill/references/types/TSYS_ComparisonErrorCode.md +15 -0
  475. package/skill/references/types/TSYS_LanguageKeyValuePairs.md +13 -0
  476. package/skill/references/types/TSYS_MathPolygonGroup.md +15 -15
  477. package/skill/references/types/TSYS_MathPolygonInput.md +20 -20
  478. package/skill/references/types/TSYS_ShortcutKeys.md +96 -96
  479. package/skill/user-guide/using-extension.md +47 -47
  480. package/src/json-gen.test.js +430 -0
  481. package/skill/guide/ancillary-projects/pro-api-sdk.md +0 -1
  482. package/skill/references/interfaces/ISYS_PcbComparisonResponse.md +0 -115
  483. package/skill/references/types/ISYS_LanguageKeyValuePairs.md +0 -13
  484. package/skill/references/types/TSYS_PcbComparisonErrorCode.md +0 -10
@@ -1,1325 +1,1325 @@
1
- # IPCB\_PrimitiveFill class
2
-
3
- Fill primitive
4
-
5
- ## Signature
6
-
7
- ```typescript
8
- class IPCB_PrimitiveFill 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
- [convertToPolyline()](./IPCB_PrimitiveFill.md)
32
-
33
- </td><td>
34
-
35
- </td><td>
36
-
37
- **_(BETA)_** Convert to: polyline primitive
38
-
39
- </td></tr>
40
- <tr><td>
41
-
42
- [convertToPour()](./IPCB_PrimitiveFill.md)
43
-
44
- </td><td>
45
-
46
- </td><td>
47
-
48
- **_(BETA)_** Convert to: Copper border primitive
49
-
50
- </td></tr>
51
- <tr><td>
52
-
53
- [convertToRegion()](./IPCB_PrimitiveFill.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_PrimitiveFill.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
- [getState\_ComplexPolygon()](./IPCB_PrimitiveFill.md)
76
-
77
- </td><td>
78
-
79
- </td><td>
80
-
81
- Get the property state: complex polygon
82
-
83
- </td></tr>
84
- <tr><td>
85
-
86
- [getState\_FillMode()](./IPCB_PrimitiveFill.md)
87
-
88
- </td><td>
89
-
90
- </td><td>
91
-
92
- Get the property state: fill mode
93
-
94
- </td></tr>
95
- <tr><td>
96
-
97
- [getState\_Layer()](./IPCB_PrimitiveFill.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_PrimitiveFill.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_PrimitiveFill.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\_PrimitiveId()](./IPCB_PrimitiveFill.md)
131
-
132
- </td><td>
133
-
134
- </td><td>
135
-
136
- Get the property state: primitive ID
137
-
138
- </td></tr>
139
- <tr><td>
140
-
141
- [getState\_PrimitiveLock()](./IPCB_PrimitiveFill.md)
142
-
143
- </td><td>
144
-
145
- </td><td>
146
-
147
- Get the property state: whether it is locked
148
-
149
- </td></tr>
150
- <tr><td>
151
-
152
- [getState\_PrimitiveType()](./IPCB_PrimitiveFill.md)
153
-
154
- </td><td>
155
-
156
- </td><td>
157
-
158
- Get the property state: primitive type
159
-
160
- </td></tr>
161
- <tr><td>
162
-
163
- [isAsync()](./IPCB_PrimitiveFill.md)
164
-
165
- </td><td>
166
-
167
- </td><td>
168
-
169
- Query whether the primitive is an async primitive
170
-
171
- </td></tr>
172
- <tr><td>
173
-
174
- [reset()](./IPCB_PrimitiveFill.md)
175
-
176
- </td><td>
177
-
178
- </td><td>
179
-
180
- **_(BETA)_** Reset the async primitive to the current canvas state
181
-
182
- </td></tr>
183
- <tr><td>
184
-
185
- [setState\_ComplexPolygon(complexPolygon)](./IPCB_PrimitiveFill.md)
186
-
187
- </td><td>
188
-
189
- </td><td>
190
-
191
- **_(BETA)_** Set the property state: complex polygon
192
-
193
- </td></tr>
194
- <tr><td>
195
-
196
- [setState\_FillMode(fillMode)](./IPCB_PrimitiveFill.md)
197
-
198
- </td><td>
199
-
200
- </td><td>
201
-
202
- **_(BETA)_** Set the property state: fill mode
203
-
204
- </td></tr>
205
- <tr><td>
206
-
207
- [setState\_Layer(layer)](./IPCB_PrimitiveFill.md)
208
-
209
- </td><td>
210
-
211
- </td><td>
212
-
213
- **_(BETA)_** Set the property state: Layer
214
-
215
- </td></tr>
216
- <tr><td>
217
-
218
- [setState\_LineWidth(lineWidth)](./IPCB_PrimitiveFill.md)
219
-
220
- </td><td>
221
-
222
- </td><td>
223
-
224
- **_(BETA)_** Set the property state: Line width
225
-
226
- </td></tr>
227
- <tr><td>
228
-
229
- [setState\_Net(net)](./IPCB_PrimitiveFill.md)
230
-
231
- </td><td>
232
-
233
- </td><td>
234
-
235
- **_(BETA)_** Set the property state: net name
236
-
237
- </td></tr>
238
- <tr><td>
239
-
240
- [setState\_PrimitiveLock(primitiveLock)](./IPCB_PrimitiveFill.md)
241
-
242
- </td><td>
243
-
244
- </td><td>
245
-
246
- **_(BETA)_** Set the property state: whether it is locked
247
-
248
- </td></tr>
249
- <tr><td>
250
-
251
- [toAsync()](./IPCB_PrimitiveFill.md)
252
-
253
- </td><td>
254
-
255
- </td><td>
256
-
257
- Convert Primitive to Async primitive
258
-
259
- </td></tr>
260
- <tr><td>
261
-
262
- [toSync()](./IPCB_PrimitiveFill.md)
263
-
264
- </td><td>
265
-
266
- </td><td>
267
-
268
- Convert Primitive to Sync primitive
269
-
270
- </td></tr>
271
- </tbody></table>
272
-
273
- ---
274
-
275
- ## 方法详情
276
-
277
- ### converttopolyline
278
-
279
- # IPCB\_PrimitiveFill.convertToPolyline() method
280
-
281
- > 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.
282
-
283
- Convert to: polyline primitive
284
-
285
- ## Signature
286
-
287
- ```typescript
288
- function convertToPolyline(): Promise<IPCB_PrimitivePolyline>;
289
- ```
290
-
291
- ## Returns
292
-
293
- Promise&lt;[IPCB\_PrimitivePolyline](./IPCB_PrimitivePolyline.md)<!-- -->&gt;
294
-
295
- Polyline primitive object
296
-
297
- ## Example
298
-
299
- ```javascript
300
- // 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
301
- const x = 2000 + Math.floor(Math.random() * 100000);
302
- const y = 2000 + Math.floor(Math.random() * 100000);
303
-
304
- // 2. 创建一个矩形填充
305
- const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
306
- const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
307
-
308
- // 3. 转换为折线图元(保留现场供观察)
309
- const polyline = await fill.convertToPolyline();
310
-
311
- console.log('primitiveType:', `Fill → ${polyline.getState_PrimitiveType()}`);
312
- console.log('primitiveId:', polyline.getState_PrimitiveId());
313
- ```
314
-
315
- ### converttopour
316
-
317
- # IPCB\_PrimitiveFill.convertToPour() method
318
-
319
- > 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.
320
-
321
- Convert to: Copper border primitive
322
-
323
- ## Signature
324
-
325
- ```typescript
326
- function convertToPour(): Promise<IPCB_PrimitivePour>;
327
- ```
328
-
329
- ## Returns
330
-
331
- Promise&lt;[IPCB\_PrimitivePour](./IPCB_PrimitivePour.md)<!-- -->&gt;
332
-
333
- Copper border primitive object
334
-
335
- ## Example
336
-
337
- ```javascript
338
- // 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
339
- const x = 2000 + Math.floor(Math.random() * 100000);
340
- const y = 2000 + Math.floor(Math.random() * 100000);
341
-
342
- // 2. 创建一个矩形填充
343
- const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
344
- const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
345
-
346
- // 3. 转换为覆铜边框图元(保留现场供观察)
347
- const pour = await fill.convertToPour();
348
-
349
- console.log('primitiveType:', `Fill → ${pour.getState_PrimitiveType()}`);
350
- console.log('primitiveId:', pour.getState_PrimitiveId());
351
- ```
352
-
353
- ### converttoregion
354
-
355
- # IPCB\_PrimitiveFill.convertToRegion() method
356
-
357
- > 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.
358
-
359
- Convert to: region primitive (default is the forbidden region)
360
-
361
- ## Signature
362
-
363
- ```typescript
364
- function convertToRegion(): Promise<IPCB_PrimitiveRegion>;
365
- ```
366
-
367
- ## Returns
368
-
369
- Promise&lt;[IPCB\_PrimitiveRegion](./IPCB_PrimitiveRegion.md)<!-- -->&gt;
370
-
371
- Region primitive object
372
-
373
- ## Example
374
-
375
- ```javascript
376
- // 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
377
- const x = 2000 + Math.floor(Math.random() * 100000);
378
- const y = 2000 + Math.floor(Math.random() * 100000);
379
-
380
- // 2. 创建一个矩形填充
381
- const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
382
- const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
383
-
384
- // 3. 转换为区域图元(默认是禁止区域,保留现场供观察)
385
- const region = await fill.convertToRegion();
386
-
387
- console.log('primitiveType:', `Fill → ${region.getState_PrimitiveType()}`);
388
- console.log('primitiveId:', region.getState_PrimitiveId());
389
- ```
390
-
391
- ### done
392
-
393
- # IPCB\_PrimitiveFill.done() method
394
-
395
- > 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.
396
-
397
- Apply the changes to the primitives to the canvas
398
-
399
- ## Signature
400
-
401
- ```typescript
402
- function done(): Promise<IPCB_PrimitiveFill>;
403
- ```
404
-
405
- ## Returns
406
-
407
- Promise&lt;[IPCB\_PrimitiveFill](./IPCB_PrimitiveFill.md)<!-- -->&gt;
408
-
409
- Fill primitive object
410
-
411
- ## Example
412
-
413
- ```javascript
414
- // 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
415
- const x = 2000 + Math.floor(Math.random() * 100000);
416
- const y = 2000 + Math.floor(Math.random() * 100000);
417
-
418
- // 2. 创建一个顶层铜层的矩形填充
419
- const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
420
- const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
421
- const before = fill.getState_Layer();
422
-
423
- // 3. 异步模式下把填充挪到底层铜层(此时画布还没变)
424
- const asyncFill = fill.toAsync();
425
- asyncFill.setState_Layer(2);
426
- await asyncFill.done();
427
-
428
- // 4. 从画布重新读取,确认修改已生效(保留现场供观察)
429
- const refetched = await eda.pcb_PrimitiveFill.get(fill.getState_PrimitiveId());
430
-
431
- console.log('layer:', before, '→', refetched.getState_Layer());
432
- ```
433
-
434
- ### getstate_complexpolygon
435
-
436
- # IPCB\_PrimitiveFill.getState\_ComplexPolygon() method
437
-
438
- Get the property state: complex polygon
439
-
440
- ## Signature
441
-
442
- ```typescript
443
- function getState_ComplexPolygon(): IPCB_Polygon;
444
- ```
445
-
446
- ## Returns
447
-
448
- [IPCB\_Polygon](./IPCB_Polygon.md)
449
-
450
- Complex polygon
451
-
452
- ## Example
453
-
454
- ```javascript
455
- // 1. 创建一个已知轮廓的矩形填充(500 x 300 mil)
456
- const x = 2000 + Math.floor(Math.random() * 100000);
457
- const y = 2000 + Math.floor(Math.random() * 100000);
458
- const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
459
- const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
460
-
461
- // 2. 读取复杂多边形对象,再取它的轮廓源数组
462
- const complexPolygon = fill.getState_ComplexPolygon();
463
- const source = complexPolygon.getSource();
464
-
465
- // 3. 清理测试图元(查询类案例不留测试对象)
466
- await eda.pcb_PrimitiveFill.delete([fill.getState_PrimitiveId()]);
467
-
468
- console.log('polygonSource:', JSON.stringify(source));
469
- ```
470
-
471
- ### getstate_fillmode
472
-
473
- # IPCB\_PrimitiveFill.getState\_FillMode() method
474
-
475
- Get the property state: fill mode
476
-
477
- ## Signature
478
-
479
- ```typescript
480
- function getState_FillMode(): EPCB_PrimitiveFillMode | undefined;
481
- ```
482
-
483
- ## Returns
484
-
485
- [EPCB\_PrimitiveFillMode](../enums/EPCB_PrimitiveFillMode.md) \| undefined
486
-
487
- Fill mode
488
-
489
- ## Example
490
-
491
- ```javascript
492
- // 1. 创建一个实心填充的矩形
493
- const x = 2000 + Math.floor(Math.random() * 100000);
494
- const y = 2000 + Math.floor(Math.random() * 100000);
495
- const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
496
- const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
497
-
498
- // 2. 读取填充模式(0=SOLID 实心,1=MESH 网格,2=INNER_ELECTRICAL_LAYER 内电层)
499
- const fillMode = fill.getState_FillMode();
500
-
501
- // 3. 清理测试图元(查询类案例不留测试对象)
502
- await eda.pcb_PrimitiveFill.delete([fill.getState_PrimitiveId()]);
503
-
504
- console.log('fillMode:', fillMode);
505
- ```
506
-
507
- ### getstate_layer
508
-
509
- # IPCB\_PrimitiveFill.getState\_Layer() method
510
-
511
- Get the property state: Layer
512
-
513
- ## Signature
514
-
515
- ```typescript
516
- function getState_Layer(): TPCB_LayersOfFill;
517
- ```
518
-
519
- ## Returns
520
-
521
- [TPCB\_LayersOfFill](../types/TPCB_LayersOfFill.md)
522
-
523
- Layer
524
-
525
- ## Example
526
-
527
- ```javascript
528
- // 1. 创建一个顶层铜层(1)的矩形填充
529
- const x = 2000 + Math.floor(Math.random() * 100000);
530
- const y = 2000 + Math.floor(Math.random() * 100000);
531
- const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
532
- const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
533
-
534
- // 2. 读取填充所在层
535
- const layer = fill.getState_Layer();
536
-
537
- // 3. 清理测试图元(查询类案例不留测试对象)
538
- await eda.pcb_PrimitiveFill.delete([fill.getState_PrimitiveId()]);
539
-
540
- console.log('layer:', layer);
541
- ```
542
-
543
- ### getstate_linewidth
544
-
545
- # IPCB\_PrimitiveFill.getState\_LineWidth() method
546
-
547
- Get the property state: Line width
548
-
549
- ## Signature
550
-
551
- ```typescript
552
- function getState_LineWidth(): number;
553
- ```
554
-
555
- ## Returns
556
-
557
- number
558
-
559
- Line width
560
-
561
- ## Example
562
-
563
- ```javascript
564
- // 1. 创建一个 10mil 线宽的矩形填充
565
- const x = 2000 + Math.floor(Math.random() * 100000);
566
- const y = 2000 + Math.floor(Math.random() * 100000);
567
- const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
568
- const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
569
-
570
- // 2. 读取线宽
571
- const lineWidth = fill.getState_LineWidth();
572
-
573
- // 3. 清理测试图元(查询类案例不留测试对象)
574
- await eda.pcb_PrimitiveFill.delete([fill.getState_PrimitiveId()]);
575
-
576
- console.log('lineWidth:', lineWidth);
577
- ```
578
-
579
- ### getstate_net
580
-
581
- # IPCB\_PrimitiveFill.getState\_Net() method
582
-
583
- Get the property state: net name
584
-
585
- ## Signature
586
-
587
- ```typescript
588
- function getState_Net(): string | undefined;
589
- ```
590
-
591
- ## Returns
592
-
593
- string \| undefined
594
-
595
- Net name
596
-
597
- ## Example
598
-
599
- ```javascript
600
- // 1. 创建一个无网络的矩形填充
601
- const x = 2000 + Math.floor(Math.random() * 100000);
602
- const y = 2000 + Math.floor(Math.random() * 100000);
603
- const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
604
- const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
605
-
606
- // 2. 读取网络名称(无网络时为空字符串)
607
- const net = fill.getState_Net();
608
-
609
- // 3. 清理测试图元(查询类案例不留测试对象)
610
- await eda.pcb_PrimitiveFill.delete([fill.getState_PrimitiveId()]);
611
-
612
- console.log('net:', JSON.stringify(net));
613
- ```
614
-
615
- ### getstate_primitiveid
616
-
617
- # IPCB\_PrimitiveFill.getState\_PrimitiveId() method
618
-
619
- Get the property state: primitive ID
620
-
621
- ## Signature
622
-
623
- ```typescript
624
- function getState_PrimitiveId(): string;
625
- ```
626
-
627
- ## Returns
628
-
629
- string
630
-
631
- Primitive ID
632
-
633
- ## Example
634
-
635
- ```javascript
636
- // 1. 创建一个矩形填充
637
- const x = 2000 + Math.floor(Math.random() * 100000);
638
- const y = 2000 + Math.floor(Math.random() * 100000);
639
- const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
640
- const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
641
-
642
- // 2. 读取图元 ID
643
- const primitiveId = fill.getState_PrimitiveId();
644
-
645
- // 3. 清理测试图元(查询类案例不留测试对象)
646
- await eda.pcb_PrimitiveFill.delete([fill.getState_PrimitiveId()]);
647
-
648
- console.log('primitiveId:', primitiveId);
649
- ```
650
-
651
- ### getstate_primitivelock
652
-
653
- # IPCB\_PrimitiveFill.getState\_PrimitiveLock() method
654
-
655
- Get the property state: whether it is locked
656
-
657
- ## Signature
658
-
659
- ```typescript
660
- function getState_PrimitiveLock(): boolean;
661
- ```
662
-
663
- ## Returns
664
-
665
- boolean
666
-
667
- Whether it is locked
668
-
669
- ## Example
670
-
671
- ```javascript
672
- // 1. 创建一个未锁定的矩形填充
673
- const x = 2000 + Math.floor(Math.random() * 100000);
674
- const y = 2000 + Math.floor(Math.random() * 100000);
675
- const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
676
- const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
677
-
678
- // 2. 读取锁定状态
679
- const primitiveLock = fill.getState_PrimitiveLock();
680
-
681
- // 3. 清理测试图元(查询类案例不留测试对象)
682
- await eda.pcb_PrimitiveFill.delete([fill.getState_PrimitiveId()]);
683
-
684
- console.log('primitiveLock:', primitiveLock);
685
- ```
686
-
687
- ### getstate_primitivetype
688
-
689
- # IPCB\_PrimitiveFill.getState\_PrimitiveType() method
690
-
691
- Get the property state: primitive type
692
-
693
- ## Signature
694
-
695
- ```typescript
696
- function getState_PrimitiveType(): EPCB_PrimitiveType;
697
- ```
698
-
699
- ## Returns
700
-
701
- [EPCB\_PrimitiveType](../enums/EPCB_PrimitiveType.md)
702
-
703
- Primitive type
704
-
705
- ## Example
706
-
707
- ```javascript
708
- // 1. 创建一个矩形填充
709
- const x = 2000 + Math.floor(Math.random() * 100000);
710
- const y = 2000 + Math.floor(Math.random() * 100000);
711
- const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
712
- const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
713
-
714
- // 2. 读取图元类型
715
- const primitiveType = fill.getState_PrimitiveType();
716
-
717
- // 3. 清理测试图元(查询类案例不留测试对象)
718
- await eda.pcb_PrimitiveFill.delete([fill.getState_PrimitiveId()]);
719
-
720
- console.log('primitiveType:', primitiveType);
721
- ```
722
-
723
- ### isasync
724
-
725
- # IPCB\_PrimitiveFill.isAsync() method
726
-
727
- Query whether the primitive is an async primitive
728
-
729
- ## Signature
730
-
731
- ```typescript
732
- function isAsync(): boolean;
733
- ```
734
-
735
- ## Returns
736
-
737
- boolean
738
-
739
- Whether Is async primitive
740
-
741
- ## Example
742
-
743
- ```javascript
744
- // 1. 创建一个矩形填充
745
- const x = 2000 + Math.floor(Math.random() * 100000);
746
- const y = 2000 + Math.floor(Math.random() * 100000);
747
- const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
748
- const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
749
-
750
- // 2. 查询异步模式
751
- const isAsync = fill.isAsync();
752
-
753
- // 3. 清理测试图元(查询类案例不留测试对象)
754
- await eda.pcb_PrimitiveFill.delete([fill.getState_PrimitiveId()]);
755
-
756
- console.log('isAsync:', isAsync);
757
- ```
758
-
759
- ### reset
760
-
761
- # IPCB\_PrimitiveFill.reset() method
762
-
763
- > 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.
764
-
765
- Reset the async primitive to the current canvas state
766
-
767
- ## Signature
768
-
769
- ```typescript
770
- function reset(): Promise<IPCB_PrimitiveFill>;
771
- ```
772
-
773
- ## Returns
774
-
775
- Promise&lt;[IPCB\_PrimitiveFill](./IPCB_PrimitiveFill.md)<!-- -->&gt;
776
-
777
- Fill primitive object
778
-
779
- ## Example
780
-
781
- ```javascript
782
- // 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
783
- const x = 2000 + Math.floor(Math.random() * 100000);
784
- const y = 2000 + Math.floor(Math.random() * 100000);
785
-
786
- // 2. 创建一个顶层铜层的矩形填充
787
- const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
788
- const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
789
- const before = fill.getState_Layer();
790
-
791
- // 3. 异步模式下把层改到底层(2),随后反悔
792
- const asyncFill = fill.toAsync();
793
- asyncFill.setState_Layer(2);
794
-
795
- // 4. reset 丢弃未提交的修改(保留现场供观察)
796
- await asyncFill.reset();
797
-
798
- // 5. 从画布重新读取,确认层没有变
799
- const refetched = await eda.pcb_PrimitiveFill.get(fill.getState_PrimitiveId());
800
-
801
- console.log('layer:', before, '→', refetched.getState_Layer());
802
- ```
803
-
804
- ### setstate_complexpolygon
805
-
806
- # IPCB\_PrimitiveFill.setState\_ComplexPolygon() method
807
-
808
- > 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.
809
-
810
- Set the property state: complex polygon
811
-
812
- ## Signature
813
-
814
- ```typescript
815
- function setState_ComplexPolygon(complexPolygon: IPCB_Polygon): IPCB_PrimitiveFill;
816
- ```
817
-
818
- ## Parameters
819
-
820
- <table><thead><tr><th>
821
-
822
- Parameter
823
-
824
- </th><th>
825
-
826
- Type
827
-
828
- </th><th>
829
-
830
- Description
831
-
832
- </th></tr></thead>
833
- <tbody><tr><td>
834
-
835
- complexPolygon
836
-
837
- </td><td>
838
-
839
- [IPCB\_Polygon](./IPCB_Polygon.md)
840
-
841
- </td><td>
842
-
843
- Complex polygon
844
-
845
- </td></tr>
846
- </tbody></table>
847
-
848
- ## Returns
849
-
850
- [IPCB\_PrimitiveFill](./IPCB_PrimitiveFill.md)
851
-
852
- Fill primitive object
853
-
854
- ## Example
855
-
856
- ```javascript
857
- // 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
858
- const x = 2000 + Math.floor(Math.random() * 100000);
859
- const y = 2000 + Math.floor(Math.random() * 100000);
860
-
861
- // 2. 创建一个 500 x 300 的矩形填充
862
- const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
863
- const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
864
- const before = JSON.stringify(fill.getState_ComplexPolygon().getSource());
865
-
866
- // 3. 构造新轮廓(放大到 800 x 400),异步模式提交
867
- const newPolygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 800, 400, 0, 0]);
868
- const asyncFill = fill.toAsync();
869
- asyncFill.setState_ComplexPolygon(newPolygon);
870
- await asyncFill.done();
871
-
872
- // 4. 从画布重新读取,确认轮廓已替换(保留现场供观察)
873
- const refetched = await eda.pcb_PrimitiveFill.get(fill.getState_PrimitiveId());
874
- const after = JSON.stringify(refetched.getState_ComplexPolygon().getSource());
875
-
876
- console.log('polygonSource:', before, '→', after);
877
- ```
878
-
879
- ### setstate_fillmode
880
-
881
- # IPCB\_PrimitiveFill.setState\_FillMode() method
882
-
883
- > 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.
884
-
885
- Set the property state: fill mode
886
-
887
- ## Signature
888
-
889
- ```typescript
890
- function setState_FillMode(fillMode: EPCB_PrimitiveFillMode): IPCB_PrimitiveFill;
891
- ```
892
-
893
- ## Parameters
894
-
895
- <table><thead><tr><th>
896
-
897
- Parameter
898
-
899
- </th><th>
900
-
901
- Type
902
-
903
- </th><th>
904
-
905
- Description
906
-
907
- </th></tr></thead>
908
- <tbody><tr><td>
909
-
910
- fillMode
911
-
912
- </td><td>
913
-
914
- [EPCB\_PrimitiveFillMode](../enums/EPCB_PrimitiveFillMode.md)
915
-
916
- </td><td>
917
-
918
- Fill mode
919
-
920
- </td></tr>
921
- </tbody></table>
922
-
923
- ## Returns
924
-
925
- [IPCB\_PrimitiveFill](./IPCB_PrimitiveFill.md)
926
-
927
- Fill primitive object
928
-
929
- ## Example
930
-
931
- ```javascript
932
- // 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
933
- const x = 2000 + Math.floor(Math.random() * 100000);
934
- const y = 2000 + Math.floor(Math.random() * 100000);
935
-
936
- // 2. 创建一个内电层模式(2)的矩形填充
937
- const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
938
- const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 2, 10, false);
939
- const before = fill.getState_FillMode();
940
-
941
- // 3. 异步模式切换为实心填充(0)
942
- const asyncFill = fill.toAsync();
943
- asyncFill.setState_FillMode(0);
944
- await asyncFill.done();
945
-
946
- // 4. 从画布重新读取,确认模式已切换(保留现场供观察)
947
- const refetched = await eda.pcb_PrimitiveFill.get(fill.getState_PrimitiveId());
948
-
949
- console.log('fillMode:', before, '→', refetched.getState_FillMode());
950
- ```
951
-
952
- ### setstate_layer
953
-
954
- # IPCB\_PrimitiveFill.setState\_Layer() method
955
-
956
- > 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.
957
-
958
- Set the property state: Layer
959
-
960
- ## Signature
961
-
962
- ```typescript
963
- function setState_Layer(layer: TPCB_LayersOfFill): IPCB_PrimitiveFill;
964
- ```
965
-
966
- ## Parameters
967
-
968
- <table><thead><tr><th>
969
-
970
- Parameter
971
-
972
- </th><th>
973
-
974
- Type
975
-
976
- </th><th>
977
-
978
- Description
979
-
980
- </th></tr></thead>
981
- <tbody><tr><td>
982
-
983
- layer
984
-
985
- </td><td>
986
-
987
- [TPCB\_LayersOfFill](../types/TPCB_LayersOfFill.md)
988
-
989
- </td><td>
990
-
991
- Layer
992
-
993
- </td></tr>
994
- </tbody></table>
995
-
996
- ## Returns
997
-
998
- [IPCB\_PrimitiveFill](./IPCB_PrimitiveFill.md)
999
-
1000
- Fill primitive object
1001
-
1002
- ## Example
1003
-
1004
- ```javascript
1005
- // 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
1006
- const x = 2000 + Math.floor(Math.random() * 100000);
1007
- const y = 2000 + Math.floor(Math.random() * 100000);
1008
-
1009
- // 2. 创建一个顶层铜层(1)的矩形填充
1010
- const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
1011
- const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
1012
- const before = fill.getState_Layer();
1013
-
1014
- // 3. 异步模式把填充挪到底层铜层(2)
1015
- const asyncFill = fill.toAsync();
1016
- asyncFill.setState_Layer(2);
1017
- await asyncFill.done();
1018
-
1019
- // 4. 从画布重新读取,确认层已切换(保留现场供观察)
1020
- const refetched = await eda.pcb_PrimitiveFill.get(fill.getState_PrimitiveId());
1021
-
1022
- console.log('layer:', before, '→', refetched.getState_Layer());
1023
- ```
1024
-
1025
- ### setstate_linewidth
1026
-
1027
- # IPCB\_PrimitiveFill.setState\_LineWidth() method
1028
-
1029
- > 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.
1030
-
1031
- Set the property state: Line width
1032
-
1033
- ## Signature
1034
-
1035
- ```typescript
1036
- function setState_LineWidth(lineWidth: number): IPCB_PrimitiveFill;
1037
- ```
1038
-
1039
- ## Parameters
1040
-
1041
- <table><thead><tr><th>
1042
-
1043
- Parameter
1044
-
1045
- </th><th>
1046
-
1047
- Type
1048
-
1049
- </th><th>
1050
-
1051
- Description
1052
-
1053
- </th></tr></thead>
1054
- <tbody><tr><td>
1055
-
1056
- lineWidth
1057
-
1058
- </td><td>
1059
-
1060
- number
1061
-
1062
- </td><td>
1063
-
1064
- Line width
1065
-
1066
- </td></tr>
1067
- </tbody></table>
1068
-
1069
- ## Returns
1070
-
1071
- [IPCB\_PrimitiveFill](./IPCB_PrimitiveFill.md)
1072
-
1073
- Fill primitive object
1074
-
1075
- ## Example
1076
-
1077
- ```javascript
1078
- // 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
1079
- const x = 2000 + Math.floor(Math.random() * 100000);
1080
- const y = 2000 + Math.floor(Math.random() * 100000);
1081
-
1082
- // 2. 创建一个 10mil 线宽的矩形填充
1083
- const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
1084
- const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
1085
- const before = fill.getState_LineWidth();
1086
-
1087
- // 3. 切换异步模式,线宽加粗到 20mil
1088
- const asyncFill = fill.toAsync();
1089
- asyncFill.setState_LineWidth(20);
1090
- await asyncFill.done();
1091
-
1092
- // 4. 从图元对象读回新值(保留现场供观察)
1093
- // 注:当前版本画布侧渲染线宽保持默认值,修改在图元对象上生效
1094
- const after = fill.getState_LineWidth();
1095
-
1096
- console.log('lineWidth:', before, '→', after);
1097
- ```
1098
-
1099
- ### setstate_net
1100
-
1101
- # IPCB\_PrimitiveFill.setState\_Net() method
1102
-
1103
- > 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.
1104
-
1105
- Set the property state: net name
1106
-
1107
- ## Signature
1108
-
1109
- ```typescript
1110
- function setState_Net(net: string): IPCB_PrimitiveFill;
1111
- ```
1112
-
1113
- ## Parameters
1114
-
1115
- <table><thead><tr><th>
1116
-
1117
- Parameter
1118
-
1119
- </th><th>
1120
-
1121
- Type
1122
-
1123
- </th><th>
1124
-
1125
- Description
1126
-
1127
- </th></tr></thead>
1128
- <tbody><tr><td>
1129
-
1130
- net
1131
-
1132
- </td><td>
1133
-
1134
- string
1135
-
1136
- </td><td>
1137
-
1138
- Net name
1139
-
1140
- </td></tr>
1141
- </tbody></table>
1142
-
1143
- ## Returns
1144
-
1145
- [IPCB\_PrimitiveFill](./IPCB_PrimitiveFill.md)
1146
-
1147
- Fill primitive object
1148
-
1149
- ## Example
1150
-
1151
- ```javascript
1152
- // 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
1153
- const x = 2000 + Math.floor(Math.random() * 100000);
1154
- const y = 2000 + Math.floor(Math.random() * 100000);
1155
-
1156
- // 2. 创建一个无网络的矩形填充
1157
- const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
1158
- const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
1159
- const before = fill.getState_Net();
1160
-
1161
- // 3. 切换异步模式并指定网络('' → '嘉立创示例_NET')
1162
- const asyncFill = fill.toAsync();
1163
- asyncFill.setState_Net('嘉立创示例_NET');
1164
- await asyncFill.done();
1165
-
1166
- // 4. 从画布重新读取,确认修改已生效(保留现场供观察)
1167
- const refetched = await eda.pcb_PrimitiveFill.get(fill.getState_PrimitiveId());
1168
-
1169
- console.log('net:', JSON.stringify(before), '→', JSON.stringify(refetched.getState_Net()));
1170
- ```
1171
-
1172
- ### setstate_primitivelock
1173
-
1174
- # IPCB\_PrimitiveFill.setState\_PrimitiveLock() method
1175
-
1176
- > 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.
1177
-
1178
- Set the property state: whether it is locked
1179
-
1180
- ## Signature
1181
-
1182
- ```typescript
1183
- function setState_PrimitiveLock(primitiveLock: boolean): IPCB_PrimitiveFill;
1184
- ```
1185
-
1186
- ## Parameters
1187
-
1188
- <table><thead><tr><th>
1189
-
1190
- Parameter
1191
-
1192
- </th><th>
1193
-
1194
- Type
1195
-
1196
- </th><th>
1197
-
1198
- Description
1199
-
1200
- </th></tr></thead>
1201
- <tbody><tr><td>
1202
-
1203
- primitiveLock
1204
-
1205
- </td><td>
1206
-
1207
- boolean
1208
-
1209
- </td><td>
1210
-
1211
- Whether it is locked
1212
-
1213
- </td></tr>
1214
- </tbody></table>
1215
-
1216
- ## Returns
1217
-
1218
- [IPCB\_PrimitiveFill](./IPCB_PrimitiveFill.md)
1219
-
1220
- Fill primitive object
1221
-
1222
- ## Example
1223
-
1224
- ```javascript
1225
- // 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
1226
- const x = 2000 + Math.floor(Math.random() * 100000);
1227
- const y = 2000 + Math.floor(Math.random() * 100000);
1228
-
1229
- // 2. 创建一个未锁定的矩形填充
1230
- const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
1231
- const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
1232
- const before = fill.getState_PrimitiveLock();
1233
-
1234
- // 3. 切换异步模式并锁定填充
1235
- const asyncFill = fill.toAsync();
1236
- asyncFill.setState_PrimitiveLock(true);
1237
- await asyncFill.done();
1238
-
1239
- // 4. 从画布重新读取,确认已锁定(保留现场供观察)
1240
- const refetched = await eda.pcb_PrimitiveFill.get(fill.getState_PrimitiveId());
1241
-
1242
- console.log('primitiveLock:', before, '→', refetched.getState_PrimitiveLock());
1243
- ```
1244
-
1245
- ### toasync
1246
-
1247
- # IPCB\_PrimitiveFill.toAsync() method
1248
-
1249
- Convert Primitive to Async primitive
1250
-
1251
- ## Signature
1252
-
1253
- ```typescript
1254
- function toAsync(): IPCB_PrimitiveFill;
1255
- ```
1256
-
1257
- ## Returns
1258
-
1259
- [IPCB\_PrimitiveFill](./IPCB_PrimitiveFill.md)
1260
-
1261
- Fill primitive object
1262
-
1263
- ## Example
1264
-
1265
- ```javascript
1266
- // 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
1267
- const x = 2000 + Math.floor(Math.random() * 100000);
1268
- const y = 2000 + Math.floor(Math.random() * 100000);
1269
-
1270
- // 2. 创建一个无网络的矩形填充
1271
- const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
1272
- const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
1273
-
1274
- // 3. 切换异步模式后批量修改:划归网络 + 挪到底层
1275
- const asyncFill = fill.toAsync();
1276
- asyncFill.setState_Net('嘉立创示例_NET');
1277
- asyncFill.setState_Layer(2);
1278
- await asyncFill.done();
1279
-
1280
- // 4. 从画布重新读取,确认批量修改已生效(保留现场供观察)
1281
- const refetched = await eda.pcb_PrimitiveFill.get(fill.getState_PrimitiveId());
1282
-
1283
- console.log('net:', JSON.stringify(refetched.getState_Net()));
1284
- console.log('layer:', refetched.getState_Layer());
1285
- ```
1286
-
1287
- ### tosync
1288
-
1289
- # IPCB\_PrimitiveFill.toSync() method
1290
-
1291
- Convert Primitive to Sync primitive
1292
-
1293
- ## Signature
1294
-
1295
- ```typescript
1296
- function toSync(): IPCB_PrimitiveFill;
1297
- ```
1298
-
1299
- ## Returns
1300
-
1301
- [IPCB\_PrimitiveFill](./IPCB_PrimitiveFill.md)
1302
-
1303
- Fill primitive object
1304
-
1305
- ## Example
1306
-
1307
- ```javascript
1308
- // 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
1309
- const x = 2000 + Math.floor(Math.random() * 100000);
1310
- const y = 2000 + Math.floor(Math.random() * 100000);
1311
-
1312
- // 2. 创建一个矩形填充
1313
- const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
1314
- const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
1315
- const before = fill.isAsync();
1316
-
1317
- // 3. 转换为同步图元(保留现场供观察)
1318
- const syncFill = fill.toSync();
1319
- const after = syncFill.isAsync();
1320
-
1321
- // 4. 同步图元直接读取属性,无需提交
1322
- console.log('isAsync:', before, '→', after);
1323
- console.log('primitiveType:', syncFill.getState_PrimitiveType());
1324
- console.log('layer:', syncFill.getState_Layer());
1325
- ```
1
+ # IPCB\_PrimitiveFill class
2
+
3
+ Fill primitive
4
+
5
+ ## Signature
6
+
7
+ ```typescript
8
+ class IPCB_PrimitiveFill 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
+ [convertToPolyline()](./IPCB_PrimitiveFill.md)
32
+
33
+ </td><td>
34
+
35
+ </td><td>
36
+
37
+ **_(BETA)_** Convert to: polyline primitive
38
+
39
+ </td></tr>
40
+ <tr><td>
41
+
42
+ [convertToPour()](./IPCB_PrimitiveFill.md)
43
+
44
+ </td><td>
45
+
46
+ </td><td>
47
+
48
+ **_(BETA)_** Convert to: Copper border primitive
49
+
50
+ </td></tr>
51
+ <tr><td>
52
+
53
+ [convertToRegion()](./IPCB_PrimitiveFill.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_PrimitiveFill.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
+ [getState\_ComplexPolygon()](./IPCB_PrimitiveFill.md)
76
+
77
+ </td><td>
78
+
79
+ </td><td>
80
+
81
+ Get the property state: complex polygon
82
+
83
+ </td></tr>
84
+ <tr><td>
85
+
86
+ [getState\_FillMode()](./IPCB_PrimitiveFill.md)
87
+
88
+ </td><td>
89
+
90
+ </td><td>
91
+
92
+ Get the property state: fill mode
93
+
94
+ </td></tr>
95
+ <tr><td>
96
+
97
+ [getState\_Layer()](./IPCB_PrimitiveFill.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_PrimitiveFill.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_PrimitiveFill.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\_PrimitiveId()](./IPCB_PrimitiveFill.md)
131
+
132
+ </td><td>
133
+
134
+ </td><td>
135
+
136
+ Get the property state: primitive ID
137
+
138
+ </td></tr>
139
+ <tr><td>
140
+
141
+ [getState\_PrimitiveLock()](./IPCB_PrimitiveFill.md)
142
+
143
+ </td><td>
144
+
145
+ </td><td>
146
+
147
+ Get the property state: whether it is locked
148
+
149
+ </td></tr>
150
+ <tr><td>
151
+
152
+ [getState\_PrimitiveType()](./IPCB_PrimitiveFill.md)
153
+
154
+ </td><td>
155
+
156
+ </td><td>
157
+
158
+ Get the property state: primitive type
159
+
160
+ </td></tr>
161
+ <tr><td>
162
+
163
+ [isAsync()](./IPCB_PrimitiveFill.md)
164
+
165
+ </td><td>
166
+
167
+ </td><td>
168
+
169
+ Query whether the primitive is an async primitive
170
+
171
+ </td></tr>
172
+ <tr><td>
173
+
174
+ [reset()](./IPCB_PrimitiveFill.md)
175
+
176
+ </td><td>
177
+
178
+ </td><td>
179
+
180
+ **_(BETA)_** Reset the async primitive to the current canvas state
181
+
182
+ </td></tr>
183
+ <tr><td>
184
+
185
+ [setState\_ComplexPolygon(complexPolygon)](./IPCB_PrimitiveFill.md)
186
+
187
+ </td><td>
188
+
189
+ </td><td>
190
+
191
+ **_(BETA)_** Set the property state: complex polygon
192
+
193
+ </td></tr>
194
+ <tr><td>
195
+
196
+ [setState\_FillMode(fillMode)](./IPCB_PrimitiveFill.md)
197
+
198
+ </td><td>
199
+
200
+ </td><td>
201
+
202
+ **_(BETA)_** Set the property state: fill mode
203
+
204
+ </td></tr>
205
+ <tr><td>
206
+
207
+ [setState\_Layer(layer)](./IPCB_PrimitiveFill.md)
208
+
209
+ </td><td>
210
+
211
+ </td><td>
212
+
213
+ **_(BETA)_** Set the property state: Layer
214
+
215
+ </td></tr>
216
+ <tr><td>
217
+
218
+ [setState\_LineWidth(lineWidth)](./IPCB_PrimitiveFill.md)
219
+
220
+ </td><td>
221
+
222
+ </td><td>
223
+
224
+ **_(BETA)_** Set the property state: Line width
225
+
226
+ </td></tr>
227
+ <tr><td>
228
+
229
+ [setState\_Net(net)](./IPCB_PrimitiveFill.md)
230
+
231
+ </td><td>
232
+
233
+ </td><td>
234
+
235
+ **_(BETA)_** Set the property state: net name
236
+
237
+ </td></tr>
238
+ <tr><td>
239
+
240
+ [setState\_PrimitiveLock(primitiveLock)](./IPCB_PrimitiveFill.md)
241
+
242
+ </td><td>
243
+
244
+ </td><td>
245
+
246
+ **_(BETA)_** Set the property state: whether it is locked
247
+
248
+ </td></tr>
249
+ <tr><td>
250
+
251
+ [toAsync()](./IPCB_PrimitiveFill.md)
252
+
253
+ </td><td>
254
+
255
+ </td><td>
256
+
257
+ Convert Primitive to Async primitive
258
+
259
+ </td></tr>
260
+ <tr><td>
261
+
262
+ [toSync()](./IPCB_PrimitiveFill.md)
263
+
264
+ </td><td>
265
+
266
+ </td><td>
267
+
268
+ Convert Primitive to Sync primitive
269
+
270
+ </td></tr>
271
+ </tbody></table>
272
+
273
+ ---
274
+
275
+ ## 方法详情
276
+
277
+ ### converttopolyline
278
+
279
+ # IPCB\_PrimitiveFill.convertToPolyline() method
280
+
281
+ > 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.
282
+
283
+ Convert to: polyline primitive
284
+
285
+ ## Signature
286
+
287
+ ```typescript
288
+ function convertToPolyline(): Promise<IPCB_PrimitivePolyline>;
289
+ ```
290
+
291
+ ## Returns
292
+
293
+ Promise&lt;[IPCB\_PrimitivePolyline](./IPCB_PrimitivePolyline.md)<!-- -->&gt;
294
+
295
+ Polyline primitive object
296
+
297
+ ## Example
298
+
299
+ ```javascript
300
+ // 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
301
+ const x = 2000 + Math.floor(Math.random() * 100000);
302
+ const y = 2000 + Math.floor(Math.random() * 100000);
303
+
304
+ // 2. 创建一个矩形填充
305
+ const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
306
+ const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
307
+
308
+ // 3. 转换为折线图元(保留现场供观察)
309
+ const polyline = await fill.convertToPolyline();
310
+
311
+ console.log('primitiveType:', `Fill → ${polyline.getState_PrimitiveType()}`);
312
+ console.log('primitiveId:', polyline.getState_PrimitiveId());
313
+ ```
314
+
315
+ ### converttopour
316
+
317
+ # IPCB\_PrimitiveFill.convertToPour() method
318
+
319
+ > 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.
320
+
321
+ Convert to: Copper border primitive
322
+
323
+ ## Signature
324
+
325
+ ```typescript
326
+ function convertToPour(): Promise<IPCB_PrimitivePour>;
327
+ ```
328
+
329
+ ## Returns
330
+
331
+ Promise&lt;[IPCB\_PrimitivePour](./IPCB_PrimitivePour.md)<!-- -->&gt;
332
+
333
+ Copper border primitive object
334
+
335
+ ## Example
336
+
337
+ ```javascript
338
+ // 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
339
+ const x = 2000 + Math.floor(Math.random() * 100000);
340
+ const y = 2000 + Math.floor(Math.random() * 100000);
341
+
342
+ // 2. 创建一个矩形填充
343
+ const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
344
+ const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
345
+
346
+ // 3. 转换为覆铜边框图元(保留现场供观察)
347
+ const pour = await fill.convertToPour();
348
+
349
+ console.log('primitiveType:', `Fill → ${pour.getState_PrimitiveType()}`);
350
+ console.log('primitiveId:', pour.getState_PrimitiveId());
351
+ ```
352
+
353
+ ### converttoregion
354
+
355
+ # IPCB\_PrimitiveFill.convertToRegion() method
356
+
357
+ > 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.
358
+
359
+ Convert to: region primitive (default is the forbidden region)
360
+
361
+ ## Signature
362
+
363
+ ```typescript
364
+ function convertToRegion(): Promise<IPCB_PrimitiveRegion>;
365
+ ```
366
+
367
+ ## Returns
368
+
369
+ Promise&lt;[IPCB\_PrimitiveRegion](./IPCB_PrimitiveRegion.md)<!-- -->&gt;
370
+
371
+ Region primitive object
372
+
373
+ ## Example
374
+
375
+ ```javascript
376
+ // 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
377
+ const x = 2000 + Math.floor(Math.random() * 100000);
378
+ const y = 2000 + Math.floor(Math.random() * 100000);
379
+
380
+ // 2. 创建一个矩形填充
381
+ const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
382
+ const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
383
+
384
+ // 3. 转换为区域图元(默认是禁止区域,保留现场供观察)
385
+ const region = await fill.convertToRegion();
386
+
387
+ console.log('primitiveType:', `Fill → ${region.getState_PrimitiveType()}`);
388
+ console.log('primitiveId:', region.getState_PrimitiveId());
389
+ ```
390
+
391
+ ### done
392
+
393
+ # IPCB\_PrimitiveFill.done() method
394
+
395
+ > 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.
396
+
397
+ Apply the changes to the primitives to the canvas
398
+
399
+ ## Signature
400
+
401
+ ```typescript
402
+ function done(): Promise<IPCB_PrimitiveFill>;
403
+ ```
404
+
405
+ ## Returns
406
+
407
+ Promise&lt;[IPCB\_PrimitiveFill](./IPCB_PrimitiveFill.md)<!-- -->&gt;
408
+
409
+ Fill primitive object
410
+
411
+ ## Example
412
+
413
+ ```javascript
414
+ // 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
415
+ const x = 2000 + Math.floor(Math.random() * 100000);
416
+ const y = 2000 + Math.floor(Math.random() * 100000);
417
+
418
+ // 2. 创建一个顶层铜层的矩形填充
419
+ const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
420
+ const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
421
+ const before = fill.getState_Layer();
422
+
423
+ // 3. 异步模式下把填充挪到底层铜层(此时画布还没变)
424
+ const asyncFill = fill.toAsync();
425
+ asyncFill.setState_Layer(2);
426
+ await asyncFill.done();
427
+
428
+ // 4. 从画布重新读取,确认修改已生效(保留现场供观察)
429
+ const refetched = await eda.pcb_PrimitiveFill.get(fill.getState_PrimitiveId());
430
+
431
+ console.log('layer:', before, '→', refetched.getState_Layer());
432
+ ```
433
+
434
+ ### getstate_complexpolygon
435
+
436
+ # IPCB\_PrimitiveFill.getState\_ComplexPolygon() method
437
+
438
+ Get the property state: complex polygon
439
+
440
+ ## Signature
441
+
442
+ ```typescript
443
+ function getState_ComplexPolygon(): IPCB_Polygon;
444
+ ```
445
+
446
+ ## Returns
447
+
448
+ [IPCB\_Polygon](./IPCB_Polygon.md)
449
+
450
+ Complex polygon
451
+
452
+ ## Example
453
+
454
+ ```javascript
455
+ // 1. 创建一个已知轮廓的矩形填充(500 x 300 mil)
456
+ const x = 2000 + Math.floor(Math.random() * 100000);
457
+ const y = 2000 + Math.floor(Math.random() * 100000);
458
+ const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
459
+ const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
460
+
461
+ // 2. 读取复杂多边形对象,再取它的轮廓源数组
462
+ const complexPolygon = fill.getState_ComplexPolygon();
463
+ const source = complexPolygon.getSource();
464
+
465
+ // 3. 清理测试图元(查询类案例不留测试对象)
466
+ await eda.pcb_PrimitiveFill.delete([fill.getState_PrimitiveId()]);
467
+
468
+ console.log('polygonSource:', JSON.stringify(source));
469
+ ```
470
+
471
+ ### getstate_fillmode
472
+
473
+ # IPCB\_PrimitiveFill.getState\_FillMode() method
474
+
475
+ Get the property state: fill mode
476
+
477
+ ## Signature
478
+
479
+ ```typescript
480
+ function getState_FillMode(): EPCB_PrimitiveFillMode | undefined;
481
+ ```
482
+
483
+ ## Returns
484
+
485
+ [EPCB\_PrimitiveFillMode](../enums/EPCB_PrimitiveFillMode.md) \| undefined
486
+
487
+ Fill mode
488
+
489
+ ## Example
490
+
491
+ ```javascript
492
+ // 1. 创建一个实心填充的矩形
493
+ const x = 2000 + Math.floor(Math.random() * 100000);
494
+ const y = 2000 + Math.floor(Math.random() * 100000);
495
+ const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
496
+ const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
497
+
498
+ // 2. 读取填充模式(0=SOLID 实心,1=MESH 网格,2=INNER_ELECTRICAL_LAYER 内电层)
499
+ const fillMode = fill.getState_FillMode();
500
+
501
+ // 3. 清理测试图元(查询类案例不留测试对象)
502
+ await eda.pcb_PrimitiveFill.delete([fill.getState_PrimitiveId()]);
503
+
504
+ console.log('fillMode:', fillMode);
505
+ ```
506
+
507
+ ### getstate_layer
508
+
509
+ # IPCB\_PrimitiveFill.getState\_Layer() method
510
+
511
+ Get the property state: Layer
512
+
513
+ ## Signature
514
+
515
+ ```typescript
516
+ function getState_Layer(): TPCB_LayersOfFill;
517
+ ```
518
+
519
+ ## Returns
520
+
521
+ [TPCB\_LayersOfFill](../types/TPCB_LayersOfFill.md)
522
+
523
+ Layer
524
+
525
+ ## Example
526
+
527
+ ```javascript
528
+ // 1. 创建一个顶层铜层(1)的矩形填充
529
+ const x = 2000 + Math.floor(Math.random() * 100000);
530
+ const y = 2000 + Math.floor(Math.random() * 100000);
531
+ const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
532
+ const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
533
+
534
+ // 2. 读取填充所在层
535
+ const layer = fill.getState_Layer();
536
+
537
+ // 3. 清理测试图元(查询类案例不留测试对象)
538
+ await eda.pcb_PrimitiveFill.delete([fill.getState_PrimitiveId()]);
539
+
540
+ console.log('layer:', layer);
541
+ ```
542
+
543
+ ### getstate_linewidth
544
+
545
+ # IPCB\_PrimitiveFill.getState\_LineWidth() method
546
+
547
+ Get the property state: Line width
548
+
549
+ ## Signature
550
+
551
+ ```typescript
552
+ function getState_LineWidth(): number;
553
+ ```
554
+
555
+ ## Returns
556
+
557
+ number
558
+
559
+ Line width
560
+
561
+ ## Example
562
+
563
+ ```javascript
564
+ // 1. 创建一个 10mil 线宽的矩形填充
565
+ const x = 2000 + Math.floor(Math.random() * 100000);
566
+ const y = 2000 + Math.floor(Math.random() * 100000);
567
+ const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
568
+ const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
569
+
570
+ // 2. 读取线宽
571
+ const lineWidth = fill.getState_LineWidth();
572
+
573
+ // 3. 清理测试图元(查询类案例不留测试对象)
574
+ await eda.pcb_PrimitiveFill.delete([fill.getState_PrimitiveId()]);
575
+
576
+ console.log('lineWidth:', lineWidth);
577
+ ```
578
+
579
+ ### getstate_net
580
+
581
+ # IPCB\_PrimitiveFill.getState\_Net() method
582
+
583
+ Get the property state: net name
584
+
585
+ ## Signature
586
+
587
+ ```typescript
588
+ function getState_Net(): string | undefined;
589
+ ```
590
+
591
+ ## Returns
592
+
593
+ string \| undefined
594
+
595
+ Net name
596
+
597
+ ## Example
598
+
599
+ ```javascript
600
+ // 1. 创建一个无网络的矩形填充
601
+ const x = 2000 + Math.floor(Math.random() * 100000);
602
+ const y = 2000 + Math.floor(Math.random() * 100000);
603
+ const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
604
+ const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
605
+
606
+ // 2. 读取网络名称(无网络时为空字符串)
607
+ const net = fill.getState_Net();
608
+
609
+ // 3. 清理测试图元(查询类案例不留测试对象)
610
+ await eda.pcb_PrimitiveFill.delete([fill.getState_PrimitiveId()]);
611
+
612
+ console.log('net:', JSON.stringify(net));
613
+ ```
614
+
615
+ ### getstate_primitiveid
616
+
617
+ # IPCB\_PrimitiveFill.getState\_PrimitiveId() method
618
+
619
+ Get the property state: primitive ID
620
+
621
+ ## Signature
622
+
623
+ ```typescript
624
+ function getState_PrimitiveId(): string;
625
+ ```
626
+
627
+ ## Returns
628
+
629
+ string
630
+
631
+ Primitive ID
632
+
633
+ ## Example
634
+
635
+ ```javascript
636
+ // 1. 创建一个矩形填充
637
+ const x = 2000 + Math.floor(Math.random() * 100000);
638
+ const y = 2000 + Math.floor(Math.random() * 100000);
639
+ const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
640
+ const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
641
+
642
+ // 2. 读取图元 ID
643
+ const primitiveId = fill.getState_PrimitiveId();
644
+
645
+ // 3. 清理测试图元(查询类案例不留测试对象)
646
+ await eda.pcb_PrimitiveFill.delete([fill.getState_PrimitiveId()]);
647
+
648
+ console.log('primitiveId:', primitiveId);
649
+ ```
650
+
651
+ ### getstate_primitivelock
652
+
653
+ # IPCB\_PrimitiveFill.getState\_PrimitiveLock() method
654
+
655
+ Get the property state: whether it is locked
656
+
657
+ ## Signature
658
+
659
+ ```typescript
660
+ function getState_PrimitiveLock(): boolean;
661
+ ```
662
+
663
+ ## Returns
664
+
665
+ boolean
666
+
667
+ Whether it is locked
668
+
669
+ ## Example
670
+
671
+ ```javascript
672
+ // 1. 创建一个未锁定的矩形填充
673
+ const x = 2000 + Math.floor(Math.random() * 100000);
674
+ const y = 2000 + Math.floor(Math.random() * 100000);
675
+ const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
676
+ const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
677
+
678
+ // 2. 读取锁定状态
679
+ const primitiveLock = fill.getState_PrimitiveLock();
680
+
681
+ // 3. 清理测试图元(查询类案例不留测试对象)
682
+ await eda.pcb_PrimitiveFill.delete([fill.getState_PrimitiveId()]);
683
+
684
+ console.log('primitiveLock:', primitiveLock);
685
+ ```
686
+
687
+ ### getstate_primitivetype
688
+
689
+ # IPCB\_PrimitiveFill.getState\_PrimitiveType() method
690
+
691
+ Get the property state: primitive type
692
+
693
+ ## Signature
694
+
695
+ ```typescript
696
+ function getState_PrimitiveType(): EPCB_PrimitiveType;
697
+ ```
698
+
699
+ ## Returns
700
+
701
+ [EPCB\_PrimitiveType](../enums/EPCB_PrimitiveType.md)
702
+
703
+ Primitive type
704
+
705
+ ## Example
706
+
707
+ ```javascript
708
+ // 1. 创建一个矩形填充
709
+ const x = 2000 + Math.floor(Math.random() * 100000);
710
+ const y = 2000 + Math.floor(Math.random() * 100000);
711
+ const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
712
+ const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
713
+
714
+ // 2. 读取图元类型
715
+ const primitiveType = fill.getState_PrimitiveType();
716
+
717
+ // 3. 清理测试图元(查询类案例不留测试对象)
718
+ await eda.pcb_PrimitiveFill.delete([fill.getState_PrimitiveId()]);
719
+
720
+ console.log('primitiveType:', primitiveType);
721
+ ```
722
+
723
+ ### isasync
724
+
725
+ # IPCB\_PrimitiveFill.isAsync() method
726
+
727
+ Query whether the primitive is an async primitive
728
+
729
+ ## Signature
730
+
731
+ ```typescript
732
+ function isAsync(): boolean;
733
+ ```
734
+
735
+ ## Returns
736
+
737
+ boolean
738
+
739
+ Whether Is async primitive
740
+
741
+ ## Example
742
+
743
+ ```javascript
744
+ // 1. 创建一个矩形填充
745
+ const x = 2000 + Math.floor(Math.random() * 100000);
746
+ const y = 2000 + Math.floor(Math.random() * 100000);
747
+ const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
748
+ const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
749
+
750
+ // 2. 查询异步模式
751
+ const isAsync = fill.isAsync();
752
+
753
+ // 3. 清理测试图元(查询类案例不留测试对象)
754
+ await eda.pcb_PrimitiveFill.delete([fill.getState_PrimitiveId()]);
755
+
756
+ console.log('isAsync:', isAsync);
757
+ ```
758
+
759
+ ### reset
760
+
761
+ # IPCB\_PrimitiveFill.reset() method
762
+
763
+ > 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.
764
+
765
+ Reset the async primitive to the current canvas state
766
+
767
+ ## Signature
768
+
769
+ ```typescript
770
+ function reset(): Promise<IPCB_PrimitiveFill>;
771
+ ```
772
+
773
+ ## Returns
774
+
775
+ Promise&lt;[IPCB\_PrimitiveFill](./IPCB_PrimitiveFill.md)<!-- -->&gt;
776
+
777
+ Fill primitive object
778
+
779
+ ## Example
780
+
781
+ ```javascript
782
+ // 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
783
+ const x = 2000 + Math.floor(Math.random() * 100000);
784
+ const y = 2000 + Math.floor(Math.random() * 100000);
785
+
786
+ // 2. 创建一个顶层铜层的矩形填充
787
+ const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
788
+ const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
789
+ const before = fill.getState_Layer();
790
+
791
+ // 3. 异步模式下把层改到底层(2),随后反悔
792
+ const asyncFill = fill.toAsync();
793
+ asyncFill.setState_Layer(2);
794
+
795
+ // 4. reset 丢弃未提交的修改(保留现场供观察)
796
+ await asyncFill.reset();
797
+
798
+ // 5. 从画布重新读取,确认层没有变
799
+ const refetched = await eda.pcb_PrimitiveFill.get(fill.getState_PrimitiveId());
800
+
801
+ console.log('layer:', before, '→', refetched.getState_Layer());
802
+ ```
803
+
804
+ ### setstate_complexpolygon
805
+
806
+ # IPCB\_PrimitiveFill.setState\_ComplexPolygon() method
807
+
808
+ > 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.
809
+
810
+ Set the property state: complex polygon
811
+
812
+ ## Signature
813
+
814
+ ```typescript
815
+ function setState_ComplexPolygon(complexPolygon: IPCB_Polygon): IPCB_PrimitiveFill;
816
+ ```
817
+
818
+ ## Parameters
819
+
820
+ <table><thead><tr><th>
821
+
822
+ Parameter
823
+
824
+ </th><th>
825
+
826
+ Type
827
+
828
+ </th><th>
829
+
830
+ Description
831
+
832
+ </th></tr></thead>
833
+ <tbody><tr><td>
834
+
835
+ complexPolygon
836
+
837
+ </td><td>
838
+
839
+ [IPCB\_Polygon](./IPCB_Polygon.md)
840
+
841
+ </td><td>
842
+
843
+ Complex polygon
844
+
845
+ </td></tr>
846
+ </tbody></table>
847
+
848
+ ## Returns
849
+
850
+ [IPCB\_PrimitiveFill](./IPCB_PrimitiveFill.md)
851
+
852
+ Fill primitive object
853
+
854
+ ## Example
855
+
856
+ ```javascript
857
+ // 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
858
+ const x = 2000 + Math.floor(Math.random() * 100000);
859
+ const y = 2000 + Math.floor(Math.random() * 100000);
860
+
861
+ // 2. 创建一个 500 x 300 的矩形填充
862
+ const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
863
+ const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
864
+ const before = JSON.stringify(fill.getState_ComplexPolygon().getSource());
865
+
866
+ // 3. 构造新轮廓(放大到 800 x 400),异步模式提交
867
+ const newPolygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 800, 400, 0, 0]);
868
+ const asyncFill = fill.toAsync();
869
+ asyncFill.setState_ComplexPolygon(newPolygon);
870
+ await asyncFill.done();
871
+
872
+ // 4. 从画布重新读取,确认轮廓已替换(保留现场供观察)
873
+ const refetched = await eda.pcb_PrimitiveFill.get(fill.getState_PrimitiveId());
874
+ const after = JSON.stringify(refetched.getState_ComplexPolygon().getSource());
875
+
876
+ console.log('polygonSource:', before, '→', after);
877
+ ```
878
+
879
+ ### setstate_fillmode
880
+
881
+ # IPCB\_PrimitiveFill.setState\_FillMode() method
882
+
883
+ > 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.
884
+
885
+ Set the property state: fill mode
886
+
887
+ ## Signature
888
+
889
+ ```typescript
890
+ function setState_FillMode(fillMode: EPCB_PrimitiveFillMode): IPCB_PrimitiveFill;
891
+ ```
892
+
893
+ ## Parameters
894
+
895
+ <table><thead><tr><th>
896
+
897
+ Parameter
898
+
899
+ </th><th>
900
+
901
+ Type
902
+
903
+ </th><th>
904
+
905
+ Description
906
+
907
+ </th></tr></thead>
908
+ <tbody><tr><td>
909
+
910
+ fillMode
911
+
912
+ </td><td>
913
+
914
+ [EPCB\_PrimitiveFillMode](../enums/EPCB_PrimitiveFillMode.md)
915
+
916
+ </td><td>
917
+
918
+ Fill mode
919
+
920
+ </td></tr>
921
+ </tbody></table>
922
+
923
+ ## Returns
924
+
925
+ [IPCB\_PrimitiveFill](./IPCB_PrimitiveFill.md)
926
+
927
+ Fill primitive object
928
+
929
+ ## Example
930
+
931
+ ```javascript
932
+ // 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
933
+ const x = 2000 + Math.floor(Math.random() * 100000);
934
+ const y = 2000 + Math.floor(Math.random() * 100000);
935
+
936
+ // 2. 创建一个内电层模式(2)的矩形填充
937
+ const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
938
+ const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 2, 10, false);
939
+ const before = fill.getState_FillMode();
940
+
941
+ // 3. 异步模式切换为实心填充(0)
942
+ const asyncFill = fill.toAsync();
943
+ asyncFill.setState_FillMode(0);
944
+ await asyncFill.done();
945
+
946
+ // 4. 从画布重新读取,确认模式已切换(保留现场供观察)
947
+ const refetched = await eda.pcb_PrimitiveFill.get(fill.getState_PrimitiveId());
948
+
949
+ console.log('fillMode:', before, '→', refetched.getState_FillMode());
950
+ ```
951
+
952
+ ### setstate_layer
953
+
954
+ # IPCB\_PrimitiveFill.setState\_Layer() method
955
+
956
+ > 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.
957
+
958
+ Set the property state: Layer
959
+
960
+ ## Signature
961
+
962
+ ```typescript
963
+ function setState_Layer(layer: TPCB_LayersOfFill): IPCB_PrimitiveFill;
964
+ ```
965
+
966
+ ## Parameters
967
+
968
+ <table><thead><tr><th>
969
+
970
+ Parameter
971
+
972
+ </th><th>
973
+
974
+ Type
975
+
976
+ </th><th>
977
+
978
+ Description
979
+
980
+ </th></tr></thead>
981
+ <tbody><tr><td>
982
+
983
+ layer
984
+
985
+ </td><td>
986
+
987
+ [TPCB\_LayersOfFill](../types/TPCB_LayersOfFill.md)
988
+
989
+ </td><td>
990
+
991
+ Layer
992
+
993
+ </td></tr>
994
+ </tbody></table>
995
+
996
+ ## Returns
997
+
998
+ [IPCB\_PrimitiveFill](./IPCB_PrimitiveFill.md)
999
+
1000
+ Fill primitive object
1001
+
1002
+ ## Example
1003
+
1004
+ ```javascript
1005
+ // 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
1006
+ const x = 2000 + Math.floor(Math.random() * 100000);
1007
+ const y = 2000 + Math.floor(Math.random() * 100000);
1008
+
1009
+ // 2. 创建一个顶层铜层(1)的矩形填充
1010
+ const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
1011
+ const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
1012
+ const before = fill.getState_Layer();
1013
+
1014
+ // 3. 异步模式把填充挪到底层铜层(2)
1015
+ const asyncFill = fill.toAsync();
1016
+ asyncFill.setState_Layer(2);
1017
+ await asyncFill.done();
1018
+
1019
+ // 4. 从画布重新读取,确认层已切换(保留现场供观察)
1020
+ const refetched = await eda.pcb_PrimitiveFill.get(fill.getState_PrimitiveId());
1021
+
1022
+ console.log('layer:', before, '→', refetched.getState_Layer());
1023
+ ```
1024
+
1025
+ ### setstate_linewidth
1026
+
1027
+ # IPCB\_PrimitiveFill.setState\_LineWidth() method
1028
+
1029
+ > 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.
1030
+
1031
+ Set the property state: Line width
1032
+
1033
+ ## Signature
1034
+
1035
+ ```typescript
1036
+ function setState_LineWidth(lineWidth: number): IPCB_PrimitiveFill;
1037
+ ```
1038
+
1039
+ ## Parameters
1040
+
1041
+ <table><thead><tr><th>
1042
+
1043
+ Parameter
1044
+
1045
+ </th><th>
1046
+
1047
+ Type
1048
+
1049
+ </th><th>
1050
+
1051
+ Description
1052
+
1053
+ </th></tr></thead>
1054
+ <tbody><tr><td>
1055
+
1056
+ lineWidth
1057
+
1058
+ </td><td>
1059
+
1060
+ number
1061
+
1062
+ </td><td>
1063
+
1064
+ Line width
1065
+
1066
+ </td></tr>
1067
+ </tbody></table>
1068
+
1069
+ ## Returns
1070
+
1071
+ [IPCB\_PrimitiveFill](./IPCB_PrimitiveFill.md)
1072
+
1073
+ Fill primitive object
1074
+
1075
+ ## Example
1076
+
1077
+ ```javascript
1078
+ // 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
1079
+ const x = 2000 + Math.floor(Math.random() * 100000);
1080
+ const y = 2000 + Math.floor(Math.random() * 100000);
1081
+
1082
+ // 2. 创建一个 10mil 线宽的矩形填充
1083
+ const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
1084
+ const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
1085
+ const before = fill.getState_LineWidth();
1086
+
1087
+ // 3. 切换异步模式,线宽加粗到 20mil
1088
+ const asyncFill = fill.toAsync();
1089
+ asyncFill.setState_LineWidth(20);
1090
+ await asyncFill.done();
1091
+
1092
+ // 4. 从图元对象读回新值(保留现场供观察)
1093
+ // 注:当前版本画布侧渲染线宽保持默认值,修改在图元对象上生效
1094
+ const after = fill.getState_LineWidth();
1095
+
1096
+ console.log('lineWidth:', before, '→', after);
1097
+ ```
1098
+
1099
+ ### setstate_net
1100
+
1101
+ # IPCB\_PrimitiveFill.setState\_Net() method
1102
+
1103
+ > 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.
1104
+
1105
+ Set the property state: net name
1106
+
1107
+ ## Signature
1108
+
1109
+ ```typescript
1110
+ function setState_Net(net: string): IPCB_PrimitiveFill;
1111
+ ```
1112
+
1113
+ ## Parameters
1114
+
1115
+ <table><thead><tr><th>
1116
+
1117
+ Parameter
1118
+
1119
+ </th><th>
1120
+
1121
+ Type
1122
+
1123
+ </th><th>
1124
+
1125
+ Description
1126
+
1127
+ </th></tr></thead>
1128
+ <tbody><tr><td>
1129
+
1130
+ net
1131
+
1132
+ </td><td>
1133
+
1134
+ string
1135
+
1136
+ </td><td>
1137
+
1138
+ Net name
1139
+
1140
+ </td></tr>
1141
+ </tbody></table>
1142
+
1143
+ ## Returns
1144
+
1145
+ [IPCB\_PrimitiveFill](./IPCB_PrimitiveFill.md)
1146
+
1147
+ Fill primitive object
1148
+
1149
+ ## Example
1150
+
1151
+ ```javascript
1152
+ // 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
1153
+ const x = 2000 + Math.floor(Math.random() * 100000);
1154
+ const y = 2000 + Math.floor(Math.random() * 100000);
1155
+
1156
+ // 2. 创建一个无网络的矩形填充
1157
+ const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
1158
+ const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
1159
+ const before = fill.getState_Net();
1160
+
1161
+ // 3. 切换异步模式并指定网络('' → '嘉立创示例_NET')
1162
+ const asyncFill = fill.toAsync();
1163
+ asyncFill.setState_Net('嘉立创示例_NET');
1164
+ await asyncFill.done();
1165
+
1166
+ // 4. 从画布重新读取,确认修改已生效(保留现场供观察)
1167
+ const refetched = await eda.pcb_PrimitiveFill.get(fill.getState_PrimitiveId());
1168
+
1169
+ console.log('net:', JSON.stringify(before), '→', JSON.stringify(refetched.getState_Net()));
1170
+ ```
1171
+
1172
+ ### setstate_primitivelock
1173
+
1174
+ # IPCB\_PrimitiveFill.setState\_PrimitiveLock() method
1175
+
1176
+ > 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.
1177
+
1178
+ Set the property state: whether it is locked
1179
+
1180
+ ## Signature
1181
+
1182
+ ```typescript
1183
+ function setState_PrimitiveLock(primitiveLock: boolean): IPCB_PrimitiveFill;
1184
+ ```
1185
+
1186
+ ## Parameters
1187
+
1188
+ <table><thead><tr><th>
1189
+
1190
+ Parameter
1191
+
1192
+ </th><th>
1193
+
1194
+ Type
1195
+
1196
+ </th><th>
1197
+
1198
+ Description
1199
+
1200
+ </th></tr></thead>
1201
+ <tbody><tr><td>
1202
+
1203
+ primitiveLock
1204
+
1205
+ </td><td>
1206
+
1207
+ boolean
1208
+
1209
+ </td><td>
1210
+
1211
+ Whether it is locked
1212
+
1213
+ </td></tr>
1214
+ </tbody></table>
1215
+
1216
+ ## Returns
1217
+
1218
+ [IPCB\_PrimitiveFill](./IPCB_PrimitiveFill.md)
1219
+
1220
+ Fill primitive object
1221
+
1222
+ ## Example
1223
+
1224
+ ```javascript
1225
+ // 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
1226
+ const x = 2000 + Math.floor(Math.random() * 100000);
1227
+ const y = 2000 + Math.floor(Math.random() * 100000);
1228
+
1229
+ // 2. 创建一个未锁定的矩形填充
1230
+ const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
1231
+ const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
1232
+ const before = fill.getState_PrimitiveLock();
1233
+
1234
+ // 3. 切换异步模式并锁定填充
1235
+ const asyncFill = fill.toAsync();
1236
+ asyncFill.setState_PrimitiveLock(true);
1237
+ await asyncFill.done();
1238
+
1239
+ // 4. 从画布重新读取,确认已锁定(保留现场供观察)
1240
+ const refetched = await eda.pcb_PrimitiveFill.get(fill.getState_PrimitiveId());
1241
+
1242
+ console.log('primitiveLock:', before, '→', refetched.getState_PrimitiveLock());
1243
+ ```
1244
+
1245
+ ### toasync
1246
+
1247
+ # IPCB\_PrimitiveFill.toAsync() method
1248
+
1249
+ Convert Primitive to Async primitive
1250
+
1251
+ ## Signature
1252
+
1253
+ ```typescript
1254
+ function toAsync(): IPCB_PrimitiveFill;
1255
+ ```
1256
+
1257
+ ## Returns
1258
+
1259
+ [IPCB\_PrimitiveFill](./IPCB_PrimitiveFill.md)
1260
+
1261
+ Fill primitive object
1262
+
1263
+ ## Example
1264
+
1265
+ ```javascript
1266
+ // 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
1267
+ const x = 2000 + Math.floor(Math.random() * 100000);
1268
+ const y = 2000 + Math.floor(Math.random() * 100000);
1269
+
1270
+ // 2. 创建一个无网络的矩形填充
1271
+ const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
1272
+ const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
1273
+
1274
+ // 3. 切换异步模式后批量修改:划归网络 + 挪到底层
1275
+ const asyncFill = fill.toAsync();
1276
+ asyncFill.setState_Net('嘉立创示例_NET');
1277
+ asyncFill.setState_Layer(2);
1278
+ await asyncFill.done();
1279
+
1280
+ // 4. 从画布重新读取,确认批量修改已生效(保留现场供观察)
1281
+ const refetched = await eda.pcb_PrimitiveFill.get(fill.getState_PrimitiveId());
1282
+
1283
+ console.log('net:', JSON.stringify(refetched.getState_Net()));
1284
+ console.log('layer:', refetched.getState_Layer());
1285
+ ```
1286
+
1287
+ ### tosync
1288
+
1289
+ # IPCB\_PrimitiveFill.toSync() method
1290
+
1291
+ Convert Primitive to Sync primitive
1292
+
1293
+ ## Signature
1294
+
1295
+ ```typescript
1296
+ function toSync(): IPCB_PrimitiveFill;
1297
+ ```
1298
+
1299
+ ## Returns
1300
+
1301
+ [IPCB\_PrimitiveFill](./IPCB_PrimitiveFill.md)
1302
+
1303
+ Fill primitive object
1304
+
1305
+ ## Example
1306
+
1307
+ ```javascript
1308
+ // 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
1309
+ const x = 2000 + Math.floor(Math.random() * 100000);
1310
+ const y = 2000 + Math.floor(Math.random() * 100000);
1311
+
1312
+ // 2. 创建一个矩形填充
1313
+ const polygon = eda.pcb_MathPolygon.createPolygon(['R', x, y, 500, 300, 0, 0]);
1314
+ const fill = await eda.pcb_PrimitiveFill.create(1, polygon, '', 0, 10, false);
1315
+ const before = fill.isAsync();
1316
+
1317
+ // 3. 转换为同步图元(保留现场供观察)
1318
+ const syncFill = fill.toSync();
1319
+ const after = syncFill.isAsync();
1320
+
1321
+ // 4. 同步图元直接读取属性,无需提交
1322
+ console.log('isAsync:', before, '→', after);
1323
+ console.log('primitiveType:', syncFill.getState_PrimitiveType());
1324
+ console.log('layer:', syncFill.getState_Layer());
1325
+ ```