@windypro-rourou/dsh-eda 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (483) hide show
  1. package/README.md +1 -1
  2. package/lib/capabilities.js +3 -2
  3. package/lib/client.js +33 -0
  4. package/lib/index.js +89 -2
  5. package/package.json +10 -1
  6. package/skill/INDEX.md +10 -8
  7. package/skill/README.md +125 -0
  8. package/skill/README.zh-Hans.md +125 -0
  9. package/skill/SKILL.md +746 -746
  10. package/skill/format/index.md +152 -152
  11. package/skill/format/pcb/3d.md +166 -166
  12. package/skill/format/pcb/attr.md +63 -63
  13. package/skill/format/pcb/common.md +306 -306
  14. package/skill/format/pcb/component.md +132 -132
  15. package/skill/format/pcb/dimension.md +58 -58
  16. package/skill/format/pcb/index.md +17 -17
  17. package/skill/format/pcb/obj.md +43 -43
  18. package/skill/format/pcb/pad_via.md +151 -151
  19. package/skill/format/pcb/panel.md +64 -64
  20. package/skill/format/pcb/partition.md +43 -43
  21. package/skill/format/pcb/primitive.md +196 -196
  22. package/skill/format/pcb/rule.md +71 -71
  23. package/skill/format/pcb/shape.md +441 -441
  24. package/skill/format/pcb/text.md +62 -62
  25. package/skill/format/project/blob.md +30 -30
  26. package/skill/format/project/common.md +42 -42
  27. package/skill/format/project/group.md +62 -62
  28. package/skill/format/project/index.md +12 -12
  29. package/skill/format/project/instance.md +32 -32
  30. package/skill/format/project/meta.md +189 -189
  31. package/skill/format/project/variant.md +30 -30
  32. package/skill/format/schematic/attr.md +41 -41
  33. package/skill/format/schematic/common.md +47 -47
  34. package/skill/format/schematic/component.md +91 -91
  35. package/skill/format/schematic/index.md +14 -14
  36. package/skill/format/schematic/obj.md +41 -41
  37. package/skill/format/schematic/pin.md +59 -59
  38. package/skill/format/schematic/shape.md +231 -231
  39. package/skill/format/schematic/structure.md +53 -53
  40. package/skill/format/schematic/table.md +109 -109
  41. package/skill/format/schematic/text.md +47 -47
  42. package/skill/format/schematic/wire.md +132 -132
  43. package/skill/guide/ancillary-projects/easyeda-api-sdk.md +1 -0
  44. package/skill/guide/ancillary-projects/pro-api-types.md +5 -5
  45. package/skill/guide/ancillary-projects.md +10 -10
  46. package/skill/guide/cli.md +1510 -0
  47. package/skill/guide/error-handling.md +38 -38
  48. package/skill/guide/extension-json.md +135 -135
  49. package/skill/guide/extensions-marketplace.md +61 -61
  50. package/skill/guide/how-to-start.md +316 -301
  51. package/skill/guide/i18n.md +57 -57
  52. package/skill/guide/index.md +7 -7
  53. package/skill/guide/inline-frame.md +20 -20
  54. package/skill/guide/invoke-apis.md +81 -81
  55. package/skill/guide/stability.md +37 -37
  56. package/skill/references/_index.md +471 -398
  57. package/skill/references/_quick-reference.md +3103 -3028
  58. package/skill/references/classes/DMT_Board.md +537 -533
  59. package/skill/references/classes/DMT_EditorControl.md +1736 -1736
  60. package/skill/references/classes/DMT_Event.md +356 -356
  61. package/skill/references/classes/DMT_Folder.md +775 -775
  62. package/skill/references/classes/DMT_Panel.md +531 -531
  63. package/skill/references/classes/DMT_Pcb.md +579 -575
  64. package/skill/references/classes/DMT_Project.md +734 -573
  65. package/skill/references/classes/DMT_Schematic.md +1482 -1477
  66. package/skill/references/classes/DMT_SelectControl.md +96 -96
  67. package/skill/references/classes/DMT_Team.md +172 -172
  68. package/skill/references/classes/DMT_Workspace.md +198 -198
  69. package/skill/references/classes/EDA.md +1001 -961
  70. package/skill/references/classes/IPCB_ComplexPolygon.md +299 -299
  71. package/skill/references/classes/IPCB_Polygon.md +175 -175
  72. package/skill/references/classes/IPCB_PrimitiveArc.md +1901 -1901
  73. package/skill/references/classes/IPCB_PrimitiveAttribute.md +2993 -2993
  74. package/skill/references/classes/IPCB_PrimitiveComponent.md +2624 -2627
  75. package/skill/references/classes/IPCB_PrimitiveComponentPad.md +410 -410
  76. package/skill/references/classes/IPCB_PrimitiveDimension.md +1419 -1419
  77. package/skill/references/classes/IPCB_PrimitiveFill.md +1325 -1325
  78. package/skill/references/classes/IPCB_PrimitiveImage.md +1461 -1461
  79. package/skill/references/classes/IPCB_PrimitiveLine.md +1639 -1639
  80. package/skill/references/classes/IPCB_PrimitiveObject.md +1700 -1700
  81. package/skill/references/classes/IPCB_PrimitivePad.md +3155 -3155
  82. package/skill/references/classes/IPCB_PrimitivePolyline.md +1193 -1193
  83. package/skill/references/classes/IPCB_PrimitivePour.md +1858 -1858
  84. package/skill/references/classes/IPCB_PrimitivePoured.md +556 -556
  85. package/skill/references/classes/IPCB_PrimitiveRegion.md +1332 -1332
  86. package/skill/references/classes/IPCB_PrimitiveString.md +2315 -2315
  87. package/skill/references/classes/IPCB_PrimitiveVia.md +1588 -1588
  88. package/skill/references/classes/ISCH_PrimitiveArc.md +1676 -1676
  89. package/skill/references/classes/ISCH_PrimitiveAttribute.md +2541 -2541
  90. package/skill/references/classes/ISCH_PrimitiveBus.md +973 -973
  91. package/skill/references/classes/ISCH_PrimitiveCbbSymbolComponent.md +260 -260
  92. package/skill/references/classes/ISCH_PrimitiveCircle.md +1392 -1392
  93. package/skill/references/classes/ISCH_PrimitiveComponent.md +2910 -2913
  94. package/skill/references/classes/ISCH_PrimitiveComponentPin.md +155 -155
  95. package/skill/references/classes/ISCH_PrimitiveObject.md +960 -960
  96. package/skill/references/classes/ISCH_PrimitivePin.md +2402 -2402
  97. package/skill/references/classes/ISCH_PrimitivePolygon.md +1028 -1028
  98. package/skill/references/classes/ISCH_PrimitiveRectangle.md +1777 -1777
  99. package/skill/references/classes/ISCH_PrimitiveText.md +1771 -1771
  100. package/skill/references/classes/ISCH_PrimitiveWire.md +973 -973
  101. package/skill/references/classes/LIB_3DModel.md +782 -780
  102. package/skill/references/classes/LIB_Cbb.md +957 -957
  103. package/skill/references/classes/LIB_Classification.md +969 -965
  104. package/skill/references/classes/LIB_Device.md +1222 -1221
  105. package/skill/references/classes/LIB_Footprint.md +1298 -1153
  106. package/skill/references/classes/LIB_LibrariesList.md +361 -329
  107. package/skill/references/classes/LIB_PanelLibrary.md +855 -855
  108. package/skill/references/classes/LIB_SelectControl.md +89 -89
  109. package/skill/references/classes/LIB_SimulationModel.md +807 -821
  110. package/skill/references/classes/LIB_Symbol.md +1341 -1195
  111. package/skill/references/classes/PCB_Document.md +1770 -1754
  112. package/skill/references/classes/PCB_Drc.md +3379 -3375
  113. package/skill/references/classes/PCB_Event.md +1166 -1081
  114. package/skill/references/classes/PCB_ImageTool.md +363 -0
  115. package/skill/references/classes/PCB_Layer.md +1915 -1911
  116. package/skill/references/classes/PCB_ManufactureData.md +2968 -2968
  117. package/skill/references/classes/PCB_MathPolygon.md +916 -785
  118. package/skill/references/classes/PCB_Net.md +1128 -1128
  119. package/skill/references/classes/PCB_Primitive.md +217 -217
  120. package/skill/references/classes/PCB_PrimitiveArc.md +820 -894
  121. package/skill/references/classes/PCB_PrimitiveAttribute.md +635 -717
  122. package/skill/references/classes/PCB_PrimitiveComponent.md +1050 -1050
  123. package/skill/references/classes/PCB_PrimitiveDimension.md +789 -833
  124. package/skill/references/classes/PCB_PrimitiveFill.md +783 -861
  125. package/skill/references/classes/PCB_PrimitiveImage.md +803 -875
  126. package/skill/references/classes/PCB_PrimitiveLine.md +787 -858
  127. package/skill/references/classes/PCB_PrimitiveObject.md +796 -800
  128. package/skill/references/classes/PCB_PrimitivePad.md +947 -944
  129. package/skill/references/classes/PCB_PrimitivePolyline.md +744 -819
  130. package/skill/references/classes/PCB_PrimitivePour.md +808 -845
  131. package/skill/references/classes/PCB_PrimitivePoured.md +363 -363
  132. package/skill/references/classes/PCB_PrimitiveRegion.md +765 -799
  133. package/skill/references/classes/PCB_PrimitiveString.md +828 -910
  134. package/skill/references/classes/PCB_PrimitiveVia.md +761 -765
  135. package/skill/references/classes/PCB_RayTracerEngine.md +603 -263
  136. package/skill/references/classes/PCB_SelectControl.md +495 -495
  137. package/skill/references/classes/PCB_Tool.md +9 -0
  138. package/skill/references/classes/PNL_Document.md +83 -83
  139. package/skill/references/classes/SCH_Document.md +797 -809
  140. package/skill/references/classes/SCH_Drc.md +246 -242
  141. package/skill/references/classes/SCH_Event.md +583 -583
  142. package/skill/references/classes/SCH_ManufactureData.md +1209 -1205
  143. package/skill/references/classes/SCH_Net.md +200 -200
  144. package/skill/references/classes/SCH_Netlist.md +191 -191
  145. package/skill/references/classes/SCH_Primitive.md +337 -337
  146. package/skill/references/classes/SCH_PrimitiveArc.md +686 -692
  147. package/skill/references/classes/SCH_PrimitiveAttribute.md +579 -590
  148. package/skill/references/classes/SCH_PrimitiveBus.md +618 -624
  149. package/skill/references/classes/SCH_PrimitiveCircle.md +667 -683
  150. package/skill/references/classes/SCH_PrimitiveComponent.md +2256 -2240
  151. package/skill/references/classes/SCH_PrimitiveObject.md +666 -666
  152. package/skill/references/classes/SCH_PrimitivePin.md +737 -754
  153. package/skill/references/classes/SCH_PrimitivePolygon.md +621 -627
  154. package/skill/references/classes/SCH_PrimitiveRectangle.md +715 -731
  155. package/skill/references/classes/SCH_PrimitiveText.md +736 -746
  156. package/skill/references/classes/SCH_PrimitiveWire.md +701 -703
  157. package/skill/references/classes/SCH_SelectControl.md +520 -520
  158. package/skill/references/classes/SCH_SimulationEngine.md +133 -133
  159. package/skill/references/classes/SCH_Utils.md +121 -121
  160. package/skill/references/classes/SYS_ClientUrl.md +173 -173
  161. package/skill/references/classes/SYS_Dialog.md +825 -825
  162. package/skill/references/classes/SYS_Environment.md +640 -502
  163. package/skill/references/classes/SYS_ExternalApi.md +246 -0
  164. package/skill/references/classes/SYS_FileManager.md +1664 -1686
  165. package/skill/references/classes/SYS_FileSystem.md +1366 -1171
  166. package/skill/references/classes/SYS_FontManager.md +224 -224
  167. package/skill/references/classes/SYS_FormatConversion.md +349 -349
  168. package/skill/references/classes/SYS_HeaderMenu.md +480 -479
  169. package/skill/references/classes/SYS_Help.md +141 -0
  170. package/skill/references/classes/SYS_I18n.md +861 -861
  171. package/skill/references/classes/SYS_IFrame.md +541 -535
  172. package/skill/references/classes/SYS_LoadingAndProgressBar.md +246 -246
  173. package/skill/references/classes/SYS_Log.md +422 -424
  174. package/skill/references/classes/SYS_Math.md +1565 -1565
  175. package/skill/references/classes/SYS_Message.md +363 -363
  176. package/skill/references/classes/SYS_MessageBox.md +285 -285
  177. package/skill/references/classes/SYS_MessageBus.md +1618 -1618
  178. package/skill/references/classes/SYS_PanelControl.md +696 -696
  179. package/skill/references/classes/SYS_RightClickMenu.md +175 -175
  180. package/skill/references/classes/SYS_Setting.md +134 -85
  181. package/skill/references/classes/SYS_ShortcutKey.md +623 -623
  182. package/skill/references/classes/SYS_Storage.md +484 -484
  183. package/skill/references/classes/SYS_Timer.md +447 -447
  184. package/skill/references/classes/SYS_ToastMessage.md +194 -194
  185. package/skill/references/classes/SYS_Tool.md +317 -241
  186. package/skill/references/classes/SYS_Unit.md +594 -594
  187. package/skill/references/classes/SYS_WebSocket.md +401 -401
  188. package/skill/references/classes/SYS_Window.md +849 -850
  189. package/skill/references/enums/EDMT_EditorDocumentType.md +324 -278
  190. package/skill/references/enums/EDMT_EditorSplitScreenDirection.md +51 -47
  191. package/skill/references/enums/EDMT_EditorTabEventType.md +68 -62
  192. package/skill/references/enums/EDMT_IndicatorMarkerType.md +90 -80
  193. package/skill/references/enums/EDMT_ItemType.md +181 -157
  194. package/skill/references/enums/EDMT_ProjectCollaborationMode.md +51 -47
  195. package/skill/references/enums/EDMT_ProjectFileFormat.md +60 -0
  196. package/skill/references/enums/EDMT_ProjectReadyState.md +82 -0
  197. package/skill/references/enums/ELIB_DeviceJlcLibraryCategory.md +51 -47
  198. package/skill/references/enums/ELIB_LibraryType.md +129 -113
  199. package/skill/references/enums/ELIB_PreviewType.md +77 -69
  200. package/skill/references/enums/ELIB_SimulationModelType.md +51 -47
  201. package/skill/references/enums/ELIB_SymbolType.md +142 -124
  202. package/skill/references/enums/EPCB_AutoRoutingCornerStyle.md +51 -47
  203. package/skill/references/enums/EPCB_AutoRoutingExistingPrimitiveMode.md +51 -47
  204. package/skill/references/enums/EPCB_AutoRoutingOptimization.md +51 -47
  205. package/skill/references/enums/EPCB_DocumentCanvasUpdateCalculationActiveStatus.md +51 -47
  206. package/skill/references/enums/EPCB_DocumentRatlineCalculatingActiveStatus.md +55 -51
  207. package/skill/references/enums/EPCB_InactiveLayerDisplayMode.md +64 -58
  208. package/skill/references/enums/EPCB_LayerColorConfiguration.md +90 -80
  209. package/skill/references/enums/EPCB_LayerId.md +1169 -881
  210. package/skill/references/enums/EPCB_LayerStatus.md +64 -58
  211. package/skill/references/enums/EPCB_LayerType.md +129 -113
  212. package/skill/references/enums/EPCB_MouseEventType.md +64 -58
  213. package/skill/references/enums/EPCB_NetEventType.md +64 -58
  214. package/skill/references/enums/EPCB_PcbPlateType.md +51 -47
  215. package/skill/references/enums/EPCB_PdfOutputMethod.md +64 -58
  216. package/skill/references/enums/EPCB_PrimitiveArcInteractiveMode.md +51 -47
  217. package/skill/references/enums/EPCB_PrimitiveDimensionType.md +64 -58
  218. package/skill/references/enums/EPCB_PrimitiveEventType.md +64 -58
  219. package/skill/references/enums/EPCB_PrimitiveFillMode.md +68 -62
  220. package/skill/references/enums/EPCB_PrimitivePadHeatWeldingConnectionMethod.md +64 -58
  221. package/skill/references/enums/EPCB_PrimitivePadHoleType.md +64 -58
  222. package/skill/references/enums/EPCB_PrimitivePadShapeType.md +90 -80
  223. package/skill/references/enums/EPCB_PrimitivePadType.md +64 -58
  224. package/skill/references/enums/EPCB_PrimitivePourFillMethod.md +64 -58
  225. package/skill/references/enums/EPCB_PrimitiveRegionRuleType.md +107 -95
  226. package/skill/references/enums/EPCB_PrimitiveStringAlignMode.md +142 -124
  227. package/skill/references/enums/EPCB_PrimitiveType.md +233 -201
  228. package/skill/references/enums/EPCB_PrimitiveViaType.md +64 -58
  229. package/skill/references/enums/ESCH_DynamicSimulationEnginePullEventType.md +116 -102
  230. package/skill/references/enums/ESCH_DynamicSimulationEnginePushEventType.md +90 -80
  231. package/skill/references/enums/ESCH_ExportDocumentFileType.md +64 -58
  232. package/skill/references/enums/ESCH_MouseEventType.md +51 -47
  233. package/skill/references/enums/ESCH_PrimitiveComponentType.md +142 -124
  234. package/skill/references/enums/ESCH_PrimitiveEventType.md +77 -69
  235. package/skill/references/enums/ESCH_PrimitiveFillStyle.md +129 -113
  236. package/skill/references/enums/ESCH_PrimitiveLineType.md +77 -69
  237. package/skill/references/enums/ESCH_PrimitivePinShape.md +77 -69
  238. package/skill/references/enums/ESCH_PrimitivePinType.md +168 -146
  239. package/skill/references/enums/ESCH_PrimitiveTextAlignMode.md +142 -124
  240. package/skill/references/enums/ESCH_PrimitiveType.md +207 -179
  241. package/skill/references/enums/ESCH_SimulationNetlistType.md +38 -36
  242. package/skill/references/enums/ESCH_SpiceSimulationEnginePullEventType.md +51 -47
  243. package/skill/references/enums/ESCH_SpiceSimulationEnginePushEventType.md +77 -69
  244. package/skill/references/enums/ESYS_BottomPanelTab.md +94 -80
  245. package/skill/references/enums/ESYS_HeaderMenuEnvironment.md +181 -157
  246. package/skill/references/enums/ESYS_ImportProjectBoardOutlineSource.md +55 -51
  247. package/skill/references/enums/ESYS_ImportProjectImportOption.md +64 -58
  248. package/skill/references/enums/ESYS_ImportProjectSchematicObjectStyle.md +51 -47
  249. package/skill/references/enums/ESYS_ImportProjectViaSolderMaskExpansion.md +55 -51
  250. package/skill/references/enums/ESYS_JobState.md +95 -0
  251. package/skill/references/enums/ESYS_LeftPanelTab.md +94 -80
  252. package/skill/references/enums/ESYS_LogType.md +77 -102
  253. package/skill/references/enums/ESYS_NetlistType.md +129 -113
  254. package/skill/references/enums/ESYS_PanelPosition.md +69 -0
  255. package/skill/references/enums/ESYS_PanelTab.md +368 -0
  256. package/skill/references/enums/ESYS_RightPanelTab.md +237 -201
  257. package/skill/references/enums/ESYS_ShortcutKeyEffectiveEditorRange.md +220 -190
  258. package/skill/references/enums/ESYS_ShortcutKeyEffectiveEditorScene.md +103 -91
  259. package/skill/references/enums/ESYS_StartPageQuickStartItem.md +237 -205
  260. package/skill/references/enums/ESYS_Theme.md +51 -47
  261. package/skill/references/enums/ESYS_ToastMessageType.md +90 -80
  262. package/skill/references/enums/ESYS_Unit.md +116 -102
  263. package/skill/references/enums/ESYS_WindowEventType.md +64 -47
  264. package/skill/references/enums/ESYS_WindowOpenTarget.md +51 -47
  265. package/skill/references/enums/NetportDeviceName.md +146 -146
  266. package/skill/references/enums/SchToolBarDeviceName.md +278 -278
  267. package/skill/references/interfaces/BoardProps.md +169 -169
  268. package/skill/references/interfaces/BorderConfig.md +109 -0
  269. package/skill/references/interfaces/ButtonProps.md +196 -169
  270. package/skill/references/interfaces/CellClickInfo.md +142 -0
  271. package/skill/references/interfaces/CellCoord.md +88 -0
  272. package/skill/references/interfaces/CheckBoxProps.md +223 -196
  273. package/skill/references/interfaces/CheckChangeDetail.md +88 -0
  274. package/skill/references/interfaces/CheckboxEditConfig.md +159 -0
  275. package/skill/references/interfaces/ClipboardCellData.md +142 -0
  276. package/skill/references/interfaces/ClipboardConfig.md +115 -0
  277. package/skill/references/interfaces/ColorPickerProps.md +169 -0
  278. package/skill/references/interfaces/ColumnDef.md +605 -0
  279. package/skill/references/interfaces/ColumnEditTrigger.md +57 -0
  280. package/skill/references/interfaces/ColumnGroupDef.md +192 -0
  281. package/skill/references/interfaces/ColumnResizeConfig.md +142 -0
  282. package/skill/references/interfaces/ComponentPropsMap.md +517 -448
  283. package/skill/references/interfaces/CustomHeaderConfig.md +169 -0
  284. package/skill/references/interfaces/DialogProps.md +385 -385
  285. package/skill/references/interfaces/DragSortConfig.md +115 -0
  286. package/skill/references/interfaces/EditingConfig.md +196 -0
  287. package/skill/references/interfaces/FilteringConfig.md +250 -0
  288. package/skill/references/interfaces/FixedColumnConfig.md +88 -0
  289. package/skill/references/interfaces/FlexItemProps.md +116 -116
  290. package/skill/references/interfaces/FlexProps.md +224 -224
  291. package/skill/references/interfaces/GridItemProps.md +143 -143
  292. package/skill/references/interfaces/GridProps.md +143 -143
  293. package/skill/references/interfaces/IDMT_BoardItem.md +171 -171
  294. package/skill/references/interfaces/IDMT_BriefProjectItem.md +171 -171
  295. package/skill/references/interfaces/IDMT_EditorDocumentItem.md +169 -169
  296. package/skill/references/interfaces/IDMT_EditorSplitScreenItem.md +173 -173
  297. package/skill/references/interfaces/IDMT_EditorTabItem.md +169 -169
  298. package/skill/references/interfaces/IDMT_FolderItem.md +225 -225
  299. package/skill/references/interfaces/IDMT_IndicatorMarkerShape.md +393 -393
  300. package/skill/references/interfaces/IDMT_PanelItem.md +144 -144
  301. package/skill/references/interfaces/IDMT_PcbItem.md +171 -171
  302. package/skill/references/interfaces/IDMT_ProjectItem.md +143 -143
  303. package/skill/references/interfaces/IDMT_SchematicItem.md +225 -225
  304. package/skill/references/interfaces/IDMT_SchematicPageItem.md +198 -198
  305. package/skill/references/interfaces/IDMT_TeamItem.md +144 -144
  306. package/skill/references/interfaces/IDMT_WorkspaceItem.md +117 -117
  307. package/skill/references/interfaces/IDesignPortal.md +103 -103
  308. package/skill/references/interfaces/ILIB_3DModelItem.md +198 -198
  309. package/skill/references/interfaces/ILIB_3DModelSearchItem.md +277 -277
  310. package/skill/references/interfaces/ILIB_CbbItem.md +225 -225
  311. package/skill/references/interfaces/ILIB_CbbSearchItem.md +277 -277
  312. package/skill/references/interfaces/ILIB_ClassificationIndex.md +150 -150
  313. package/skill/references/interfaces/ILIB_ClassificationNode.md +98 -0
  314. package/skill/references/interfaces/ILIB_DeviceAssociationItem.md +210 -210
  315. package/skill/references/interfaces/ILIB_DeviceExtendPropertyItem.md +304 -304
  316. package/skill/references/interfaces/ILIB_DeviceItem.md +279 -279
  317. package/skill/references/interfaces/ILIB_DevicePropertiesForSearch.md +250 -250
  318. package/skill/references/interfaces/ILIB_DeviceSearchItem.md +521 -521
  319. package/skill/references/interfaces/ILIB_ExtendLibrary3DModelFunctions.md +64 -64
  320. package/skill/references/interfaces/ILIB_ExtendLibraryCbbFunctions.md +93 -99
  321. package/skill/references/interfaces/ILIB_ExtendLibraryClassificationIndex.md +150 -150
  322. package/skill/references/interfaces/ILIB_ExtendLibraryDeviceFunctions.md +143 -157
  323. package/skill/references/interfaces/ILIB_ExtendLibraryFootprintFunctions.md +63 -63
  324. package/skill/references/interfaces/ILIB_ExtendLibraryFunctions.md +123 -123
  325. package/skill/references/interfaces/ILIB_ExtendLibraryItem.md +97 -97
  326. package/skill/references/interfaces/ILIB_ExtendLibraryItemIndex.md +98 -98
  327. package/skill/references/interfaces/ILIB_ExtendLibrarySearchProperty.md +115 -115
  328. package/skill/references/interfaces/ILIB_ExtendLibrarySearchResult.md +169 -169
  329. package/skill/references/interfaces/ILIB_ExtendLibrarySearchResultDataLine.md +234 -234
  330. package/skill/references/interfaces/ILIB_ExtendLibrarySymbolFunctions.md +91 -105
  331. package/skill/references/interfaces/ILIB_ExtendLibraryUserIndex.md +96 -96
  332. package/skill/references/interfaces/ILIB_FootprintItem.md +256 -198
  333. package/skill/references/interfaces/ILIB_FootprintPropertiesForSearch.md +61 -61
  334. package/skill/references/interfaces/ILIB_FootprintSearchItem.md +277 -277
  335. package/skill/references/interfaces/ILIB_LibraryInfo.md +92 -92
  336. package/skill/references/interfaces/ILIB_LibraryItem.md +115 -115
  337. package/skill/references/interfaces/ILIB_PanelLibraryItem.md +198 -198
  338. package/skill/references/interfaces/ILIB_PanelLibrarySearchItem.md +277 -277
  339. package/skill/references/interfaces/ILIB_RegisterExtendLibraryProps.md +71 -0
  340. package/skill/references/interfaces/ILIB_SimulationModelItem.md +306 -306
  341. package/skill/references/interfaces/ILIB_SimulationModelSearchItem.md +304 -304
  342. package/skill/references/interfaces/ILIB_SymbolItem.md +306 -279
  343. package/skill/references/interfaces/ILIB_SymbolPropertiesForSearch.md +61 -61
  344. package/skill/references/interfaces/ILIB_SymbolSearchItem.md +304 -304
  345. package/skill/references/interfaces/IPCB_AutoLayoutResult.md +169 -169
  346. package/skill/references/interfaces/IPCB_AutoRoutingProps.md +220 -220
  347. package/skill/references/interfaces/IPCB_AutoRoutingResult.md +169 -169
  348. package/skill/references/interfaces/IPCB_BomPropertiesTableColumns.md +169 -169
  349. package/skill/references/interfaces/IPCB_DifferentialPairItem.md +115 -115
  350. package/skill/references/interfaces/IPCB_DiscretizeOptions.md +65 -65
  351. package/skill/references/interfaces/IPCB_DiscretizedPoint.md +88 -88
  352. package/skill/references/interfaces/IPCB_EqualLengthNetGroupItem.md +115 -115
  353. package/skill/references/interfaces/IPCB_LayerItem.md +277 -277
  354. package/skill/references/interfaces/IPCB_NetClassItem.md +115 -115
  355. package/skill/references/interfaces/IPCB_NetInfo.md +115 -115
  356. package/skill/references/interfaces/IPCB_PadPairGroupItem.md +88 -88
  357. package/skill/references/interfaces/IPCB_PadPairMinWireLengthItem.md +88 -88
  358. package/skill/references/interfaces/IPCB_PhysicalStackingConfiguration.md +115 -115
  359. package/skill/references/interfaces/IPCB_Primitive.md +218 -218
  360. package/skill/references/interfaces/IPCB_PrimitiveAPI.md +174 -175
  361. package/skill/references/interfaces/IPCB_PrimitivePadHeatWelding.md +151 -151
  362. package/skill/references/interfaces/IPCB_PrimitivePouredPourFill.md +142 -142
  363. package/skill/references/interfaces/IPCB_PrimitiveSolderMaskAndPasteMaskExpansion.md +154 -154
  364. package/skill/references/interfaces/IPCB_RayTracerBackgroundConfig.md +223 -0
  365. package/skill/references/interfaces/IPCB_RayTracerLightConfig.md +412 -0
  366. package/skill/references/interfaces/IPCB_RayTracerMaterialConfig.md +547 -0
  367. package/skill/references/interfaces/IPCB_RayTracerPcbMaterialConfig.md +196 -0
  368. package/skill/references/interfaces/IPCB_RayTracerRenderConfigurations.md +200 -0
  369. package/skill/references/interfaces/IPCB_RayTracerRendererConfig.md +196 -0
  370. package/skill/references/interfaces/IPCB_RayTracerSceneElement.md +115 -0
  371. package/skill/references/interfaces/IPCB_RayTracerSceneElementTransform.md +123 -0
  372. package/skill/references/interfaces/IPCB_RayTracerTexture.md +88 -0
  373. package/skill/references/interfaces/IPCB_SubstratePhysicalProperties.md +88 -88
  374. package/skill/references/interfaces/IRawNet.md +103 -103
  375. package/skill/references/interfaces/IRawPureSchematic.md +80 -80
  376. package/skill/references/interfaces/IRawSchematic.md +103 -103
  377. package/skill/references/interfaces/IRawWire.md +149 -149
  378. package/skill/references/interfaces/ISCH_DrcError.md +142 -142
  379. package/skill/references/interfaces/ISCH_DrcErrorPrimitive.md +142 -142
  380. package/skill/references/interfaces/ISCH_ExportPngResolution.md +94 -94
  381. package/skill/references/interfaces/ISCH_NetInfo.md +88 -88
  382. package/skill/references/interfaces/ISCH_Primitive.md +218 -219
  383. package/skill/references/interfaces/ISCH_PrimitiveAPI.md +174 -175
  384. package/skill/references/interfaces/ISCH_ProjectNetInfo.md +142 -142
  385. package/skill/references/interfaces/ISCH_WireInfo.md +169 -169
  386. package/skill/references/interfaces/ISYS_ComparisonResponse.md +115 -0
  387. package/skill/references/interfaces/ISYS_ExtensionExternalApiIndex.md +13 -0
  388. package/skill/references/interfaces/ISYS_ExtensionRegisteredExternalApis.md +13 -0
  389. package/skill/references/interfaces/ISYS_ExternalApiHelp.md +173 -0
  390. package/skill/references/interfaces/ISYS_ExternalApiRegistration.md +146 -0
  391. package/skill/references/interfaces/ISYS_FileSystemFileList.md +169 -169
  392. package/skill/references/interfaces/ISYS_HeaderMenuSub1MenuItem.md +205 -174
  393. package/skill/references/interfaces/ISYS_HeaderMenuSub2MenuItem.md +178 -147
  394. package/skill/references/interfaces/ISYS_HeaderMenuTopMenuItem.md +115 -115
  395. package/skill/references/interfaces/ISYS_HeaderMenus.md +408 -408
  396. package/skill/references/interfaces/ISYS_HelpAudienceEntry.md +92 -0
  397. package/skill/references/interfaces/ISYS_HelpClassSummary.md +205 -0
  398. package/skill/references/interfaces/ISYS_HelpData.md +92 -0
  399. package/skill/references/interfaces/ISYS_HelpMethodDetail.md +310 -0
  400. package/skill/references/interfaces/ISYS_JobHandle.md +65 -0
  401. package/skill/references/interfaces/ISYS_JobLogEntry.md +142 -0
  402. package/skill/references/interfaces/ISYS_JobStatus.md +176 -0
  403. package/skill/references/interfaces/ISYS_LogLine.md +115 -115
  404. package/skill/references/interfaces/ISYS_MathBBox.md +142 -142
  405. package/skill/references/interfaces/ISYS_MathPoint.md +88 -88
  406. package/skill/references/interfaces/ISYS_MathPolygonWithHoles.md +92 -92
  407. package/skill/references/interfaces/ISYS_MessageBusTask.md +115 -115
  408. package/skill/references/interfaces/ISYS_MultilingualLanguagesData.md +12 -12
  409. package/skill/references/interfaces/ISYS_RightClickMenuItem.md +174 -174
  410. package/skill/references/interfaces/ISYS_ShortcutKeyData.md +169 -169
  411. package/skill/references/interfaces/ISYS_ShortcutKeyDataWithCallFn.md +62 -62
  412. package/skill/references/interfaces/ISYS_ShortcutKeyDataWithUserDefinedShortcutKey.md +62 -62
  413. package/skill/references/interfaces/ISYS_WindowEventListenerRemovableObject.md +109 -109
  414. package/skill/references/interfaces/IconProps.md +88 -88
  415. package/skill/references/interfaces/ImageProps.md +115 -115
  416. package/skill/references/interfaces/InputEditConfig.md +182 -0
  417. package/skill/references/interfaces/InputProps.md +547 -520
  418. package/skill/references/interfaces/KeyboardConfig.md +61 -0
  419. package/skill/references/interfaces/ListChildren.md +223 -223
  420. package/skill/references/interfaces/ListProps.md +250 -223
  421. package/skill/references/interfaces/ModalProps.md +358 -358
  422. package/skill/references/interfaces/NumberEditConfig.md +234 -0
  423. package/skill/references/interfaces/RadioGroupProps.md +196 -196
  424. package/skill/references/interfaces/RadioItem.md +115 -115
  425. package/skill/references/interfaces/RichTableProps.md +1357 -0
  426. package/skill/references/interfaces/RowMetaConfig.md +142 -0
  427. package/skill/references/interfaces/ScrollerProps.md +169 -169
  428. package/skill/references/interfaces/SelectEditConfig.md +211 -0
  429. package/skill/references/interfaces/SelectListItem.md +142 -142
  430. package/skill/references/interfaces/SelectOption.md +142 -0
  431. package/skill/references/interfaces/SelectProps.md +169 -169
  432. package/skill/references/interfaces/SelectionConfig.md +358 -0
  433. package/skill/references/interfaces/SliderProps.md +142 -0
  434. package/skill/references/interfaces/SlotProps.md +88 -88
  435. package/skill/references/interfaces/SortState.md +88 -0
  436. package/skill/references/interfaces/SortingConfig.md +169 -0
  437. package/skill/references/interfaces/StyleProps.md +439 -385
  438. package/skill/references/interfaces/TextAreaProps.md +196 -196
  439. package/skill/references/interfaces/TextProps.md +169 -169
  440. package/skill/references/interfaces/TextareaEditConfig.md +182 -0
  441. package/skill/references/interfaces/ValidationRule.md +223 -0
  442. package/skill/references/interfaces/VirtualScrollConfig.md +115 -0
  443. package/skill/references/types/Align.md +9 -0
  444. package/skill/references/types/CellContentType.md +9 -0
  445. package/skill/references/types/ColumnDefOrGroup.md +12 -0
  446. package/skill/references/types/ColumnEditConfig.md +13 -0
  447. package/skill/references/types/ColumnType.md +9 -0
  448. package/skill/references/types/DataChangeType.md +9 -0
  449. package/skill/references/types/FilterMatchMode.md +9 -0
  450. package/skill/references/types/RichTableRow.md +12 -0
  451. package/skill/references/types/Serializable.md +10 -0
  452. package/skill/references/types/SerializablePrimitive.md +9 -0
  453. package/skill/references/types/SortOrder.md +9 -0
  454. package/skill/references/types/TPCB_LayerTypesOfInnerLayer.md +11 -11
  455. package/skill/references/types/TPCB_LayersInTheSelectable.md +42 -42
  456. package/skill/references/types/TPCB_LayersOfComponent.md +11 -11
  457. package/skill/references/types/TPCB_LayersOfCopper.md +15 -15
  458. package/skill/references/types/TPCB_LayersOfCustom.md +41 -41
  459. package/skill/references/types/TPCB_LayersOfDimension.md +16 -16
  460. package/skill/references/types/TPCB_LayersOfFill.md +28 -28
  461. package/skill/references/types/TPCB_LayersOfImage.md +22 -22
  462. package/skill/references/types/TPCB_LayersOfInner.md +41 -41
  463. package/skill/references/types/TPCB_LayersOfLine.md +25 -25
  464. package/skill/references/types/TPCB_LayersOfObject.md +12 -12
  465. package/skill/references/types/TPCB_LayersOfPad.md +11 -11
  466. package/skill/references/types/TPCB_LayersOfRegion.md +11 -11
  467. package/skill/references/types/TPCB_NumberOfCopperLayers.md +9 -9
  468. package/skill/references/types/TPCB_PolygonSourceArray.md +85 -83
  469. package/skill/references/types/TPCB_PrimitiveDimensionCoordinateSet.md +66 -66
  470. package/skill/references/types/TPCB_PrimitivePadHole.md +30 -30
  471. package/skill/references/types/TPCB_PrimitivePadShape.md +61 -61
  472. package/skill/references/types/TPCB_PrimitiveSpecialPadShape.md +19 -19
  473. package/skill/references/types/TSYS_ComparisonErrorCode.md +15 -0
  474. package/skill/references/types/TSYS_LanguageKeyValuePairs.md +13 -0
  475. package/skill/references/types/TSYS_MathPolygonGroup.md +15 -15
  476. package/skill/references/types/TSYS_MathPolygonInput.md +20 -20
  477. package/skill/references/types/TSYS_ShortcutKeys.md +96 -96
  478. package/skill/user-guide/using-extension.md +47 -47
  479. package/src/json-gen.test.js +430 -0
  480. package/skill/guide/ancillary-projects/pro-api-sdk.md +0 -1
  481. package/skill/references/interfaces/ISYS_PcbComparisonResponse.md +0 -115
  482. package/skill/references/types/ISYS_LanguageKeyValuePairs.md +0 -13
  483. package/skill/references/types/TSYS_PcbComparisonErrorCode.md +0 -10
@@ -1,1911 +1,1915 @@
1
- # PCB\_Layer class
2
-
3
- PCB & footprint / layer operation class
4
-
5
- ## Signature
6
-
7
- ```typescript
8
- class PCB_Layer
9
- ```
10
-
11
- ## Methods
12
-
13
- <table><thead><tr><th>
14
-
15
- Method
16
-
17
- </th><th>
18
-
19
- Modifiers
20
-
21
- </th><th>
22
-
23
- Description
24
-
25
- </th></tr></thead>
26
- <tbody><tr><td>
27
-
28
- [addCustomLayer()](./PCB_Layer.md)
29
-
30
- </td><td>
31
-
32
- </td><td>
33
-
34
- **_(BETA)_** Add a custom layer
35
-
36
- </td></tr>
37
- <tr><td>
38
-
39
- [deletePhysicalStackingConfiguration(configurationName, physicalProps)](./PCB_Layer.md)
40
-
41
- </td><td>
42
-
43
- </td><td>
44
-
45
- **_(BETA)_** Delete Physical stacking configuration
46
-
47
- </td></tr>
48
- <tr><td>
49
-
50
- [getAllLayers()](./PCB_Layer.md)
51
-
52
- </td><td>
53
-
54
- </td><td>
55
-
56
- **_(BETA)_** Get the detailed properties of all layers
57
-
58
- </td></tr>
59
- <tr><td>
60
-
61
- [getAllPhysicalStackingConfigurations(physicalProps)](./PCB_Layer.md)
62
-
63
- </td><td>
64
-
65
- </td><td>
66
-
67
- **_(BETA)_** Get all Physical stacking configuration
68
-
69
- </td></tr>
70
- <tr><td>
71
-
72
- [getCurrentLayer()](./PCB_Layer.md)
73
-
74
- </td><td>
75
-
76
- </td><td>
77
-
78
- **_(BETA)_** Get the detailed properties of the current layer
79
-
80
- </td></tr>
81
- <tr><td>
82
-
83
- [getCurrentPhysicalStackingConfiguration()](./PCB_Layer.md)
84
-
85
- </td><td>
86
-
87
- </td><td>
88
-
89
- **_(BETA)_** Get Current physical stacking configuration
90
-
91
- </td></tr>
92
- <tr><td>
93
-
94
- [getCurrentPhysicalStackingConfigurationName()](./PCB_Layer.md)
95
-
96
- </td><td>
97
-
98
- </td><td>
99
-
100
- **_(BETA)_** Get Current physical stacking configuration name
101
-
102
- </td></tr>
103
- <tr><td>
104
-
105
- [getDefaultPhysicalStackingConfigurationName(physicalProps)](./PCB_Layer.md)
106
-
107
- </td><td>
108
-
109
- </td><td>
110
-
111
- **_(BETA)_** Get the name of the default physical stacking configuration for new PCBs
112
-
113
- </td></tr>
114
- <tr><td>
115
-
116
- [getPhysicalStackingConfiguration(configurationName, physicalProps)](./PCB_Layer.md)
117
-
118
- </td><td>
119
-
120
- </td><td>
121
-
122
- **_(BETA)_** Get Specify physical stacking configuration
123
-
124
- </td></tr>
125
- <tr><td>
126
-
127
- [lockLayer(layer)](./PCB_Layer.md)
128
-
129
- </td><td>
130
-
131
- </td><td>
132
-
133
- **_(BETA)_** Lock the layer
134
-
135
- </td></tr>
136
- <tr><td>
137
-
138
- [modifyLayer(layer, property)](./PCB_Layer.md)
139
-
140
- </td><td>
141
-
142
- </td><td>
143
-
144
- **_(BETA)_** Modify Layer properties
145
-
146
- </td></tr>
147
- <tr><td>
148
-
149
- [overwriteCurrentPhysicalStackingConfiguration(physicalStackingConfiguration)](./PCB_Layer.md)
150
-
151
- </td><td>
152
-
153
- </td><td>
154
-
155
- **_(BETA)_** Overwrite current physical stacking configuration
156
-
157
- </td></tr>
158
- <tr><td>
159
-
160
- [removeLayer(layer)](./PCB_Layer.md)
161
-
162
- </td><td>
163
-
164
- </td><td>
165
-
166
- **_(BETA)_** Remove Layer
167
-
168
- </td></tr>
169
- <tr><td>
170
-
171
- [renamePhysicalStackingConfiguration(originalConfigurationName, configurationName, physicalProps)](./PCB_Layer.md)
172
-
173
- </td><td>
174
-
175
- </td><td>
176
-
177
- **_(BETA)_** Rename the physical stacking configuration
178
-
179
- </td></tr>
180
- <tr><td>
181
-
182
- [savePhysicalStackingConfiguration(physicalStackingConfiguration, configurationName, physicalProps, allowOverwrite)](./PCB_Layer.md)
183
-
184
- </td><td>
185
-
186
- </td><td>
187
-
188
- **_(BETA)_** Save Physical stacking configuration
189
-
190
- </td></tr>
191
- <tr><td>
192
-
193
- [selectLayer(layer)](./PCB_Layer.md)
194
-
195
- </td><td>
196
-
197
- </td><td>
198
-
199
- Select a layer
200
-
201
- </td></tr>
202
- <tr><td>
203
-
204
- [setAsDefaultPhysicalStackingConfiguration(configurationName, physicalProps)](./PCB_Layer.md)
205
-
206
- </td><td>
207
-
208
- </td><td>
209
-
210
- **_(BETA)_** Set as the default physical stacking configuration for new PCBs
211
-
212
- </td></tr>
213
- <tr><td>
214
-
215
- [setInactiveLayerDisplayMode(displayMode)](./PCB_Layer.md)
216
-
217
- </td><td>
218
-
219
- </td><td>
220
-
221
- **_(BETA)_** Set Inactive layer display mode
222
-
223
- </td></tr>
224
- <tr><td>
225
-
226
- [setInactiveLayerTransparency(transparency)](./PCB_Layer.md)
227
-
228
- </td><td>
229
-
230
- </td><td>
231
-
232
- **_(BETA)_** Set the inactive layer transparency
233
-
234
- </td></tr>
235
- <tr><td>
236
-
237
- [setLayerColorConfiguration(colorConfiguration)](./PCB_Layer.md)
238
-
239
- </td><td>
240
-
241
- </td><td>
242
-
243
- **_(BETA)_** Set the layer color configuration
244
-
245
- </td></tr>
246
- <tr><td>
247
-
248
- [setLayerInvisible(layer, setOtherLayerVisible)](./PCB_Layer.md)
249
-
250
- </td><td>
251
-
252
- </td><td>
253
-
254
- **_(BETA)_** Set the layer to invisible
255
-
256
- </td></tr>
257
- <tr><td>
258
-
259
- [setLayerVisible(layer, setOtherLayerInvisible)](./PCB_Layer.md)
260
-
261
- </td><td>
262
-
263
- </td><td>
264
-
265
- **_(BETA)_** Set the layer to visible
266
-
267
- </td></tr>
268
- <tr><td>
269
-
270
- [setPcbType(pcbType)](./PCB_Layer.md)
271
-
272
- </td><td>
273
-
274
- </td><td>
275
-
276
- **_(BETA)_** Set PCB type
277
-
278
- </td></tr>
279
- <tr><td>
280
-
281
- [setTheNumberOfCopperLayers(numberOfLayers)](./PCB_Layer.md)
282
-
283
- </td><td>
284
-
285
- </td><td>
286
-
287
- **_(BETA)_** Set Number of copper layers
288
-
289
- </td></tr>
290
- <tr><td>
291
-
292
- [unlockLayer(layer)](./PCB_Layer.md)
293
-
294
- </td><td>
295
-
296
- </td><td>
297
-
298
- **_(BETA)_** Unlock the layer
299
-
300
- </td></tr>
301
- </tbody></table>
302
-
303
- ---
304
-
305
- ## 方法详情
306
-
307
- ### addcustomlayer
308
-
309
- # PCB\_Layer.addCustomLayer() method
310
-
311
- > 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.
312
-
313
- Add a custom layer
314
-
315
- ## Signature
316
-
317
- ```typescript
318
- function addCustomLayer(): Promise<TPCB_LayersOfCustom | undefined>;
319
- ```
320
-
321
- ## Returns
322
-
323
- Promise&lt;[TPCB\_LayersOfCustom](../types/TPCB_LayersOfCustom.md) \| undefined&gt;
324
-
325
- The layer ID of the newly added custom layer. If it is `undefined`<!-- -->, the addition failed, possibly because the number of custom layers has reached the upper limit
326
-
327
- ## Example
328
-
329
- ```javascript
330
- // 1. 先移除历史运行遗留的自定义层,保证案例可以反复执行
331
- const layers = await eda.pcb_Layer.getAllLayers();
332
- for (const item of layers.filter(l => l.type === 'CUSTOM')) {
333
- await eda.pcb_Layer.removeLayer(item.id);
334
- }
335
-
336
- // 2. 新增自定义层,返回新层的图层 ID(CUSTOM_1=71 起顺延分配)
337
- const customLayerId = await eda.pcb_Layer.addCustomLayer();
338
-
339
- // 3. 从图层列表确认新层已存在(保留现场,可在图层面板观察)
340
- const after = await eda.pcb_Layer.getAllLayers();
341
- const newLayer = after.find(l => l.id === customLayerId);
342
-
343
- console.log('customLayerId:', customLayerId);
344
- console.log('newLayerName:', newLayer?.name);
345
- console.log('customLayerCount:', after.filter(l => l.type === 'CUSTOM').length);
346
- ```
347
-
348
- ### deletephysicalstackingconfiguration
349
-
350
- # PCB\_Layer.deletePhysicalStackingConfiguration() method
351
-
352
- > 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.
353
-
354
- Delete Physical stacking configuration
355
-
356
- ## Signature
357
-
358
- ```typescript
359
- function deletePhysicalStackingConfiguration(
360
- configurationName: string,
361
- physicalProps?: IPCB_SubstratePhysicalProperties,
362
- ): Promise<boolean>;
363
- ```
364
-
365
- ## Parameters
366
-
367
- <table><thead><tr><th>
368
-
369
- Parameter
370
-
371
- </th><th>
372
-
373
- Type
374
-
375
- </th><th>
376
-
377
- Description
378
-
379
- </th></tr></thead>
380
- <tbody><tr><td>
381
-
382
- configurationName
383
-
384
- </td><td>
385
-
386
- string
387
-
388
- </td><td>
389
-
390
- Configuration name
391
-
392
- </td></tr>
393
- <tr><td>
394
-
395
- physicalProps
396
-
397
- </td><td>
398
-
399
- [IPCB\_SubstratePhysicalProperties](../interfaces/IPCB_SubstratePhysicalProperties.md)
400
-
401
- </td><td>
402
-
403
- _(Optional)_ Physical properties. If not passed in, the current PCB properties are used by default
404
-
405
- </td></tr>
406
- </tbody></table>
407
-
408
- ## Returns
409
-
410
- Promise&lt;boolean&gt;
411
-
412
- Delete Whether Successful
413
-
414
- ## Remarks
415
-
416
- ADD since EDA v4.2
417
-
418
- ### getalllayers
419
-
420
- # PCB\_Layer.getAllLayers() method
421
-
422
- > 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.
423
-
424
- Get the detailed properties of all layers
425
-
426
- ## Signature
427
-
428
- ```typescript
429
- function getAllLayers(): Promise<Array<IPCB_LayerItem>>;
430
- ```
431
-
432
- ## Returns
433
-
434
- Promise&lt;Array&lt;[IPCB\_LayerItem](../interfaces/IPCB_LayerItem.md)<!-- -->&gt;&gt;
435
-
436
- Detailed properties of all layers
437
-
438
- ## Example
439
-
440
- ```javascript
441
- // 1. 一次性取回当前 PCB 的全部图层
442
- const layers = await eda.pcb_Layer.getAllLayers();
443
-
444
- // 2. 查看顶层(TOP=1)的典型属性
445
- const top = layers.find(l => l.id === 1);
446
-
447
- // 3. 统计信号层(铜箔层)数量
448
- const copperCount = layers.filter(l => l.type === 'SIGNAL').length;
449
-
450
- console.log('totalCount:', layers.length);
451
- console.log('topLayerName:', top?.name);
452
- console.log('topLayerColor:', top?.color);
453
- console.log('topLayerLocked:', top?.locked);
454
- console.log('copperLayerCount:', copperCount);
455
- ```
456
-
457
- ### getallphysicalstackingconfigurations
458
-
459
- # PCB\_Layer.getAllPhysicalStackingConfigurations() method
460
-
461
- > 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.
462
-
463
- Get all Physical stacking configuration
464
-
465
- ## Signature
466
-
467
- ```typescript
468
- function getAllPhysicalStackingConfigurations(
469
- physicalProps?: IPCB_SubstratePhysicalProperties,
470
- ): Promise<Array<IPCB_PhysicalStackingConfiguration>>;
471
- ```
472
-
473
- ## Parameters
474
-
475
- <table><thead><tr><th>
476
-
477
- Parameter
478
-
479
- </th><th>
480
-
481
- Type
482
-
483
- </th><th>
484
-
485
- Description
486
-
487
- </th></tr></thead>
488
- <tbody><tr><td>
489
-
490
- physicalProps
491
-
492
- </td><td>
493
-
494
- [IPCB\_SubstratePhysicalProperties](../interfaces/IPCB_SubstratePhysicalProperties.md)
495
-
496
- </td><td>
497
-
498
- _(Optional)_ Physical properties. If not passed in, the current PCB properties are used by default
499
-
500
- </td></tr>
501
- </tbody></table>
502
-
503
- ## Returns
504
-
505
- Promise&lt;Array&lt;[IPCB\_PhysicalStackingConfiguration](../interfaces/IPCB_PhysicalStackingConfiguration.md)<!-- -->&gt;&gt;
506
-
507
- All physical stacking configurations
508
-
509
- ## Remarks
510
-
511
- ADD since EDA v4.2
512
-
513
- ### getcurrentlayer
514
-
515
- # PCB\_Layer.getCurrentLayer() method
516
-
517
- > 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.
518
-
519
- Get the detailed properties of the current layer
520
-
521
- ## Signature
522
-
523
- ```typescript
524
- function getCurrentLayer(): Promise<IPCB_LayerItem | undefined>;
525
- ```
526
-
527
- ## Returns
528
-
529
- Promise&lt;[IPCB\_LayerItem](../interfaces/IPCB_LayerItem.md) \| undefined&gt;
530
-
531
- Detailed properties of the current layer. `undefined` is returned when there is no active layer or no PCB canvas
532
-
533
- ## Remarks
534
-
535
- ADD since EDA v4.2
536
-
537
- ### getcurrentphysicalstackingconfiguration
538
-
539
- # PCB\_Layer.getCurrentPhysicalStackingConfiguration() method
540
-
541
- > 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.
542
-
543
- Get Current physical stacking configuration
544
-
545
- ## Signature
546
-
547
- ```typescript
548
- function getCurrentPhysicalStackingConfiguration(): Promise<
549
- IPCB_PhysicalStackingConfiguration | undefined
550
- >;
551
- ```
552
-
553
- ## Returns
554
-
555
- Promise&lt;[IPCB\_PhysicalStackingConfiguration](../interfaces/IPCB_PhysicalStackingConfiguration.md) \| undefined&gt;
556
-
557
- Current physical stacking configuration; `undefined` indicates that the retrieval failed
558
-
559
- ## Remarks
560
-
561
- ADD since EDA v4.2
562
-
563
- ### getcurrentphysicalstackingconfigurationname
564
-
565
- # PCB\_Layer.getCurrentPhysicalStackingConfigurationName() method
566
-
567
- > 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.
568
-
569
- Get Current physical stacking configuration name
570
-
571
- ## Signature
572
-
573
- ```typescript
574
- function getCurrentPhysicalStackingConfigurationName(): Promise<string | undefined>;
575
- ```
576
-
577
- ## Returns
578
-
579
- Promise&lt;string \| undefined&gt;
580
-
581
- Current physical stacking configuration name; `undefined` indicates that the retrieval failed
582
-
583
- ## Remarks
584
-
585
- ADD since EDA v4.2
586
-
587
- ### getdefaultphysicalstackingconfigurationname
588
-
589
- # PCB\_Layer.getDefaultPhysicalStackingConfigurationName() method
590
-
591
- > 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.
592
-
593
- Get the name of the default physical stacking configuration for new PCBs
594
-
595
- ## Signature
596
-
597
- ```typescript
598
- function getDefaultPhysicalStackingConfigurationName(
599
- physicalProps?: IPCB_SubstratePhysicalProperties,
600
- ): Promise<string | undefined>;
601
- ```
602
-
603
- ## Parameters
604
-
605
- <table><thead><tr><th>
606
-
607
- Parameter
608
-
609
- </th><th>
610
-
611
- Type
612
-
613
- </th><th>
614
-
615
- Description
616
-
617
- </th></tr></thead>
618
- <tbody><tr><td>
619
-
620
- physicalProps
621
-
622
- </td><td>
623
-
624
- [IPCB\_SubstratePhysicalProperties](../interfaces/IPCB_SubstratePhysicalProperties.md)
625
-
626
- </td><td>
627
-
628
- _(Optional)_ Physical properties. If not passed in, the current PCB properties are used by default
629
-
630
- </td></tr>
631
- </tbody></table>
632
-
633
- ## Returns
634
-
635
- Promise&lt;string \| undefined&gt;
636
-
637
- Default physical stacking configuration name of; `undefined` indicates that the retrieval failed
638
-
639
- ## Remarks
640
-
641
- ADD since EDA v4.2
642
-
643
- ### getphysicalstackingconfiguration
644
-
645
- # PCB\_Layer.getPhysicalStackingConfiguration() method
646
-
647
- > 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.
648
-
649
- Get Specify physical stacking configuration
650
-
651
- ## Signature
652
-
653
- ```typescript
654
- function getPhysicalStackingConfiguration(
655
- configurationName: string,
656
- physicalProps?: IPCB_SubstratePhysicalProperties,
657
- ): Promise<IPCB_PhysicalStackingConfiguration | undefined>;
658
- ```
659
-
660
- ## Parameters
661
-
662
- <table><thead><tr><th>
663
-
664
- Parameter
665
-
666
- </th><th>
667
-
668
- Type
669
-
670
- </th><th>
671
-
672
- Description
673
-
674
- </th></tr></thead>
675
- <tbody><tr><td>
676
-
677
- configurationName
678
-
679
- </td><td>
680
-
681
- string
682
-
683
- </td><td>
684
-
685
- Configuration name
686
-
687
- </td></tr>
688
- <tr><td>
689
-
690
- physicalProps
691
-
692
- </td><td>
693
-
694
- [IPCB\_SubstratePhysicalProperties](../interfaces/IPCB_SubstratePhysicalProperties.md)
695
-
696
- </td><td>
697
-
698
- _(Optional)_ Physical properties. If not passed in, the current PCB properties are used by default
699
-
700
- </td></tr>
701
- </tbody></table>
702
-
703
- ## Returns
704
-
705
- Promise&lt;[IPCB\_PhysicalStackingConfiguration](../interfaces/IPCB_PhysicalStackingConfiguration.md) \| undefined&gt;
706
-
707
- Physical stacking configuration, `undefined` is does not exist this physical stacking
708
-
709
- ## Remarks
710
-
711
- ADD since EDA v4.2
712
-
713
- ### locklayer
714
-
715
- # PCB\_Layer.lockLayer() method
716
-
717
- > 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.
718
-
719
- Lock the layer
720
-
721
- ## Signature
722
-
723
- ```typescript
724
- function lockLayer(
725
- layer?: TPCB_LayersInTheSelectable | Array<TPCB_LayersInTheSelectable>,
726
- ): Promise<boolean>;
727
- ```
728
-
729
- ## Parameters
730
-
731
- <table><thead><tr><th>
732
-
733
- Parameter
734
-
735
- </th><th>
736
-
737
- Type
738
-
739
- </th><th>
740
-
741
- Description
742
-
743
- </th></tr></thead>
744
- <tbody><tr><td>
745
-
746
- layer
747
-
748
- </td><td>
749
-
750
- [TPCB\_LayersInTheSelectable](../types/TPCB_LayersInTheSelectable.md) \| Array&lt;[TPCB\_LayersInTheSelectable](../types/TPCB_LayersInTheSelectable.md)<!-- -->&gt;
751
-
752
- </td><td>
753
-
754
- _(Optional)_ Layer. If no layer is specified, all layers are used by default
755
-
756
- </td></tr>
757
- </tbody></table>
758
-
759
- ## Returns
760
-
761
- Promise&lt;boolean&gt;
762
-
763
- Whether the operation is successful
764
-
765
- ## Example
766
-
767
- ```javascript
768
- // 1. 锁定顶层(TOP=1)与底层(BOTTOM=2),传入层数组
769
- const lockResult = await eda.pcb_Layer.lockLayer([1, 2]);
770
-
771
- // 2. 从图层列表确认锁定状态
772
- const layers = await eda.pcb_Layer.getAllLayers();
773
- const top = layers.find(l => l.id === 1);
774
-
775
- // 3. 恢复现场:解锁这两层,避免影响后续编辑
776
- const restoreResult = await eda.pcb_Layer.unlockLayer([1, 2]);
777
-
778
- console.log('lockResult:', lockResult);
779
- console.log('topLockedNow:', top?.locked);
780
- console.log('restoreResult:', restoreResult);
781
- ```
782
-
783
- ### modifylayer
784
-
785
- # PCB\_Layer.modifyLayer() method
786
-
787
- > 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.
788
-
789
- Modify Layer properties
790
-
791
- ## Signature
792
-
793
- ```typescript
794
- function modifyLayer(
795
- layer: TPCB_LayersInTheSelectable,
796
- property: {
797
- name?: undefined | string;
798
- type?: undefined | EPCB_LayerType.SIGNAL | EPCB_LayerType.INTERNAL_ELECTRICAL;
799
- color?: undefined | string;
800
- transparency?: undefined | number;
801
- },
802
- ): Promise<boolean>;
803
- ```
804
-
805
- ## Parameters
806
-
807
- <table><thead><tr><th>
808
-
809
- Parameter
810
-
811
- </th><th>
812
-
813
- Type
814
-
815
- </th><th>
816
-
817
- Description
818
-
819
- </th></tr></thead>
820
- <tbody><tr><td>
821
-
822
- layer
823
-
824
- </td><td>
825
-
826
- [TPCB\_LayersInTheSelectable](../types/TPCB_LayersInTheSelectable.md)
827
-
828
- </td><td>
829
-
830
- Layer
831
-
832
- </td></tr>
833
- <tr><td>
834
-
835
- property
836
-
837
- </td><td>
838
-
839
- { name?: undefined \| string; type?: undefined \| [EPCB\_LayerType.SIGNAL](../enums/EPCB_LayerType.md) \| [EPCB\_LayerType.INTERNAL\_ELECTRICAL](../enums/EPCB_LayerType.md)<!-- -->; color?: undefined \| string; transparency?: undefined \| number }
840
-
841
- </td><td>
842
-
843
- Property
844
-
845
- </td></tr>
846
- </tbody></table>
847
-
848
- ## Returns
849
-
850
- Promise&lt;boolean&gt;
851
-
852
- The modified layer properties. If it is `undefined`<!-- -->, the modification failed or the layer does not exist
853
-
854
- ## Remarks
855
-
856
- Only inner layers and custom layers can have their names modified; only inner layers can have their types modified. Transparency only supports values between 0-100
857
-
858
- ## Example
859
-
860
- ```javascript
861
- // 1. 新增一个自定义层作为修改对象
862
- const customLayerId = await eda.pcb_Layer.addCustomLayer();
863
-
864
- // 2. 读取修改前的名称与颜色
865
- const before = (await eda.pcb_Layer.getAllLayers()).find(l => l.id === customLayerId);
866
-
867
- // 3. 修改名称、颜色与透明度(保留现场供观察)
868
- const modifyResult = await eda.pcb_Layer.modifyLayer(customLayerId, {
869
- name: '嘉立创示例_工艺说明',
870
- color: '#FF6600',
871
- transparency: 30,
872
- });
873
-
874
- // 4. 重新读取图层列表确认修改生效
875
- const after = (await eda.pcb_Layer.getAllLayers()).find(l => l.id === customLayerId);
876
-
877
- console.log('modifyResult:', modifyResult);
878
- console.log('nameBefore:', before?.name, '→ nameAfter:', after?.name);
879
- console.log('colorBefore:', before?.color, '→ colorAfter:', after?.color);
880
- ```
881
-
882
- ### overwritecurrentphysicalstackingconfiguration
883
-
884
- # PCB\_Layer.overwriteCurrentPhysicalStackingConfiguration() method
885
-
886
- > 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.
887
-
888
- Overwrite current physical stacking configuration
889
-
890
- ## Signature
891
-
892
- ```typescript
893
- function overwriteCurrentPhysicalStackingConfiguration(
894
- physicalStackingConfiguration: IPCB_PhysicalStackingConfiguration,
895
- ): Promise<boolean>;
896
- ```
897
-
898
- ## Parameters
899
-
900
- <table><thead><tr><th>
901
-
902
- Parameter
903
-
904
- </th><th>
905
-
906
- Type
907
-
908
- </th><th>
909
-
910
- Description
911
-
912
- </th></tr></thead>
913
- <tbody><tr><td>
914
-
915
- physicalStackingConfiguration
916
-
917
- </td><td>
918
-
919
- [IPCB\_PhysicalStackingConfiguration](../interfaces/IPCB_PhysicalStackingConfiguration.md)
920
-
921
- </td><td>
922
-
923
- </td></tr>
924
- </tbody></table>
925
-
926
- ## Returns
927
-
928
- Promise&lt;boolean&gt;
929
-
930
- Overwrite whether it is successful
931
-
932
- ## Remarks
933
-
934
- It will overwrite the current physical stacking configuration of the PCB. Please note the risk of data loss
935
-
936
- If the passed-in physical stacking configuration does not match the physical properties of the current PCB, `false` will be returned directly without modification ADD since EDA v4.2
937
-
938
- ### removelayer
939
-
940
- # PCB\_Layer.removeLayer() method
941
-
942
- > 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.
943
-
944
- Remove Layer
945
-
946
- ## Signature
947
-
948
- ```typescript
949
- function removeLayer(layer: TPCB_LayersOfCustom): Promise<boolean>;
950
- ```
951
-
952
- ## Parameters
953
-
954
- <table><thead><tr><th>
955
-
956
- Parameter
957
-
958
- </th><th>
959
-
960
- Type
961
-
962
- </th><th>
963
-
964
- Description
965
-
966
- </th></tr></thead>
967
- <tbody><tr><td>
968
-
969
- layer
970
-
971
- </td><td>
972
-
973
- [TPCB\_LayersOfCustom](../types/TPCB_LayersOfCustom.md)
974
-
975
- </td><td>
976
-
977
- Layer
978
-
979
- </td></tr>
980
- </tbody></table>
981
-
982
- ## Returns
983
-
984
- Promise&lt;boolean&gt;
985
-
986
- Whether the operation is successful
987
-
988
- ## Remarks
989
-
990
- Currently only custom layers can be removed
991
-
992
- ## Example
993
-
994
- ```javascript
995
- // 1. 新增一个自定义层作为移除对象
996
- const customLayerId = await eda.pcb_Layer.addCustomLayer();
997
-
998
- // 2. 移除该自定义层,返回操作是否成功
999
- const removeResult = await eda.pcb_Layer.removeLayer(customLayerId);
1000
-
1001
- // 3. 确认该层已从图层列表消失
1002
- const rest = (await eda.pcb_Layer.getAllLayers()).filter(l => l.type === 'CUSTOM');
1003
-
1004
- console.log('removeResult:', removeResult);
1005
- console.log('removedLayerId:', customLayerId);
1006
- console.log('customLayerLeft:', rest.length);
1007
- ```
1008
-
1009
- ### renamephysicalstackingconfiguration
1010
-
1011
- # PCB\_Layer.renamePhysicalStackingConfiguration() method
1012
-
1013
- > 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.
1014
-
1015
- Rename the physical stacking configuration
1016
-
1017
- ## Signature
1018
-
1019
- ```typescript
1020
- function renamePhysicalStackingConfiguration(
1021
- originalConfigurationName: string,
1022
- configurationName: string,
1023
- physicalProps?: IPCB_SubstratePhysicalProperties,
1024
- ): Promise<boolean>;
1025
- ```
1026
-
1027
- ## Parameters
1028
-
1029
- <table><thead><tr><th>
1030
-
1031
- Parameter
1032
-
1033
- </th><th>
1034
-
1035
- Type
1036
-
1037
- </th><th>
1038
-
1039
- Description
1040
-
1041
- </th></tr></thead>
1042
- <tbody><tr><td>
1043
-
1044
- originalConfigurationName
1045
-
1046
- </td><td>
1047
-
1048
- string
1049
-
1050
- </td><td>
1051
-
1052
- Original physical stacking configuration name
1053
-
1054
- </td></tr>
1055
- <tr><td>
1056
-
1057
- configurationName
1058
-
1059
- </td><td>
1060
-
1061
- string
1062
-
1063
- </td><td>
1064
-
1065
- New physical stacking configuration name
1066
-
1067
- </td></tr>
1068
- <tr><td>
1069
-
1070
- physicalProps
1071
-
1072
- </td><td>
1073
-
1074
- [IPCB\_SubstratePhysicalProperties](../interfaces/IPCB_SubstratePhysicalProperties.md)
1075
-
1076
- </td><td>
1077
-
1078
- _(Optional)_ Physical properties. If not passed in, the current PCB properties are used by default
1079
-
1080
- </td></tr>
1081
- </tbody></table>
1082
-
1083
- ## Returns
1084
-
1085
- Promise&lt;boolean&gt;
1086
-
1087
- Whether the rename was successful
1088
-
1089
- ## Remarks
1090
-
1091
- ADD since EDA v4.2
1092
-
1093
- ### savephysicalstackingconfiguration
1094
-
1095
- # PCB\_Layer.savePhysicalStackingConfiguration() method
1096
-
1097
- > 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.
1098
-
1099
- Save Physical stacking configuration
1100
-
1101
- ## Signature
1102
-
1103
- ```typescript
1104
- function savePhysicalStackingConfiguration(
1105
- physicalStackingConfiguration: IPCB_PhysicalStackingConfiguration,
1106
- configurationName: string,
1107
- physicalProps?: IPCB_SubstratePhysicalProperties,
1108
- allowOverwrite?: boolean,
1109
- ): Promise<boolean>;
1110
- ```
1111
-
1112
- ## Parameters
1113
-
1114
- <table><thead><tr><th>
1115
-
1116
- Parameter
1117
-
1118
- </th><th>
1119
-
1120
- Type
1121
-
1122
- </th><th>
1123
-
1124
- Description
1125
-
1126
- </th></tr></thead>
1127
- <tbody><tr><td>
1128
-
1129
- physicalStackingConfiguration
1130
-
1131
- </td><td>
1132
-
1133
- [IPCB\_PhysicalStackingConfiguration](../interfaces/IPCB_PhysicalStackingConfiguration.md)
1134
-
1135
- </td><td>
1136
-
1137
- Physical stacking configuration
1138
-
1139
- </td></tr>
1140
- <tr><td>
1141
-
1142
- configurationName
1143
-
1144
- </td><td>
1145
-
1146
- string
1147
-
1148
- </td><td>
1149
-
1150
- Configuration name
1151
-
1152
- </td></tr>
1153
- <tr><td>
1154
-
1155
- physicalProps
1156
-
1157
- </td><td>
1158
-
1159
- [IPCB\_SubstratePhysicalProperties](../interfaces/IPCB_SubstratePhysicalProperties.md)
1160
-
1161
- </td><td>
1162
-
1163
- _(Optional)_ Physical properties. If not passed in, the current PCB properties are used by default
1164
-
1165
- </td></tr>
1166
- <tr><td>
1167
-
1168
- allowOverwrite
1169
-
1170
- </td><td>
1171
-
1172
- boolean
1173
-
1174
- </td><td>
1175
-
1176
- _(Optional)_ Whether to allow overwriting a physical stacking configuration with the same name. If `false`<!-- -->, `false` will be returned when a configuration with the same name is encountered. Please note the possible risk of data loss
1177
-
1178
- </td></tr>
1179
- </tbody></table>
1180
-
1181
- ## Returns
1182
-
1183
- Promise&lt;boolean&gt;
1184
-
1185
- Save Whether Successful
1186
-
1187
- ## Remarks
1188
-
1189
- ADD since EDA v4.2
1190
-
1191
- ### selectlayer
1192
-
1193
- # PCB\_Layer.selectLayer() method
1194
-
1195
- Select a layer
1196
-
1197
- ## Signature
1198
-
1199
- ```typescript
1200
- function selectLayer(layer: TPCB_LayersInTheSelectable): Promise<boolean>;
1201
- ```
1202
-
1203
- ## Parameters
1204
-
1205
- <table><thead><tr><th>
1206
-
1207
- Parameter
1208
-
1209
- </th><th>
1210
-
1211
- Type
1212
-
1213
- </th><th>
1214
-
1215
- Description
1216
-
1217
- </th></tr></thead>
1218
- <tbody><tr><td>
1219
-
1220
- layer
1221
-
1222
- </td><td>
1223
-
1224
- [TPCB\_LayersInTheSelectable](../types/TPCB_LayersInTheSelectable.md)
1225
-
1226
- </td><td>
1227
-
1228
- Layer
1229
-
1230
- </td></tr>
1231
- </tbody></table>
1232
-
1233
- ## Returns
1234
-
1235
- Promise&lt;boolean&gt;
1236
-
1237
- Whether the operation was successful. `false` is returned if the specified layer does not exist
1238
-
1239
- ## Example
1240
-
1241
- ```javascript
1242
- // 1. 切换当前工作层到底层(BOTTOM=2)
1243
- const selectResult = await eda.pcb_Layer.selectLayer(2);
1244
-
1245
- // 2. 再切回顶层(TOP=1),恢复常用工作层
1246
- const restoreResult = await eda.pcb_Layer.selectLayer(1);
1247
-
1248
- console.log('selectResult:', selectResult);
1249
- console.log('restoreResult:', restoreResult);
1250
- ```
1251
-
1252
- ### setasdefaultphysicalstackingconfiguration
1253
-
1254
- # PCB\_Layer.setAsDefaultPhysicalStackingConfiguration() method
1255
-
1256
- > 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.
1257
-
1258
- Set as the default physical stacking configuration for new PCBs
1259
-
1260
- ## Signature
1261
-
1262
- ```typescript
1263
- function setAsDefaultPhysicalStackingConfiguration(
1264
- configurationName: string,
1265
- physicalProps?: IPCB_SubstratePhysicalProperties,
1266
- ): Promise<boolean>;
1267
- ```
1268
-
1269
- ## Parameters
1270
-
1271
- <table><thead><tr><th>
1272
-
1273
- Parameter
1274
-
1275
- </th><th>
1276
-
1277
- Type
1278
-
1279
- </th><th>
1280
-
1281
- Description
1282
-
1283
- </th></tr></thead>
1284
- <tbody><tr><td>
1285
-
1286
- configurationName
1287
-
1288
- </td><td>
1289
-
1290
- string
1291
-
1292
- </td><td>
1293
-
1294
- Configuration name
1295
-
1296
- </td></tr>
1297
- <tr><td>
1298
-
1299
- physicalProps
1300
-
1301
- </td><td>
1302
-
1303
- [IPCB\_SubstratePhysicalProperties](../interfaces/IPCB_SubstratePhysicalProperties.md)
1304
-
1305
- </td><td>
1306
-
1307
- _(Optional)_ Physical properties. If not passed in, the current PCB properties are used by default
1308
-
1309
- </td></tr>
1310
- </tbody></table>
1311
-
1312
- ## Returns
1313
-
1314
- Promise&lt;boolean&gt;
1315
-
1316
- Set Whether Successful
1317
-
1318
- ## Remarks
1319
-
1320
- The return value is result-oriented. Repeatedly setting the same physical stacking as the default will also return `true` ADD since EDA v4.2
1321
-
1322
- ### setinactivelayerdisplaymode
1323
-
1324
- # PCB\_Layer.setInactiveLayerDisplayMode() method
1325
-
1326
- > 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.
1327
-
1328
- Set Inactive layer display mode
1329
-
1330
- ## Signature
1331
-
1332
- ```typescript
1333
- function setInactiveLayerDisplayMode(displayMode?: EPCB_InactiveLayerDisplayMode): Promise<boolean>;
1334
- ```
1335
-
1336
- ## Parameters
1337
-
1338
- <table><thead><tr><th>
1339
-
1340
- Parameter
1341
-
1342
- </th><th>
1343
-
1344
- Type
1345
-
1346
- </th><th>
1347
-
1348
- Description
1349
-
1350
- </th></tr></thead>
1351
- <tbody><tr><td>
1352
-
1353
- displayMode
1354
-
1355
- </td><td>
1356
-
1357
- [EPCB\_InactiveLayerDisplayMode](../enums/EPCB_InactiveLayerDisplayMode.md)
1358
-
1359
- </td><td>
1360
-
1361
- _(Optional)_ Display mode
1362
-
1363
- </td></tr>
1364
- </tbody></table>
1365
-
1366
- ## Returns
1367
-
1368
- Promise&lt;boolean&gt;
1369
-
1370
- Whether Set Successful
1371
-
1372
- ## Example
1373
-
1374
- ```javascript
1375
- // 1. 将非激活层设为置灰模式(TURN_GRAY=1)
1376
- const setResult = await eda.pcb_Layer.setInactiveLayerDisplayMode(1);
1377
-
1378
- // 2. 恢复为正常亮度(NORMAL_BRIGHTNESS=0),避免影响日常查看
1379
- const restoreResult = await eda.pcb_Layer.setInactiveLayerDisplayMode(0);
1380
-
1381
- console.log('setResult:', setResult);
1382
- console.log('restoreResult:', restoreResult);
1383
- ```
1384
-
1385
- ### setinactivelayertransparency
1386
-
1387
- # PCB\_Layer.setInactiveLayerTransparency() method
1388
-
1389
- > 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.
1390
-
1391
- Set the inactive layer transparency
1392
-
1393
- ## Signature
1394
-
1395
- ```typescript
1396
- function setInactiveLayerTransparency(transparency: number): Promise<boolean>;
1397
- ```
1398
-
1399
- ## Parameters
1400
-
1401
- <table><thead><tr><th>
1402
-
1403
- Parameter
1404
-
1405
- </th><th>
1406
-
1407
- Type
1408
-
1409
- </th><th>
1410
-
1411
- Description
1412
-
1413
- </th></tr></thead>
1414
- <tbody><tr><td>
1415
-
1416
- transparency
1417
-
1418
- </td><td>
1419
-
1420
- number
1421
-
1422
- </td><td>
1423
-
1424
- Transparency, range `0-100`
1425
-
1426
- </td></tr>
1427
- </tbody></table>
1428
-
1429
- ## Returns
1430
-
1431
- Promise&lt;boolean&gt;
1432
-
1433
- Whether the operation is successful
1434
-
1435
- ## Example
1436
-
1437
- ```javascript
1438
- // 1. 将非激活层透明度设为 60,让当前编辑层更突出
1439
- const setResult = await eda.pcb_Layer.setInactiveLayerTransparency(60);
1440
-
1441
- // 2. 恢复为 0(不透明),避免影响日常查看
1442
- const restoreResult = await eda.pcb_Layer.setInactiveLayerTransparency(0);
1443
-
1444
- console.log('setResult:', setResult);
1445
- console.log('restoreResult:', restoreResult);
1446
- ```
1447
-
1448
- ### setlayercolorconfiguration
1449
-
1450
- # PCB\_Layer.setLayerColorConfiguration() method
1451
-
1452
- > 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.
1453
-
1454
- Set the layer color configuration
1455
-
1456
- ## Signature
1457
-
1458
- ```typescript
1459
- function setLayerColorConfiguration(
1460
- colorConfiguration: EPCB_LayerColorConfiguration,
1461
- ): Promise<boolean>;
1462
- ```
1463
-
1464
- ## Parameters
1465
-
1466
- <table><thead><tr><th>
1467
-
1468
- Parameter
1469
-
1470
- </th><th>
1471
-
1472
- Type
1473
-
1474
- </th><th>
1475
-
1476
- Description
1477
-
1478
- </th></tr></thead>
1479
- <tbody><tr><td>
1480
-
1481
- colorConfiguration
1482
-
1483
- </td><td>
1484
-
1485
- [EPCB\_LayerColorConfiguration](../enums/EPCB_LayerColorConfiguration.md)
1486
-
1487
- </td><td>
1488
-
1489
- Color configuration
1490
-
1491
- </td></tr>
1492
- </tbody></table>
1493
-
1494
- ## Returns
1495
-
1496
- Promise&lt;boolean&gt;
1497
-
1498
- Whether the operation is successful
1499
-
1500
- ## Example
1501
-
1502
- ```javascript
1503
- // 1. 记录切换前顶层的颜色
1504
- const before = (await eda.pcb_Layer.getAllLayers()).find(l => l.id === 1);
1505
-
1506
- // 2. 切换为 Altium Designer 配色(ALTIUM_DESIGNER=2)
1507
- const setResult = await eda.pcb_Layer.setLayerColorConfiguration(2);
1508
-
1509
- // 3. 查看切换后顶层的颜色
1510
- const after = (await eda.pcb_Layer.getAllLayers()).find(l => l.id === 1);
1511
-
1512
- // 4. 恢复嘉立创 EDA 默认配色(EASYEDA=1)
1513
- const restoreResult = await eda.pcb_Layer.setLayerColorConfiguration(1);
1514
-
1515
- console.log('setResult:', setResult);
1516
- console.log('topColorBefore:', before?.color, '→ topColorAfter:', after?.color);
1517
- console.log('restoreResult:', restoreResult);
1518
- ```
1519
-
1520
- ### setlayerinvisible
1521
-
1522
- # PCB\_Layer.setLayerInvisible() method
1523
-
1524
- > 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.
1525
-
1526
- Set the layer to invisible
1527
-
1528
- ## Signature
1529
-
1530
- ```typescript
1531
- function setLayerInvisible(
1532
- layer?: TPCB_LayersInTheSelectable | Array<TPCB_LayersInTheSelectable>,
1533
- setOtherLayerVisible?: boolean,
1534
- ): Promise<boolean>;
1535
- ```
1536
-
1537
- ## Parameters
1538
-
1539
- <table><thead><tr><th>
1540
-
1541
- Parameter
1542
-
1543
- </th><th>
1544
-
1545
- Type
1546
-
1547
- </th><th>
1548
-
1549
- Description
1550
-
1551
- </th></tr></thead>
1552
- <tbody><tr><td>
1553
-
1554
- layer
1555
-
1556
- </td><td>
1557
-
1558
- [TPCB\_LayersInTheSelectable](../types/TPCB_LayersInTheSelectable.md) \| Array&lt;[TPCB\_LayersInTheSelectable](../types/TPCB_LayersInTheSelectable.md)<!-- -->&gt;
1559
-
1560
- </td><td>
1561
-
1562
- _(Optional)_ Layer. If no layer is specified, all layers are used by default
1563
-
1564
- </td></tr>
1565
- <tr><td>
1566
-
1567
- setOtherLayerVisible
1568
-
1569
- </td><td>
1570
-
1571
- boolean
1572
-
1573
- </td><td>
1574
-
1575
- _(Optional)_ Whether to set other layers to visible
1576
-
1577
- </td></tr>
1578
- </tbody></table>
1579
-
1580
- ## Returns
1581
-
1582
- Promise&lt;boolean&gt;
1583
-
1584
- Whether the operation is successful
1585
-
1586
- ## Example
1587
-
1588
- ```javascript
1589
- // 1. 隐藏底层丝印层(BOTTOM_SILKSCREEN=4)
1590
- const hideResult = await eda.pcb_Layer.setLayerInvisible(4);
1591
-
1592
- // 2. 从图层列表确认显隐状态(HIDDEN=2)
1593
- const layers = await eda.pcb_Layer.getAllLayers();
1594
- const silk = layers.find(l => l.id === 4);
1595
-
1596
- // 3. 恢复可见,避免影响后续查看
1597
- const restoreResult = await eda.pcb_Layer.setLayerVisible(4);
1598
-
1599
- console.log('hideResult:', hideResult);
1600
- console.log('silkLayerStatus:', silk?.layerStatus);
1601
- console.log('restoreResult:', restoreResult);
1602
- ```
1603
-
1604
- ### setlayervisible
1605
-
1606
- # PCB\_Layer.setLayerVisible() method
1607
-
1608
- > 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.
1609
-
1610
- Set the layer to visible
1611
-
1612
- ## Signature
1613
-
1614
- ```typescript
1615
- function setLayerVisible(
1616
- layer?: TPCB_LayersInTheSelectable | Array<TPCB_LayersInTheSelectable>,
1617
- setOtherLayerInvisible?: boolean,
1618
- ): Promise<boolean>;
1619
- ```
1620
-
1621
- ## Parameters
1622
-
1623
- <table><thead><tr><th>
1624
-
1625
- Parameter
1626
-
1627
- </th><th>
1628
-
1629
- Type
1630
-
1631
- </th><th>
1632
-
1633
- Description
1634
-
1635
- </th></tr></thead>
1636
- <tbody><tr><td>
1637
-
1638
- layer
1639
-
1640
- </td><td>
1641
-
1642
- [TPCB\_LayersInTheSelectable](../types/TPCB_LayersInTheSelectable.md) \| Array&lt;[TPCB\_LayersInTheSelectable](../types/TPCB_LayersInTheSelectable.md)<!-- -->&gt;
1643
-
1644
- </td><td>
1645
-
1646
- _(Optional)_ Layer. If no layer is specified, all layers are used by default
1647
-
1648
- </td></tr>
1649
- <tr><td>
1650
-
1651
- setOtherLayerInvisible
1652
-
1653
- </td><td>
1654
-
1655
- boolean
1656
-
1657
- </td><td>
1658
-
1659
- _(Optional)_ Whether to set other layers to invisible
1660
-
1661
- </td></tr>
1662
- </tbody></table>
1663
-
1664
- ## Returns
1665
-
1666
- Promise&lt;boolean&gt;
1667
-
1668
- Whether the operation is successful
1669
-
1670
- ## Example
1671
-
1672
- ```javascript
1673
- // 1. 先隐藏底层丝印层(BOTTOM_SILKSCREEN=4)制造初始状态
1674
- await eda.pcb_Layer.setLayerInvisible(4);
1675
-
1676
- // 2. 恢复底层丝印层可见
1677
- const showResult = await eda.pcb_Layer.setLayerVisible(4);
1678
-
1679
- // 3. 从图层列表确认显隐状态(SHOW=1)
1680
- const layers = await eda.pcb_Layer.getAllLayers();
1681
- const silk = layers.find(l => l.id === 4);
1682
-
1683
- console.log('showResult:', showResult);
1684
- console.log('silkLayerStatus:', silk?.layerStatus);
1685
- ```
1686
-
1687
- ### setpcbtype
1688
-
1689
- # PCB\_Layer.setPcbType() method
1690
-
1691
- > 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.
1692
-
1693
- Set PCB type
1694
-
1695
- ## Signature
1696
-
1697
- ```typescript
1698
- function setPcbType(pcbType: EPCB_PcbPlateType): Promise<boolean>;
1699
- ```
1700
-
1701
- ## Parameters
1702
-
1703
- <table><thead><tr><th>
1704
-
1705
- Parameter
1706
-
1707
- </th><th>
1708
-
1709
- Type
1710
-
1711
- </th><th>
1712
-
1713
- Description
1714
-
1715
- </th></tr></thead>
1716
- <tbody><tr><td>
1717
-
1718
- pcbType
1719
-
1720
- </td><td>
1721
-
1722
- [EPCB\_PcbPlateType](../enums/EPCB_PcbPlateType.md)
1723
-
1724
- </td><td>
1725
-
1726
- PCB type
1727
-
1728
- </td></tr>
1729
- </tbody></table>
1730
-
1731
- ## Returns
1732
-
1733
- Promise&lt;boolean&gt;
1734
-
1735
- Whether the operation is successful
1736
-
1737
- ## Remarks
1738
-
1739
- This is mainly to support FPC flexible board design. If the PCB type is set to FPC flexible board, an FPC stiffener layer will be added.
1740
-
1741
- Please note:
1742
-
1743
- 1. EasyEDA does not yet support FPC flexible board production with more than 2 copper layers;
1744
-
1745
- 2. When switching the PCB type from FPC flexible board to ordinary board, any primitives on the FPC stiffener layer must be deleted in advance; otherwise, the switch will fail and `false` will be returned.
1746
-
1747
- ## Example
1748
-
1749
- ```javascript
1750
- // 1. 记录切换前的图层总数
1751
- const before = await eda.pcb_Layer.getAllLayers();
1752
-
1753
- // 2. 切换为 FPC 软板(FPC=2),自动新增补强层
1754
- const fpcResult = await eda.pcb_Layer.setPcbType(2);
1755
-
1756
- // 3. 查看切换后的图层总数变化
1757
- const fpcLayers = await eda.pcb_Layer.getAllLayers();
1758
-
1759
- // 4. 切回普通板材(NORMAL=1),恢复原板材类型
1760
- const restoreResult = await eda.pcb_Layer.setPcbType(1);
1761
-
1762
- console.log('fpcResult:', fpcResult);
1763
- console.log('layerCountBefore:', before.length, '→ layerCountAfter:', fpcLayers.length);
1764
- console.log('restoreResult:', restoreResult);
1765
- ```
1766
-
1767
- ### setthenumberofcopperlayers
1768
-
1769
- # PCB\_Layer.setTheNumberOfCopperLayers() method
1770
-
1771
- > 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.
1772
-
1773
- Set Number of copper layers
1774
-
1775
- ## Signature
1776
-
1777
- ```typescript
1778
- function setTheNumberOfCopperLayers(numberOfLayers: TPCB_NumberOfCopperLayers): Promise<boolean>;
1779
- ```
1780
-
1781
- ## Parameters
1782
-
1783
- <table><thead><tr><th>
1784
-
1785
- Parameter
1786
-
1787
- </th><th>
1788
-
1789
- Type
1790
-
1791
- </th><th>
1792
-
1793
- Description
1794
-
1795
- </th></tr></thead>
1796
- <tbody><tr><td>
1797
-
1798
- numberOfLayers
1799
-
1800
- </td><td>
1801
-
1802
- [TPCB\_NumberOfCopperLayers](../types/TPCB_NumberOfCopperLayers.md)
1803
-
1804
- </td><td>
1805
-
1806
- Number of copper layers
1807
-
1808
- </td></tr>
1809
- </tbody></table>
1810
-
1811
- ## Returns
1812
-
1813
- Promise&lt;boolean&gt;
1814
-
1815
- Whether the operation is successful
1816
-
1817
- ## Remarks
1818
-
1819
- A newly created PCB document has two copper layers by default
1820
-
1821
- ## Example
1822
-
1823
- ```javascript
1824
- // 1. 记录调整前的信号层(铜箔层)数量
1825
- const before = (await eda.pcb_Layer.getAllLayers()).filter(l => l.type === 'SIGNAL').length;
1826
-
1827
- // 2. 将铜箔层数调整为 4 层,新增 INNER_1(15)、INNER_2(16)两个内层
1828
- const setResult = await eda.pcb_Layer.setTheNumberOfCopperLayers(4);
1829
-
1830
- // 3. 确认内层已加入图层列表
1831
- const afterLayers = await eda.pcb_Layer.getAllLayers();
1832
- const after = afterLayers.filter(l => l.type === 'SIGNAL').length;
1833
- const inner1 = afterLayers.find(l => l.id === 15);
1834
-
1835
- // 4. 恢复为 2 层板,移除空的内层(内层上有图元时无法减少层数)
1836
- const restoreResult = await eda.pcb_Layer.setTheNumberOfCopperLayers(2);
1837
-
1838
- console.log('setResult:', setResult);
1839
- console.log('copperCountBefore:', before, '→ copperCountAfter:', after);
1840
- console.log('inner1Name:', inner1?.name);
1841
- console.log('restoreResult:', restoreResult);
1842
- ```
1843
-
1844
- ### unlocklayer
1845
-
1846
- # PCB\_Layer.unlockLayer() method
1847
-
1848
- > 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.
1849
-
1850
- Unlock the layer
1851
-
1852
- ## Signature
1853
-
1854
- ```typescript
1855
- function unlockLayer(
1856
- layer?: TPCB_LayersInTheSelectable | Array<TPCB_LayersInTheSelectable>,
1857
- ): Promise<boolean>;
1858
- ```
1859
-
1860
- ## Parameters
1861
-
1862
- <table><thead><tr><th>
1863
-
1864
- Parameter
1865
-
1866
- </th><th>
1867
-
1868
- Type
1869
-
1870
- </th><th>
1871
-
1872
- Description
1873
-
1874
- </th></tr></thead>
1875
- <tbody><tr><td>
1876
-
1877
- layer
1878
-
1879
- </td><td>
1880
-
1881
- [TPCB\_LayersInTheSelectable](../types/TPCB_LayersInTheSelectable.md) \| Array&lt;[TPCB\_LayersInTheSelectable](../types/TPCB_LayersInTheSelectable.md)<!-- -->&gt;
1882
-
1883
- </td><td>
1884
-
1885
- _(Optional)_ Layer. If no layer is specified, all layers are used by default
1886
-
1887
- </td></tr>
1888
- </tbody></table>
1889
-
1890
- ## Returns
1891
-
1892
- Promise&lt;boolean&gt;
1893
-
1894
- Whether the operation is successful
1895
-
1896
- ## Example
1897
-
1898
- ```javascript
1899
- // 1. 先锁定顶层(TOP=1)制造初始状态
1900
- await eda.pcb_Layer.lockLayer(1);
1901
-
1902
- // 2. 解锁顶层,返回操作是否成功
1903
- const unlockResult = await eda.pcb_Layer.unlockLayer(1);
1904
-
1905
- // 3. 从图层列表确认锁定已解除
1906
- const layers = await eda.pcb_Layer.getAllLayers();
1907
- const top = layers.find(l => l.id === 1);
1908
-
1909
- console.log('unlockResult:', unlockResult);
1910
- console.log('topStillLocked:', top?.locked);
1911
- ```
1
+ # PCB\_Layer class
2
+
3
+ PCB &amp; footprint / layer operation class
4
+
5
+ ## Signature
6
+
7
+ ```typescript
8
+ class PCB_Layer
9
+ ```
10
+
11
+ ## Methods
12
+
13
+ <table><thead><tr><th>
14
+
15
+ Method
16
+
17
+ </th><th>
18
+
19
+ Modifiers
20
+
21
+ </th><th>
22
+
23
+ Description
24
+
25
+ </th></tr></thead>
26
+ <tbody><tr><td>
27
+
28
+ [addCustomLayer()](./PCB_Layer.md)
29
+
30
+ </td><td>
31
+
32
+ </td><td>
33
+
34
+ **_(BETA)_** Add a custom layer
35
+
36
+ </td></tr>
37
+ <tr><td>
38
+
39
+ [deletePhysicalStackingConfiguration(configurationName, physicalProps)](./PCB_Layer.md)
40
+
41
+ </td><td>
42
+
43
+ </td><td>
44
+
45
+ **_(BETA)_** Delete Physical stacking configuration
46
+
47
+ </td></tr>
48
+ <tr><td>
49
+
50
+ [getAllLayers()](./PCB_Layer.md)
51
+
52
+ </td><td>
53
+
54
+ </td><td>
55
+
56
+ **_(BETA)_** Get the detailed properties of all layers
57
+
58
+ </td></tr>
59
+ <tr><td>
60
+
61
+ [getAllPhysicalStackingConfigurations(physicalProps)](./PCB_Layer.md)
62
+
63
+ </td><td>
64
+
65
+ </td><td>
66
+
67
+ **_(BETA)_** Get all Physical stacking configuration
68
+
69
+ </td></tr>
70
+ <tr><td>
71
+
72
+ [getCurrentLayer()](./PCB_Layer.md)
73
+
74
+ </td><td>
75
+
76
+ </td><td>
77
+
78
+ **_(BETA)_** Get the detailed properties of the current layer
79
+
80
+ </td></tr>
81
+ <tr><td>
82
+
83
+ [getCurrentPhysicalStackingConfiguration()](./PCB_Layer.md)
84
+
85
+ </td><td>
86
+
87
+ </td><td>
88
+
89
+ **_(BETA)_** Get Current physical stacking configuration
90
+
91
+ </td></tr>
92
+ <tr><td>
93
+
94
+ [getCurrentPhysicalStackingConfigurationName()](./PCB_Layer.md)
95
+
96
+ </td><td>
97
+
98
+ </td><td>
99
+
100
+ **_(BETA)_** Get Current physical stacking configuration name
101
+
102
+ </td></tr>
103
+ <tr><td>
104
+
105
+ [getDefaultPhysicalStackingConfigurationName(physicalProps)](./PCB_Layer.md)
106
+
107
+ </td><td>
108
+
109
+ </td><td>
110
+
111
+ **_(BETA)_** Get the name of the default physical stacking configuration for new PCBs
112
+
113
+ </td></tr>
114
+ <tr><td>
115
+
116
+ [getPhysicalStackingConfiguration(configurationName, physicalProps)](./PCB_Layer.md)
117
+
118
+ </td><td>
119
+
120
+ </td><td>
121
+
122
+ **_(BETA)_** Get Specify physical stacking configuration
123
+
124
+ </td></tr>
125
+ <tr><td>
126
+
127
+ [lockLayer(layer)](./PCB_Layer.md)
128
+
129
+ </td><td>
130
+
131
+ </td><td>
132
+
133
+ **_(BETA)_** Lock the layer
134
+
135
+ </td></tr>
136
+ <tr><td>
137
+
138
+ [modifyLayer(layer, property)](./PCB_Layer.md)
139
+
140
+ </td><td>
141
+
142
+ </td><td>
143
+
144
+ **_(BETA)_** Modify Layer properties
145
+
146
+ </td></tr>
147
+ <tr><td>
148
+
149
+ [overwriteCurrentPhysicalStackingConfiguration(physicalStackingConfiguration)](./PCB_Layer.md)
150
+
151
+ </td><td>
152
+
153
+ </td><td>
154
+
155
+ **_(BETA)_** Overwrite current physical stacking configuration
156
+
157
+ </td></tr>
158
+ <tr><td>
159
+
160
+ [removeLayer(layer)](./PCB_Layer.md)
161
+
162
+ </td><td>
163
+
164
+ </td><td>
165
+
166
+ **_(BETA)_** Remove Layer
167
+
168
+ </td></tr>
169
+ <tr><td>
170
+
171
+ [renamePhysicalStackingConfiguration(originalConfigurationName, configurationName, physicalProps)](./PCB_Layer.md)
172
+
173
+ </td><td>
174
+
175
+ </td><td>
176
+
177
+ **_(BETA)_** Rename the physical stacking configuration
178
+
179
+ </td></tr>
180
+ <tr><td>
181
+
182
+ [savePhysicalStackingConfiguration(physicalStackingConfiguration, configurationName, physicalProps, allowOverwrite)](./PCB_Layer.md)
183
+
184
+ </td><td>
185
+
186
+ </td><td>
187
+
188
+ **_(BETA)_** Save Physical stacking configuration
189
+
190
+ </td></tr>
191
+ <tr><td>
192
+
193
+ [selectLayer(layer)](./PCB_Layer.md)
194
+
195
+ </td><td>
196
+
197
+ </td><td>
198
+
199
+ Select a layer
200
+
201
+ </td></tr>
202
+ <tr><td>
203
+
204
+ [setAsDefaultPhysicalStackingConfiguration(configurationName, physicalProps)](./PCB_Layer.md)
205
+
206
+ </td><td>
207
+
208
+ </td><td>
209
+
210
+ **_(BETA)_** Set as the default physical stacking configuration for new PCBs
211
+
212
+ </td></tr>
213
+ <tr><td>
214
+
215
+ [setInactiveLayerDisplayMode(displayMode)](./PCB_Layer.md)
216
+
217
+ </td><td>
218
+
219
+ </td><td>
220
+
221
+ **_(BETA)_** Set Inactive layer display mode
222
+
223
+ </td></tr>
224
+ <tr><td>
225
+
226
+ [setInactiveLayerTransparency(transparency)](./PCB_Layer.md)
227
+
228
+ </td><td>
229
+
230
+ </td><td>
231
+
232
+ **_(BETA)_** Set the inactive layer transparency
233
+
234
+ </td></tr>
235
+ <tr><td>
236
+
237
+ [setLayerColorConfiguration(colorConfiguration)](./PCB_Layer.md)
238
+
239
+ </td><td>
240
+
241
+ </td><td>
242
+
243
+ **_(BETA)_** Set the layer color configuration
244
+
245
+ </td></tr>
246
+ <tr><td>
247
+
248
+ [setLayerInvisible(layer, setOtherLayerVisible)](./PCB_Layer.md)
249
+
250
+ </td><td>
251
+
252
+ </td><td>
253
+
254
+ **_(BETA)_** Set the layer to invisible
255
+
256
+ </td></tr>
257
+ <tr><td>
258
+
259
+ [setLayerVisible(layer, setOtherLayerInvisible)](./PCB_Layer.md)
260
+
261
+ </td><td>
262
+
263
+ </td><td>
264
+
265
+ **_(BETA)_** Set the layer to visible
266
+
267
+ </td></tr>
268
+ <tr><td>
269
+
270
+ [setPcbType(pcbType)](./PCB_Layer.md)
271
+
272
+ </td><td>
273
+
274
+ </td><td>
275
+
276
+ **_(BETA)_** Set PCB type
277
+
278
+ </td></tr>
279
+ <tr><td>
280
+
281
+ [setTheNumberOfCopperLayers(numberOfLayers)](./PCB_Layer.md)
282
+
283
+ </td><td>
284
+
285
+ </td><td>
286
+
287
+ **_(BETA)_** Set Number of copper layers
288
+
289
+ </td></tr>
290
+ <tr><td>
291
+
292
+ [unlockLayer(layer)](./PCB_Layer.md)
293
+
294
+ </td><td>
295
+
296
+ </td><td>
297
+
298
+ **_(BETA)_** Unlock the layer
299
+
300
+ </td></tr>
301
+ </tbody></table>
302
+
303
+ ---
304
+
305
+ ## 方法详情
306
+
307
+ ### addcustomlayer
308
+
309
+ # PCB\_Layer.addCustomLayer() method
310
+
311
+ > 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.
312
+
313
+ Add a custom layer
314
+
315
+ ## Signature
316
+
317
+ ```typescript
318
+ function addCustomLayer(): Promise<TPCB_LayersOfCustom | undefined>;
319
+ ```
320
+
321
+ ## Returns
322
+
323
+ Promise&lt;[TPCB\_LayersOfCustom](../types/TPCB_LayersOfCustom.md) \| undefined&gt;
324
+
325
+ The layer ID of the newly added custom layer. If it is `undefined`<!-- -->, the addition failed, possibly because the number of custom layers has reached the upper limit
326
+
327
+ ## Example
328
+
329
+ ```javascript
330
+ // 1. 先移除历史运行遗留的自定义层,保证案例可以反复执行
331
+ const layers = await eda.pcb_Layer.getAllLayers();
332
+ for (const item of layers.filter(l => l.type === 'CUSTOM')) {
333
+ await eda.pcb_Layer.removeLayer(item.id);
334
+ }
335
+
336
+ // 2. 新增自定义层,返回新层的图层 ID(CUSTOM_1=71 起顺延分配)
337
+ const customLayerId = await eda.pcb_Layer.addCustomLayer();
338
+
339
+ // 3. 从图层列表确认新层已存在(保留现场,可在图层面板观察)
340
+ const after = await eda.pcb_Layer.getAllLayers();
341
+ const newLayer = after.find(l => l.id === customLayerId);
342
+
343
+ console.log('customLayerId:', customLayerId);
344
+ console.log('newLayerName:', newLayer?.name);
345
+ console.log('customLayerCount:', after.filter(l => l.type === 'CUSTOM').length);
346
+ ```
347
+
348
+ ### deletephysicalstackingconfiguration
349
+
350
+ # PCB\_Layer.deletePhysicalStackingConfiguration() method
351
+
352
+ > 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.
353
+
354
+ Delete Physical stacking configuration
355
+
356
+ ## Signature
357
+
358
+ ```typescript
359
+ function deletePhysicalStackingConfiguration(
360
+ configurationName: string,
361
+ physicalProps?: IPCB_SubstratePhysicalProperties,
362
+ ): Promise<boolean>;
363
+ ```
364
+
365
+ ## Parameters
366
+
367
+ <table><thead><tr><th>
368
+
369
+ Parameter
370
+
371
+ </th><th>
372
+
373
+ Type
374
+
375
+ </th><th>
376
+
377
+ Description
378
+
379
+ </th></tr></thead>
380
+ <tbody><tr><td>
381
+
382
+ configurationName
383
+
384
+ </td><td>
385
+
386
+ string
387
+
388
+ </td><td>
389
+
390
+ Configuration name
391
+
392
+ </td></tr>
393
+ <tr><td>
394
+
395
+ physicalProps
396
+
397
+ </td><td>
398
+
399
+ [IPCB\_SubstratePhysicalProperties](../interfaces/IPCB_SubstratePhysicalProperties.md)
400
+
401
+ </td><td>
402
+
403
+ _(Optional)_ 物理属性,如若不传入则默认为当前 PCB 属性
404
+
405
+ </td></tr>
406
+ </tbody></table>
407
+
408
+ ## Returns
409
+
410
+ Promise&lt;boolean&gt;
411
+
412
+ Delete Whether Successful
413
+
414
+ ## Remarks
415
+
416
+ ADD since EDA v4.2
417
+
418
+ ### getalllayers
419
+
420
+ # PCB\_Layer.getAllLayers() method
421
+
422
+ > 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.
423
+
424
+ Get the detailed properties of all layers
425
+
426
+ ## Signature
427
+
428
+ ```typescript
429
+ function getAllLayers(): Promise<Array<IPCB_LayerItem>>;
430
+ ```
431
+
432
+ ## Returns
433
+
434
+ Promise&lt;Array&lt;[IPCB\_LayerItem](../interfaces/IPCB_LayerItem.md)<!-- -->&gt;&gt;
435
+
436
+ Detailed properties of all layers
437
+
438
+ ## Remarks
439
+
440
+ 返回结果 \*\*包含停用的内层\*\*(如 16 铜层下可能返回 34 个 `SIGNAL`<!-- -->,其中多个 `layerStatus=0`<!-- -->); 筛选可用层的条件为 `type === 'SIGNAL' && layerStatus === 1`<!-- -->(或 `layerStatus !== EPCB_LayerStatus.NOT_USED`<!-- -->)
441
+
442
+ ## Example
443
+
444
+ ```javascript
445
+ // 1. 一次性取回当前 PCB 的全部图层
446
+ const layers = await eda.pcb_Layer.getAllLayers();
447
+
448
+ // 2. 查看顶层(TOP=1)的典型属性
449
+ const top = layers.find(l => l.id === 1);
450
+
451
+ // 3. 统计信号层(铜箔层)数量
452
+ const copperCount = layers.filter(l => l.type === 'SIGNAL').length;
453
+
454
+ console.log('totalCount:', layers.length);
455
+ console.log('topLayerName:', top?.name);
456
+ console.log('topLayerColor:', top?.color);
457
+ console.log('topLayerLocked:', top?.locked);
458
+ console.log('copperLayerCount:', copperCount);
459
+ ```
460
+
461
+ ### getallphysicalstackingconfigurations
462
+
463
+ # PCB\_Layer.getAllPhysicalStackingConfigurations() method
464
+
465
+ > 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.
466
+
467
+ Get all Physical stacking configuration
468
+
469
+ ## Signature
470
+
471
+ ```typescript
472
+ function getAllPhysicalStackingConfigurations(
473
+ physicalProps?: IPCB_SubstratePhysicalProperties,
474
+ ): Promise<Array<IPCB_PhysicalStackingConfiguration>>;
475
+ ```
476
+
477
+ ## Parameters
478
+
479
+ <table><thead><tr><th>
480
+
481
+ Parameter
482
+
483
+ </th><th>
484
+
485
+ Type
486
+
487
+ </th><th>
488
+
489
+ Description
490
+
491
+ </th></tr></thead>
492
+ <tbody><tr><td>
493
+
494
+ physicalProps
495
+
496
+ </td><td>
497
+
498
+ [IPCB\_SubstratePhysicalProperties](../interfaces/IPCB_SubstratePhysicalProperties.md)
499
+
500
+ </td><td>
501
+
502
+ _(Optional)_ 物理属性,如若不传入则默认为当前 PCB 属性
503
+
504
+ </td></tr>
505
+ </tbody></table>
506
+
507
+ ## Returns
508
+
509
+ Promise&lt;Array&lt;[IPCB\_PhysicalStackingConfiguration](../interfaces/IPCB_PhysicalStackingConfiguration.md)<!-- -->&gt;&gt;
510
+
511
+ All physical stacking configurations
512
+
513
+ ## Remarks
514
+
515
+ ADD since EDA v4.2
516
+
517
+ ### getcurrentlayer
518
+
519
+ # PCB\_Layer.getCurrentLayer() method
520
+
521
+ > 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.
522
+
523
+ Get the detailed properties of the current layer
524
+
525
+ ## Signature
526
+
527
+ ```typescript
528
+ function getCurrentLayer(): Promise<IPCB_LayerItem | undefined>;
529
+ ```
530
+
531
+ ## Returns
532
+
533
+ Promise&lt;[IPCB\_LayerItem](../interfaces/IPCB_LayerItem.md) \| undefined&gt;
534
+
535
+ Detailed properties of the current layer. `undefined` is returned when there is no active layer or no PCB canvas
536
+
537
+ ## Remarks
538
+
539
+ ADD since EDA v4.2
540
+
541
+ ### getcurrentphysicalstackingconfiguration
542
+
543
+ # PCB\_Layer.getCurrentPhysicalStackingConfiguration() method
544
+
545
+ > 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.
546
+
547
+ Get Current physical stacking configuration
548
+
549
+ ## Signature
550
+
551
+ ```typescript
552
+ function getCurrentPhysicalStackingConfiguration(): Promise<
553
+ IPCB_PhysicalStackingConfiguration | undefined
554
+ >;
555
+ ```
556
+
557
+ ## Returns
558
+
559
+ Promise&lt;[IPCB\_PhysicalStackingConfiguration](../interfaces/IPCB_PhysicalStackingConfiguration.md) \| undefined&gt;
560
+
561
+ Current physical stacking configuration; `undefined` indicates that the retrieval failed
562
+
563
+ ## Remarks
564
+
565
+ ADD since EDA v4.2
566
+
567
+ ### getcurrentphysicalstackingconfigurationname
568
+
569
+ # PCB\_Layer.getCurrentPhysicalStackingConfigurationName() method
570
+
571
+ > 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.
572
+
573
+ Get Current physical stacking configuration name
574
+
575
+ ## Signature
576
+
577
+ ```typescript
578
+ function getCurrentPhysicalStackingConfigurationName(): Promise<string | undefined>;
579
+ ```
580
+
581
+ ## Returns
582
+
583
+ Promise&lt;string \| undefined&gt;
584
+
585
+ Current physical stacking configuration name; `undefined` indicates that the retrieval failed
586
+
587
+ ## Remarks
588
+
589
+ ADD since EDA v4.2
590
+
591
+ ### getdefaultphysicalstackingconfigurationname
592
+
593
+ # PCB\_Layer.getDefaultPhysicalStackingConfigurationName() method
594
+
595
+ > 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.
596
+
597
+ Get the name of the default physical stacking configuration for new PCBs
598
+
599
+ ## Signature
600
+
601
+ ```typescript
602
+ function getDefaultPhysicalStackingConfigurationName(
603
+ physicalProps?: IPCB_SubstratePhysicalProperties,
604
+ ): Promise<string | undefined>;
605
+ ```
606
+
607
+ ## Parameters
608
+
609
+ <table><thead><tr><th>
610
+
611
+ Parameter
612
+
613
+ </th><th>
614
+
615
+ Type
616
+
617
+ </th><th>
618
+
619
+ Description
620
+
621
+ </th></tr></thead>
622
+ <tbody><tr><td>
623
+
624
+ physicalProps
625
+
626
+ </td><td>
627
+
628
+ [IPCB\_SubstratePhysicalProperties](../interfaces/IPCB_SubstratePhysicalProperties.md)
629
+
630
+ </td><td>
631
+
632
+ _(Optional)_ 物理属性,如若不传入则默认为当前 PCB 属性
633
+
634
+ </td></tr>
635
+ </tbody></table>
636
+
637
+ ## Returns
638
+
639
+ Promise&lt;string \| undefined&gt;
640
+
641
+ Default physical stacking configuration name of; `undefined` indicates that the retrieval failed
642
+
643
+ ## Remarks
644
+
645
+ ADD since EDA v4.2
646
+
647
+ ### getphysicalstackingconfiguration
648
+
649
+ # PCB\_Layer.getPhysicalStackingConfiguration() method
650
+
651
+ > 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.
652
+
653
+ Get Specify physical stacking configuration
654
+
655
+ ## Signature
656
+
657
+ ```typescript
658
+ function getPhysicalStackingConfiguration(
659
+ configurationName: string,
660
+ physicalProps?: IPCB_SubstratePhysicalProperties,
661
+ ): Promise<IPCB_PhysicalStackingConfiguration | undefined>;
662
+ ```
663
+
664
+ ## Parameters
665
+
666
+ <table><thead><tr><th>
667
+
668
+ Parameter
669
+
670
+ </th><th>
671
+
672
+ Type
673
+
674
+ </th><th>
675
+
676
+ Description
677
+
678
+ </th></tr></thead>
679
+ <tbody><tr><td>
680
+
681
+ configurationName
682
+
683
+ </td><td>
684
+
685
+ string
686
+
687
+ </td><td>
688
+
689
+ Configuration name
690
+
691
+ </td></tr>
692
+ <tr><td>
693
+
694
+ physicalProps
695
+
696
+ </td><td>
697
+
698
+ [IPCB\_SubstratePhysicalProperties](../interfaces/IPCB_SubstratePhysicalProperties.md)
699
+
700
+ </td><td>
701
+
702
+ _(Optional)_ 物理属性,如若不传入则默认为当前 PCB 属性
703
+
704
+ </td></tr>
705
+ </tbody></table>
706
+
707
+ ## Returns
708
+
709
+ Promise&lt;[IPCB\_PhysicalStackingConfiguration](../interfaces/IPCB_PhysicalStackingConfiguration.md) \| undefined&gt;
710
+
711
+ Physical stacking configuration, `undefined` is does not exist this physical stacking
712
+
713
+ ## Remarks
714
+
715
+ ADD since EDA v4.2
716
+
717
+ ### locklayer
718
+
719
+ # PCB\_Layer.lockLayer() method
720
+
721
+ > 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.
722
+
723
+ Lock the layer
724
+
725
+ ## Signature
726
+
727
+ ```typescript
728
+ function lockLayer(
729
+ layer?: TPCB_LayersInTheSelectable | Array<TPCB_LayersInTheSelectable>,
730
+ ): Promise<boolean>;
731
+ ```
732
+
733
+ ## Parameters
734
+
735
+ <table><thead><tr><th>
736
+
737
+ Parameter
738
+
739
+ </th><th>
740
+
741
+ Type
742
+
743
+ </th><th>
744
+
745
+ Description
746
+
747
+ </th></tr></thead>
748
+ <tbody><tr><td>
749
+
750
+ layer
751
+
752
+ </td><td>
753
+
754
+ [TPCB\_LayersInTheSelectable](../types/TPCB_LayersInTheSelectable.md) \| Array&lt;[TPCB\_LayersInTheSelectable](../types/TPCB_LayersInTheSelectable.md)<!-- -->&gt;
755
+
756
+ </td><td>
757
+
758
+ _(Optional)_ Layer. If no layer is specified, all layers are used by default
759
+
760
+ </td></tr>
761
+ </tbody></table>
762
+
763
+ ## Returns
764
+
765
+ Promise&lt;boolean&gt;
766
+
767
+ Whether the operation is successful
768
+
769
+ ## Example
770
+
771
+ ```javascript
772
+ // 1. 锁定顶层(TOP=1)与底层(BOTTOM=2),传入层数组
773
+ const lockResult = await eda.pcb_Layer.lockLayer([1, 2]);
774
+
775
+ // 2. 从图层列表确认锁定状态
776
+ const layers = await eda.pcb_Layer.getAllLayers();
777
+ const top = layers.find(l => l.id === 1);
778
+
779
+ // 3. 恢复现场:解锁这两层,避免影响后续编辑
780
+ const restoreResult = await eda.pcb_Layer.unlockLayer([1, 2]);
781
+
782
+ console.log('lockResult:', lockResult);
783
+ console.log('topLockedNow:', top?.locked);
784
+ console.log('restoreResult:', restoreResult);
785
+ ```
786
+
787
+ ### modifylayer
788
+
789
+ # PCB\_Layer.modifyLayer() method
790
+
791
+ > 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.
792
+
793
+ Modify Layer properties
794
+
795
+ ## Signature
796
+
797
+ ```typescript
798
+ function modifyLayer(
799
+ layer: TPCB_LayersInTheSelectable,
800
+ property: {
801
+ name?: string;
802
+ type?: TPCB_LayerTypesOfInnerLayer;
803
+ color?: string;
804
+ transparency?: number;
805
+ },
806
+ ): Promise<boolean>;
807
+ ```
808
+
809
+ ## Parameters
810
+
811
+ <table><thead><tr><th>
812
+
813
+ Parameter
814
+
815
+ </th><th>
816
+
817
+ Type
818
+
819
+ </th><th>
820
+
821
+ Description
822
+
823
+ </th></tr></thead>
824
+ <tbody><tr><td>
825
+
826
+ layer
827
+
828
+ </td><td>
829
+
830
+ [TPCB\_LayersInTheSelectable](../types/TPCB_LayersInTheSelectable.md)
831
+
832
+ </td><td>
833
+
834
+ Layer
835
+
836
+ </td></tr>
837
+ <tr><td>
838
+
839
+ property
840
+
841
+ </td><td>
842
+
843
+ { name?: string; type?: [TPCB\_LayerTypesOfInnerLayer](../types/TPCB_LayerTypesOfInnerLayer.md)<!-- -->; color?: string; transparency?: number }
844
+
845
+ </td><td>
846
+
847
+ Property
848
+
849
+ </td></tr>
850
+ </tbody></table>
851
+
852
+ ## Returns
853
+
854
+ Promise&lt;boolean&gt;
855
+
856
+ The modified layer properties. If it is `undefined`<!-- -->, the modification failed or the layer does not exist
857
+
858
+ ## Remarks
859
+
860
+ Only inner layers and custom layers can have their names modified; only inner layers can have their types modified. Transparency only supports values between 0-100
861
+
862
+ ## Example
863
+
864
+ ```javascript
865
+ // 1. 新增一个自定义层作为修改对象
866
+ const customLayerId = await eda.pcb_Layer.addCustomLayer();
867
+
868
+ // 2. 读取修改前的名称与颜色
869
+ const before = (await eda.pcb_Layer.getAllLayers()).find(l => l.id === customLayerId);
870
+
871
+ // 3. 修改名称、颜色与透明度(保留现场供观察)
872
+ const modifyResult = await eda.pcb_Layer.modifyLayer(customLayerId, {
873
+ name: '嘉立创示例_工艺说明',
874
+ color: '#FF6600',
875
+ transparency: 30,
876
+ });
877
+
878
+ // 4. 重新读取图层列表确认修改生效
879
+ const after = (await eda.pcb_Layer.getAllLayers()).find(l => l.id === customLayerId);
880
+
881
+ console.log('modifyResult:', modifyResult);
882
+ console.log('nameBefore:', before?.name, '→ nameAfter:', after?.name);
883
+ console.log('colorBefore:', before?.color, '→ colorAfter:', after?.color);
884
+ ```
885
+
886
+ ### overwritecurrentphysicalstackingconfiguration
887
+
888
+ # PCB\_Layer.overwriteCurrentPhysicalStackingConfiguration() method
889
+
890
+ > 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.
891
+
892
+ Overwrite current physical stacking configuration
893
+
894
+ ## Signature
895
+
896
+ ```typescript
897
+ function overwriteCurrentPhysicalStackingConfiguration(
898
+ physicalStackingConfiguration: IPCB_PhysicalStackingConfiguration,
899
+ ): Promise<boolean>;
900
+ ```
901
+
902
+ ## Parameters
903
+
904
+ <table><thead><tr><th>
905
+
906
+ Parameter
907
+
908
+ </th><th>
909
+
910
+ Type
911
+
912
+ </th><th>
913
+
914
+ Description
915
+
916
+ </th></tr></thead>
917
+ <tbody><tr><td>
918
+
919
+ physicalStackingConfiguration
920
+
921
+ </td><td>
922
+
923
+ [IPCB\_PhysicalStackingConfiguration](../interfaces/IPCB_PhysicalStackingConfiguration.md)
924
+
925
+ </td><td>
926
+
927
+ </td></tr>
928
+ </tbody></table>
929
+
930
+ ## Returns
931
+
932
+ Promise&lt;boolean&gt;
933
+
934
+ Overwrite whether it is successful
935
+
936
+ ## Remarks
937
+
938
+ It will overwrite the current physical stacking configuration of the PCB. Please note the risk of data loss
939
+
940
+ 如果传入的物理叠层配置不符合当前 PCB 的物理属性,将会直接返回 `false` 且不进行修改 ADD since EDA v4.2
941
+
942
+ ### removelayer
943
+
944
+ # PCB\_Layer.removeLayer() method
945
+
946
+ > 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.
947
+
948
+ Remove Layer
949
+
950
+ ## Signature
951
+
952
+ ```typescript
953
+ function removeLayer(layer: TPCB_LayersOfCustom): Promise<boolean>;
954
+ ```
955
+
956
+ ## Parameters
957
+
958
+ <table><thead><tr><th>
959
+
960
+ Parameter
961
+
962
+ </th><th>
963
+
964
+ Type
965
+
966
+ </th><th>
967
+
968
+ Description
969
+
970
+ </th></tr></thead>
971
+ <tbody><tr><td>
972
+
973
+ layer
974
+
975
+ </td><td>
976
+
977
+ [TPCB\_LayersOfCustom](../types/TPCB_LayersOfCustom.md)
978
+
979
+ </td><td>
980
+
981
+ Layer
982
+
983
+ </td></tr>
984
+ </tbody></table>
985
+
986
+ ## Returns
987
+
988
+ Promise&lt;boolean&gt;
989
+
990
+ Whether the operation is successful
991
+
992
+ ## Remarks
993
+
994
+ Currently only custom layers can be removed
995
+
996
+ ## Example
997
+
998
+ ```javascript
999
+ // 1. 新增一个自定义层作为移除对象
1000
+ const customLayerId = await eda.pcb_Layer.addCustomLayer();
1001
+
1002
+ // 2. 移除该自定义层,返回操作是否成功
1003
+ const removeResult = await eda.pcb_Layer.removeLayer(customLayerId);
1004
+
1005
+ // 3. 确认该层已从图层列表消失
1006
+ const rest = (await eda.pcb_Layer.getAllLayers()).filter(l => l.type === 'CUSTOM');
1007
+
1008
+ console.log('removeResult:', removeResult);
1009
+ console.log('removedLayerId:', customLayerId);
1010
+ console.log('customLayerLeft:', rest.length);
1011
+ ```
1012
+
1013
+ ### renamephysicalstackingconfiguration
1014
+
1015
+ # PCB\_Layer.renamePhysicalStackingConfiguration() method
1016
+
1017
+ > 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.
1018
+
1019
+ Rename the physical stacking configuration
1020
+
1021
+ ## Signature
1022
+
1023
+ ```typescript
1024
+ function renamePhysicalStackingConfiguration(
1025
+ originalConfigurationName: string,
1026
+ configurationName: string,
1027
+ physicalProps?: IPCB_SubstratePhysicalProperties,
1028
+ ): Promise<boolean>;
1029
+ ```
1030
+
1031
+ ## Parameters
1032
+
1033
+ <table><thead><tr><th>
1034
+
1035
+ Parameter
1036
+
1037
+ </th><th>
1038
+
1039
+ Type
1040
+
1041
+ </th><th>
1042
+
1043
+ Description
1044
+
1045
+ </th></tr></thead>
1046
+ <tbody><tr><td>
1047
+
1048
+ originalConfigurationName
1049
+
1050
+ </td><td>
1051
+
1052
+ string
1053
+
1054
+ </td><td>
1055
+
1056
+ Original physical stacking configuration name
1057
+
1058
+ </td></tr>
1059
+ <tr><td>
1060
+
1061
+ configurationName
1062
+
1063
+ </td><td>
1064
+
1065
+ string
1066
+
1067
+ </td><td>
1068
+
1069
+ New physical stacking configuration name
1070
+
1071
+ </td></tr>
1072
+ <tr><td>
1073
+
1074
+ physicalProps
1075
+
1076
+ </td><td>
1077
+
1078
+ [IPCB\_SubstratePhysicalProperties](../interfaces/IPCB_SubstratePhysicalProperties.md)
1079
+
1080
+ </td><td>
1081
+
1082
+ _(Optional)_ 物理属性,如若不传入则默认为当前 PCB 属性
1083
+
1084
+ </td></tr>
1085
+ </tbody></table>
1086
+
1087
+ ## Returns
1088
+
1089
+ Promise&lt;boolean&gt;
1090
+
1091
+ Whether the rename was successful
1092
+
1093
+ ## Remarks
1094
+
1095
+ ADD since EDA v4.2
1096
+
1097
+ ### savephysicalstackingconfiguration
1098
+
1099
+ # PCB\_Layer.savePhysicalStackingConfiguration() method
1100
+
1101
+ > 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.
1102
+
1103
+ Save Physical stacking configuration
1104
+
1105
+ ## Signature
1106
+
1107
+ ```typescript
1108
+ function savePhysicalStackingConfiguration(
1109
+ physicalStackingConfiguration: IPCB_PhysicalStackingConfiguration,
1110
+ configurationName: string,
1111
+ physicalProps?: IPCB_SubstratePhysicalProperties,
1112
+ allowOverwrite?: boolean,
1113
+ ): Promise<boolean>;
1114
+ ```
1115
+
1116
+ ## Parameters
1117
+
1118
+ <table><thead><tr><th>
1119
+
1120
+ Parameter
1121
+
1122
+ </th><th>
1123
+
1124
+ Type
1125
+
1126
+ </th><th>
1127
+
1128
+ Description
1129
+
1130
+ </th></tr></thead>
1131
+ <tbody><tr><td>
1132
+
1133
+ physicalStackingConfiguration
1134
+
1135
+ </td><td>
1136
+
1137
+ [IPCB\_PhysicalStackingConfiguration](../interfaces/IPCB_PhysicalStackingConfiguration.md)
1138
+
1139
+ </td><td>
1140
+
1141
+ Physical stacking configuration
1142
+
1143
+ </td></tr>
1144
+ <tr><td>
1145
+
1146
+ configurationName
1147
+
1148
+ </td><td>
1149
+
1150
+ string
1151
+
1152
+ </td><td>
1153
+
1154
+ Configuration name
1155
+
1156
+ </td></tr>
1157
+ <tr><td>
1158
+
1159
+ physicalProps
1160
+
1161
+ </td><td>
1162
+
1163
+ [IPCB\_SubstratePhysicalProperties](../interfaces/IPCB_SubstratePhysicalProperties.md)
1164
+
1165
+ </td><td>
1166
+
1167
+ _(Optional)_ 物理属性,如若不传入则默认为当前 PCB 属性
1168
+
1169
+ </td></tr>
1170
+ <tr><td>
1171
+
1172
+ allowOverwrite
1173
+
1174
+ </td><td>
1175
+
1176
+ boolean
1177
+
1178
+ </td><td>
1179
+
1180
+ _(Optional)_ Whether to allow overwriting a physical stacking configuration with the same name. If `false`<!-- -->, `false` will be returned when a configuration with the same name is encountered. Please note the possible risk of data loss
1181
+
1182
+ </td></tr>
1183
+ </tbody></table>
1184
+
1185
+ ## Returns
1186
+
1187
+ Promise&lt;boolean&gt;
1188
+
1189
+ Save Whether Successful
1190
+
1191
+ ## Remarks
1192
+
1193
+ ADD since EDA v4.2
1194
+
1195
+ ### selectlayer
1196
+
1197
+ # PCB\_Layer.selectLayer() method
1198
+
1199
+ Select a layer
1200
+
1201
+ ## Signature
1202
+
1203
+ ```typescript
1204
+ function selectLayer(layer: TPCB_LayersInTheSelectable): Promise<boolean>;
1205
+ ```
1206
+
1207
+ ## Parameters
1208
+
1209
+ <table><thead><tr><th>
1210
+
1211
+ Parameter
1212
+
1213
+ </th><th>
1214
+
1215
+ Type
1216
+
1217
+ </th><th>
1218
+
1219
+ Description
1220
+
1221
+ </th></tr></thead>
1222
+ <tbody><tr><td>
1223
+
1224
+ layer
1225
+
1226
+ </td><td>
1227
+
1228
+ [TPCB\_LayersInTheSelectable](../types/TPCB_LayersInTheSelectable.md)
1229
+
1230
+ </td><td>
1231
+
1232
+ Layer
1233
+
1234
+ </td></tr>
1235
+ </tbody></table>
1236
+
1237
+ ## Returns
1238
+
1239
+ Promise&lt;boolean&gt;
1240
+
1241
+ Whether the operation was successful. `false` is returned if the specified layer does not exist
1242
+
1243
+ ## Example
1244
+
1245
+ ```javascript
1246
+ // 1. 切换当前工作层到底层(BOTTOM=2)
1247
+ const selectResult = await eda.pcb_Layer.selectLayer(2);
1248
+
1249
+ // 2. 再切回顶层(TOP=1),恢复常用工作层
1250
+ const restoreResult = await eda.pcb_Layer.selectLayer(1);
1251
+
1252
+ console.log('selectResult:', selectResult);
1253
+ console.log('restoreResult:', restoreResult);
1254
+ ```
1255
+
1256
+ ### setasdefaultphysicalstackingconfiguration
1257
+
1258
+ # PCB\_Layer.setAsDefaultPhysicalStackingConfiguration() method
1259
+
1260
+ > 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.
1261
+
1262
+ Set as the default physical stacking configuration for new PCBs
1263
+
1264
+ ## Signature
1265
+
1266
+ ```typescript
1267
+ function setAsDefaultPhysicalStackingConfiguration(
1268
+ configurationName: string,
1269
+ physicalProps?: IPCB_SubstratePhysicalProperties,
1270
+ ): Promise<boolean>;
1271
+ ```
1272
+
1273
+ ## Parameters
1274
+
1275
+ <table><thead><tr><th>
1276
+
1277
+ Parameter
1278
+
1279
+ </th><th>
1280
+
1281
+ Type
1282
+
1283
+ </th><th>
1284
+
1285
+ Description
1286
+
1287
+ </th></tr></thead>
1288
+ <tbody><tr><td>
1289
+
1290
+ configurationName
1291
+
1292
+ </td><td>
1293
+
1294
+ string
1295
+
1296
+ </td><td>
1297
+
1298
+ Configuration name
1299
+
1300
+ </td></tr>
1301
+ <tr><td>
1302
+
1303
+ physicalProps
1304
+
1305
+ </td><td>
1306
+
1307
+ [IPCB\_SubstratePhysicalProperties](../interfaces/IPCB_SubstratePhysicalProperties.md)
1308
+
1309
+ </td><td>
1310
+
1311
+ _(Optional)_ 物理属性,如若不传入则默认为当前 PCB 属性
1312
+
1313
+ </td></tr>
1314
+ </tbody></table>
1315
+
1316
+ ## Returns
1317
+
1318
+ Promise&lt;boolean&gt;
1319
+
1320
+ Set Whether Successful
1321
+
1322
+ ## Remarks
1323
+
1324
+ The return value is result-oriented. Repeatedly setting the same physical stacking as the default will also return `true` ADD since EDA v4.2
1325
+
1326
+ ### setinactivelayerdisplaymode
1327
+
1328
+ # PCB\_Layer.setInactiveLayerDisplayMode() method
1329
+
1330
+ > 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.
1331
+
1332
+ Set Inactive layer display mode
1333
+
1334
+ ## Signature
1335
+
1336
+ ```typescript
1337
+ function setInactiveLayerDisplayMode(displayMode?: EPCB_InactiveLayerDisplayMode): Promise<boolean>;
1338
+ ```
1339
+
1340
+ ## Parameters
1341
+
1342
+ <table><thead><tr><th>
1343
+
1344
+ Parameter
1345
+
1346
+ </th><th>
1347
+
1348
+ Type
1349
+
1350
+ </th><th>
1351
+
1352
+ Description
1353
+
1354
+ </th></tr></thead>
1355
+ <tbody><tr><td>
1356
+
1357
+ displayMode
1358
+
1359
+ </td><td>
1360
+
1361
+ [EPCB\_InactiveLayerDisplayMode](../enums/EPCB_InactiveLayerDisplayMode.md)
1362
+
1363
+ </td><td>
1364
+
1365
+ _(Optional)_ Display mode
1366
+
1367
+ </td></tr>
1368
+ </tbody></table>
1369
+
1370
+ ## Returns
1371
+
1372
+ Promise&lt;boolean&gt;
1373
+
1374
+ Whether Set Successful
1375
+
1376
+ ## Example
1377
+
1378
+ ```javascript
1379
+ // 1. 将非激活层设为置灰模式(TURN_GRAY=1)
1380
+ const setResult = await eda.pcb_Layer.setInactiveLayerDisplayMode(1);
1381
+
1382
+ // 2. 恢复为正常亮度(NORMAL_BRIGHTNESS=0),避免影响日常查看
1383
+ const restoreResult = await eda.pcb_Layer.setInactiveLayerDisplayMode(0);
1384
+
1385
+ console.log('setResult:', setResult);
1386
+ console.log('restoreResult:', restoreResult);
1387
+ ```
1388
+
1389
+ ### setinactivelayertransparency
1390
+
1391
+ # PCB\_Layer.setInactiveLayerTransparency() method
1392
+
1393
+ > 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.
1394
+
1395
+ Set the inactive layer transparency
1396
+
1397
+ ## Signature
1398
+
1399
+ ```typescript
1400
+ function setInactiveLayerTransparency(transparency: number): Promise<boolean>;
1401
+ ```
1402
+
1403
+ ## Parameters
1404
+
1405
+ <table><thead><tr><th>
1406
+
1407
+ Parameter
1408
+
1409
+ </th><th>
1410
+
1411
+ Type
1412
+
1413
+ </th><th>
1414
+
1415
+ Description
1416
+
1417
+ </th></tr></thead>
1418
+ <tbody><tr><td>
1419
+
1420
+ transparency
1421
+
1422
+ </td><td>
1423
+
1424
+ number
1425
+
1426
+ </td><td>
1427
+
1428
+ Transparency, range `0-100`
1429
+
1430
+ </td></tr>
1431
+ </tbody></table>
1432
+
1433
+ ## Returns
1434
+
1435
+ Promise&lt;boolean&gt;
1436
+
1437
+ Whether the operation is successful
1438
+
1439
+ ## Example
1440
+
1441
+ ```javascript
1442
+ // 1. 将非激活层透明度设为 60,让当前编辑层更突出
1443
+ const setResult = await eda.pcb_Layer.setInactiveLayerTransparency(60);
1444
+
1445
+ // 2. 恢复为 0(不透明),避免影响日常查看
1446
+ const restoreResult = await eda.pcb_Layer.setInactiveLayerTransparency(0);
1447
+
1448
+ console.log('setResult:', setResult);
1449
+ console.log('restoreResult:', restoreResult);
1450
+ ```
1451
+
1452
+ ### setlayercolorconfiguration
1453
+
1454
+ # PCB\_Layer.setLayerColorConfiguration() method
1455
+
1456
+ > 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.
1457
+
1458
+ Set the layer color configuration
1459
+
1460
+ ## Signature
1461
+
1462
+ ```typescript
1463
+ function setLayerColorConfiguration(
1464
+ colorConfiguration: EPCB_LayerColorConfiguration,
1465
+ ): Promise<boolean>;
1466
+ ```
1467
+
1468
+ ## Parameters
1469
+
1470
+ <table><thead><tr><th>
1471
+
1472
+ Parameter
1473
+
1474
+ </th><th>
1475
+
1476
+ Type
1477
+
1478
+ </th><th>
1479
+
1480
+ Description
1481
+
1482
+ </th></tr></thead>
1483
+ <tbody><tr><td>
1484
+
1485
+ colorConfiguration
1486
+
1487
+ </td><td>
1488
+
1489
+ [EPCB\_LayerColorConfiguration](../enums/EPCB_LayerColorConfiguration.md)
1490
+
1491
+ </td><td>
1492
+
1493
+ Color configuration
1494
+
1495
+ </td></tr>
1496
+ </tbody></table>
1497
+
1498
+ ## Returns
1499
+
1500
+ Promise&lt;boolean&gt;
1501
+
1502
+ Whether the operation is successful
1503
+
1504
+ ## Example
1505
+
1506
+ ```javascript
1507
+ // 1. 记录切换前顶层的颜色
1508
+ const before = (await eda.pcb_Layer.getAllLayers()).find(l => l.id === 1);
1509
+
1510
+ // 2. 切换为 Altium Designer 配色(ALTIUM_DESIGNER=2)
1511
+ const setResult = await eda.pcb_Layer.setLayerColorConfiguration(2);
1512
+
1513
+ // 3. 查看切换后顶层的颜色
1514
+ const after = (await eda.pcb_Layer.getAllLayers()).find(l => l.id === 1);
1515
+
1516
+ // 4. 恢复嘉立创 EDA 默认配色(EASYEDA=1)
1517
+ const restoreResult = await eda.pcb_Layer.setLayerColorConfiguration(1);
1518
+
1519
+ console.log('setResult:', setResult);
1520
+ console.log('topColorBefore:', before?.color, '→ topColorAfter:', after?.color);
1521
+ console.log('restoreResult:', restoreResult);
1522
+ ```
1523
+
1524
+ ### setlayerinvisible
1525
+
1526
+ # PCB\_Layer.setLayerInvisible() method
1527
+
1528
+ > 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.
1529
+
1530
+ Set the layer to invisible
1531
+
1532
+ ## Signature
1533
+
1534
+ ```typescript
1535
+ function setLayerInvisible(
1536
+ layer?: TPCB_LayersInTheSelectable | Array<TPCB_LayersInTheSelectable>,
1537
+ setOtherLayerVisible?: boolean,
1538
+ ): Promise<boolean>;
1539
+ ```
1540
+
1541
+ ## Parameters
1542
+
1543
+ <table><thead><tr><th>
1544
+
1545
+ Parameter
1546
+
1547
+ </th><th>
1548
+
1549
+ Type
1550
+
1551
+ </th><th>
1552
+
1553
+ Description
1554
+
1555
+ </th></tr></thead>
1556
+ <tbody><tr><td>
1557
+
1558
+ layer
1559
+
1560
+ </td><td>
1561
+
1562
+ [TPCB\_LayersInTheSelectable](../types/TPCB_LayersInTheSelectable.md) \| Array&lt;[TPCB\_LayersInTheSelectable](../types/TPCB_LayersInTheSelectable.md)<!-- -->&gt;
1563
+
1564
+ </td><td>
1565
+
1566
+ _(Optional)_ Layer. If no layer is specified, all layers are used by default
1567
+
1568
+ </td></tr>
1569
+ <tr><td>
1570
+
1571
+ setOtherLayerVisible
1572
+
1573
+ </td><td>
1574
+
1575
+ boolean
1576
+
1577
+ </td><td>
1578
+
1579
+ _(Optional)_ Whether to set other layers to visible
1580
+
1581
+ </td></tr>
1582
+ </tbody></table>
1583
+
1584
+ ## Returns
1585
+
1586
+ Promise&lt;boolean&gt;
1587
+
1588
+ Whether the operation is successful
1589
+
1590
+ ## Example
1591
+
1592
+ ```javascript
1593
+ // 1. 隐藏底层丝印层(BOTTOM_SILKSCREEN=4)
1594
+ const hideResult = await eda.pcb_Layer.setLayerInvisible(4);
1595
+
1596
+ // 2. 从图层列表确认显隐状态(HIDDEN=2)
1597
+ const layers = await eda.pcb_Layer.getAllLayers();
1598
+ const silk = layers.find(l => l.id === 4);
1599
+
1600
+ // 3. 恢复可见,避免影响后续查看
1601
+ const restoreResult = await eda.pcb_Layer.setLayerVisible(4);
1602
+
1603
+ console.log('hideResult:', hideResult);
1604
+ console.log('silkLayerStatus:', silk?.layerStatus);
1605
+ console.log('restoreResult:', restoreResult);
1606
+ ```
1607
+
1608
+ ### setlayervisible
1609
+
1610
+ # PCB\_Layer.setLayerVisible() method
1611
+
1612
+ > 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.
1613
+
1614
+ Set the layer to visible
1615
+
1616
+ ## Signature
1617
+
1618
+ ```typescript
1619
+ function setLayerVisible(
1620
+ layer?: TPCB_LayersInTheSelectable | Array<TPCB_LayersInTheSelectable>,
1621
+ setOtherLayerInvisible?: boolean,
1622
+ ): Promise<boolean>;
1623
+ ```
1624
+
1625
+ ## Parameters
1626
+
1627
+ <table><thead><tr><th>
1628
+
1629
+ Parameter
1630
+
1631
+ </th><th>
1632
+
1633
+ Type
1634
+
1635
+ </th><th>
1636
+
1637
+ Description
1638
+
1639
+ </th></tr></thead>
1640
+ <tbody><tr><td>
1641
+
1642
+ layer
1643
+
1644
+ </td><td>
1645
+
1646
+ [TPCB\_LayersInTheSelectable](../types/TPCB_LayersInTheSelectable.md) \| Array&lt;[TPCB\_LayersInTheSelectable](../types/TPCB_LayersInTheSelectable.md)<!-- -->&gt;
1647
+
1648
+ </td><td>
1649
+
1650
+ _(Optional)_ Layer. If no layer is specified, all layers are used by default
1651
+
1652
+ </td></tr>
1653
+ <tr><td>
1654
+
1655
+ setOtherLayerInvisible
1656
+
1657
+ </td><td>
1658
+
1659
+ boolean
1660
+
1661
+ </td><td>
1662
+
1663
+ _(Optional)_ Whether to set other layers to invisible
1664
+
1665
+ </td></tr>
1666
+ </tbody></table>
1667
+
1668
+ ## Returns
1669
+
1670
+ Promise&lt;boolean&gt;
1671
+
1672
+ Whether the operation is successful
1673
+
1674
+ ## Example
1675
+
1676
+ ```javascript
1677
+ // 1. 先隐藏底层丝印层(BOTTOM_SILKSCREEN=4)制造初始状态
1678
+ await eda.pcb_Layer.setLayerInvisible(4);
1679
+
1680
+ // 2. 恢复底层丝印层可见
1681
+ const showResult = await eda.pcb_Layer.setLayerVisible(4);
1682
+
1683
+ // 3. 从图层列表确认显隐状态(SHOW=1)
1684
+ const layers = await eda.pcb_Layer.getAllLayers();
1685
+ const silk = layers.find(l => l.id === 4);
1686
+
1687
+ console.log('showResult:', showResult);
1688
+ console.log('silkLayerStatus:', silk?.layerStatus);
1689
+ ```
1690
+
1691
+ ### setpcbtype
1692
+
1693
+ # PCB\_Layer.setPcbType() method
1694
+
1695
+ > 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.
1696
+
1697
+ Set PCB type
1698
+
1699
+ ## Signature
1700
+
1701
+ ```typescript
1702
+ function setPcbType(pcbType: EPCB_PcbPlateType): Promise<boolean>;
1703
+ ```
1704
+
1705
+ ## Parameters
1706
+
1707
+ <table><thead><tr><th>
1708
+
1709
+ Parameter
1710
+
1711
+ </th><th>
1712
+
1713
+ Type
1714
+
1715
+ </th><th>
1716
+
1717
+ Description
1718
+
1719
+ </th></tr></thead>
1720
+ <tbody><tr><td>
1721
+
1722
+ pcbType
1723
+
1724
+ </td><td>
1725
+
1726
+ [EPCB\_PcbPlateType](../enums/EPCB_PcbPlateType.md)
1727
+
1728
+ </td><td>
1729
+
1730
+ PCB type
1731
+
1732
+ </td></tr>
1733
+ </tbody></table>
1734
+
1735
+ ## Returns
1736
+
1737
+ Promise&lt;boolean&gt;
1738
+
1739
+ Whether the operation is successful
1740
+
1741
+ ## Remarks
1742
+
1743
+ This is mainly to support FPC flexible board design. If the PCB type is set to FPC flexible board, an FPC stiffener layer will be added.
1744
+
1745
+ Please note:
1746
+
1747
+ 1. EasyEDA does not yet support FPC flexible board production with more than 2 copper layers;
1748
+
1749
+ 2. When switching the PCB type from FPC flexible board to ordinary board, any primitives on the FPC stiffener layer must be deleted in advance; otherwise, the switch will fail and `false` will be returned.
1750
+
1751
+ ## Example
1752
+
1753
+ ```javascript
1754
+ // 1. 记录切换前的图层总数
1755
+ const before = await eda.pcb_Layer.getAllLayers();
1756
+
1757
+ // 2. 切换为 FPC 软板(FPC=2),自动新增补强层
1758
+ const fpcResult = await eda.pcb_Layer.setPcbType(2);
1759
+
1760
+ // 3. 查看切换后的图层总数变化
1761
+ const fpcLayers = await eda.pcb_Layer.getAllLayers();
1762
+
1763
+ // 4. 切回普通板材(NORMAL=1),恢复原板材类型
1764
+ const restoreResult = await eda.pcb_Layer.setPcbType(1);
1765
+
1766
+ console.log('fpcResult:', fpcResult);
1767
+ console.log('layerCountBefore:', before.length, '→ layerCountAfter:', fpcLayers.length);
1768
+ console.log('restoreResult:', restoreResult);
1769
+ ```
1770
+
1771
+ ### setthenumberofcopperlayers
1772
+
1773
+ # PCB\_Layer.setTheNumberOfCopperLayers() method
1774
+
1775
+ > 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.
1776
+
1777
+ Set Number of copper layers
1778
+
1779
+ ## Signature
1780
+
1781
+ ```typescript
1782
+ function setTheNumberOfCopperLayers(numberOfLayers: TPCB_NumberOfCopperLayers): Promise<boolean>;
1783
+ ```
1784
+
1785
+ ## Parameters
1786
+
1787
+ <table><thead><tr><th>
1788
+
1789
+ Parameter
1790
+
1791
+ </th><th>
1792
+
1793
+ Type
1794
+
1795
+ </th><th>
1796
+
1797
+ Description
1798
+
1799
+ </th></tr></thead>
1800
+ <tbody><tr><td>
1801
+
1802
+ numberOfLayers
1803
+
1804
+ </td><td>
1805
+
1806
+ [TPCB\_NumberOfCopperLayers](../types/TPCB_NumberOfCopperLayers.md)
1807
+
1808
+ </td><td>
1809
+
1810
+ Number of copper layers
1811
+
1812
+ </td></tr>
1813
+ </tbody></table>
1814
+
1815
+ ## Returns
1816
+
1817
+ Promise&lt;boolean&gt;
1818
+
1819
+ Whether the operation is successful
1820
+
1821
+ ## Remarks
1822
+
1823
+ A newly created PCB document has two copper layers by default
1824
+
1825
+ ## Example
1826
+
1827
+ ```javascript
1828
+ // 1. 记录调整前的信号层(铜箔层)数量
1829
+ const before = (await eda.pcb_Layer.getAllLayers()).filter(l => l.type === 'SIGNAL').length;
1830
+
1831
+ // 2. 将铜箔层数调整为 4 层,新增 INNER_1(15)、INNER_2(16)两个内层
1832
+ const setResult = await eda.pcb_Layer.setTheNumberOfCopperLayers(4);
1833
+
1834
+ // 3. 确认内层已加入图层列表
1835
+ const afterLayers = await eda.pcb_Layer.getAllLayers();
1836
+ const after = afterLayers.filter(l => l.type === 'SIGNAL').length;
1837
+ const inner1 = afterLayers.find(l => l.id === 15);
1838
+
1839
+ // 4. 恢复为 2 层板,移除空的内层(内层上有图元时无法减少层数)
1840
+ const restoreResult = await eda.pcb_Layer.setTheNumberOfCopperLayers(2);
1841
+
1842
+ console.log('setResult:', setResult);
1843
+ console.log('copperCountBefore:', before, '→ copperCountAfter:', after);
1844
+ console.log('inner1Name:', inner1?.name);
1845
+ console.log('restoreResult:', restoreResult);
1846
+ ```
1847
+
1848
+ ### unlocklayer
1849
+
1850
+ # PCB\_Layer.unlockLayer() method
1851
+
1852
+ > 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.
1853
+
1854
+ Unlock the layer
1855
+
1856
+ ## Signature
1857
+
1858
+ ```typescript
1859
+ function unlockLayer(
1860
+ layer?: TPCB_LayersInTheSelectable | Array<TPCB_LayersInTheSelectable>,
1861
+ ): Promise<boolean>;
1862
+ ```
1863
+
1864
+ ## Parameters
1865
+
1866
+ <table><thead><tr><th>
1867
+
1868
+ Parameter
1869
+
1870
+ </th><th>
1871
+
1872
+ Type
1873
+
1874
+ </th><th>
1875
+
1876
+ Description
1877
+
1878
+ </th></tr></thead>
1879
+ <tbody><tr><td>
1880
+
1881
+ layer
1882
+
1883
+ </td><td>
1884
+
1885
+ [TPCB\_LayersInTheSelectable](../types/TPCB_LayersInTheSelectable.md) \| Array&lt;[TPCB\_LayersInTheSelectable](../types/TPCB_LayersInTheSelectable.md)<!-- -->&gt;
1886
+
1887
+ </td><td>
1888
+
1889
+ _(Optional)_ Layer. If no layer is specified, all layers are used by default
1890
+
1891
+ </td></tr>
1892
+ </tbody></table>
1893
+
1894
+ ## Returns
1895
+
1896
+ Promise&lt;boolean&gt;
1897
+
1898
+ Whether the operation is successful
1899
+
1900
+ ## Example
1901
+
1902
+ ```javascript
1903
+ // 1. 先锁定顶层(TOP=1)制造初始状态
1904
+ await eda.pcb_Layer.lockLayer(1);
1905
+
1906
+ // 2. 解锁顶层,返回操作是否成功
1907
+ const unlockResult = await eda.pcb_Layer.unlockLayer(1);
1908
+
1909
+ // 3. 从图层列表确认锁定已解除
1910
+ const layers = await eda.pcb_Layer.getAllLayers();
1911
+ const top = layers.find(l => l.id === 1);
1912
+
1913
+ console.log('unlockResult:', unlockResult);
1914
+ console.log('topStillLocked:', top?.locked);
1915
+ ```