@windypro-rourou/dsh-eda 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (484) hide show
  1. package/README.md +1 -1
  2. package/lib/backend.js +49 -0
  3. package/lib/capabilities.js +6 -2
  4. package/lib/client.js +33 -0
  5. package/lib/index.js +197 -3
  6. package/package.json +10 -1
  7. package/skill/INDEX.md +10 -8
  8. package/skill/README.md +125 -0
  9. package/skill/README.zh-Hans.md +125 -0
  10. package/skill/SKILL.md +746 -746
  11. package/skill/format/index.md +152 -152
  12. package/skill/format/pcb/3d.md +166 -166
  13. package/skill/format/pcb/attr.md +63 -63
  14. package/skill/format/pcb/common.md +306 -306
  15. package/skill/format/pcb/component.md +132 -132
  16. package/skill/format/pcb/dimension.md +58 -58
  17. package/skill/format/pcb/index.md +17 -17
  18. package/skill/format/pcb/obj.md +43 -43
  19. package/skill/format/pcb/pad_via.md +151 -151
  20. package/skill/format/pcb/panel.md +64 -64
  21. package/skill/format/pcb/partition.md +43 -43
  22. package/skill/format/pcb/primitive.md +196 -196
  23. package/skill/format/pcb/rule.md +71 -71
  24. package/skill/format/pcb/shape.md +441 -441
  25. package/skill/format/pcb/text.md +62 -62
  26. package/skill/format/project/blob.md +30 -30
  27. package/skill/format/project/common.md +42 -42
  28. package/skill/format/project/group.md +62 -62
  29. package/skill/format/project/index.md +12 -12
  30. package/skill/format/project/instance.md +32 -32
  31. package/skill/format/project/meta.md +189 -189
  32. package/skill/format/project/variant.md +30 -30
  33. package/skill/format/schematic/attr.md +41 -41
  34. package/skill/format/schematic/common.md +47 -47
  35. package/skill/format/schematic/component.md +91 -91
  36. package/skill/format/schematic/index.md +14 -14
  37. package/skill/format/schematic/obj.md +41 -41
  38. package/skill/format/schematic/pin.md +59 -59
  39. package/skill/format/schematic/shape.md +231 -231
  40. package/skill/format/schematic/structure.md +53 -53
  41. package/skill/format/schematic/table.md +109 -109
  42. package/skill/format/schematic/text.md +47 -47
  43. package/skill/format/schematic/wire.md +132 -132
  44. package/skill/guide/ancillary-projects/easyeda-api-sdk.md +1 -0
  45. package/skill/guide/ancillary-projects/pro-api-types.md +5 -5
  46. package/skill/guide/ancillary-projects.md +10 -10
  47. package/skill/guide/cli.md +1510 -0
  48. package/skill/guide/error-handling.md +38 -38
  49. package/skill/guide/extension-json.md +135 -135
  50. package/skill/guide/extensions-marketplace.md +61 -61
  51. package/skill/guide/how-to-start.md +316 -301
  52. package/skill/guide/i18n.md +57 -57
  53. package/skill/guide/index.md +7 -7
  54. package/skill/guide/inline-frame.md +20 -20
  55. package/skill/guide/invoke-apis.md +81 -81
  56. package/skill/guide/stability.md +37 -37
  57. package/skill/references/_index.md +471 -398
  58. package/skill/references/_quick-reference.md +3103 -3028
  59. package/skill/references/classes/DMT_Board.md +537 -533
  60. package/skill/references/classes/DMT_EditorControl.md +1736 -1736
  61. package/skill/references/classes/DMT_Event.md +356 -356
  62. package/skill/references/classes/DMT_Folder.md +775 -775
  63. package/skill/references/classes/DMT_Panel.md +531 -531
  64. package/skill/references/classes/DMT_Pcb.md +579 -575
  65. package/skill/references/classes/DMT_Project.md +734 -573
  66. package/skill/references/classes/DMT_Schematic.md +1482 -1477
  67. package/skill/references/classes/DMT_SelectControl.md +96 -96
  68. package/skill/references/classes/DMT_Team.md +172 -172
  69. package/skill/references/classes/DMT_Workspace.md +198 -198
  70. package/skill/references/classes/EDA.md +1001 -961
  71. package/skill/references/classes/IPCB_ComplexPolygon.md +299 -299
  72. package/skill/references/classes/IPCB_Polygon.md +175 -175
  73. package/skill/references/classes/IPCB_PrimitiveArc.md +1901 -1901
  74. package/skill/references/classes/IPCB_PrimitiveAttribute.md +2993 -2993
  75. package/skill/references/classes/IPCB_PrimitiveComponent.md +2624 -2627
  76. package/skill/references/classes/IPCB_PrimitiveComponentPad.md +410 -410
  77. package/skill/references/classes/IPCB_PrimitiveDimension.md +1419 -1419
  78. package/skill/references/classes/IPCB_PrimitiveFill.md +1325 -1325
  79. package/skill/references/classes/IPCB_PrimitiveImage.md +1461 -1461
  80. package/skill/references/classes/IPCB_PrimitiveLine.md +1639 -1639
  81. package/skill/references/classes/IPCB_PrimitiveObject.md +1700 -1700
  82. package/skill/references/classes/IPCB_PrimitivePad.md +3155 -3155
  83. package/skill/references/classes/IPCB_PrimitivePolyline.md +1193 -1193
  84. package/skill/references/classes/IPCB_PrimitivePour.md +1858 -1858
  85. package/skill/references/classes/IPCB_PrimitivePoured.md +556 -556
  86. package/skill/references/classes/IPCB_PrimitiveRegion.md +1332 -1332
  87. package/skill/references/classes/IPCB_PrimitiveString.md +2315 -2315
  88. package/skill/references/classes/IPCB_PrimitiveVia.md +1588 -1588
  89. package/skill/references/classes/ISCH_PrimitiveArc.md +1676 -1676
  90. package/skill/references/classes/ISCH_PrimitiveAttribute.md +2541 -2541
  91. package/skill/references/classes/ISCH_PrimitiveBus.md +973 -973
  92. package/skill/references/classes/ISCH_PrimitiveCbbSymbolComponent.md +260 -260
  93. package/skill/references/classes/ISCH_PrimitiveCircle.md +1392 -1392
  94. package/skill/references/classes/ISCH_PrimitiveComponent.md +2910 -2913
  95. package/skill/references/classes/ISCH_PrimitiveComponentPin.md +155 -155
  96. package/skill/references/classes/ISCH_PrimitiveObject.md +960 -960
  97. package/skill/references/classes/ISCH_PrimitivePin.md +2402 -2402
  98. package/skill/references/classes/ISCH_PrimitivePolygon.md +1028 -1028
  99. package/skill/references/classes/ISCH_PrimitiveRectangle.md +1777 -1777
  100. package/skill/references/classes/ISCH_PrimitiveText.md +1771 -1771
  101. package/skill/references/classes/ISCH_PrimitiveWire.md +973 -973
  102. package/skill/references/classes/LIB_3DModel.md +782 -780
  103. package/skill/references/classes/LIB_Cbb.md +957 -957
  104. package/skill/references/classes/LIB_Classification.md +969 -965
  105. package/skill/references/classes/LIB_Device.md +1222 -1221
  106. package/skill/references/classes/LIB_Footprint.md +1298 -1153
  107. package/skill/references/classes/LIB_LibrariesList.md +361 -329
  108. package/skill/references/classes/LIB_PanelLibrary.md +855 -855
  109. package/skill/references/classes/LIB_SelectControl.md +89 -89
  110. package/skill/references/classes/LIB_SimulationModel.md +807 -821
  111. package/skill/references/classes/LIB_Symbol.md +1341 -1195
  112. package/skill/references/classes/PCB_Document.md +1770 -1754
  113. package/skill/references/classes/PCB_Drc.md +3379 -3375
  114. package/skill/references/classes/PCB_Event.md +1166 -1081
  115. package/skill/references/classes/PCB_ImageTool.md +363 -0
  116. package/skill/references/classes/PCB_Layer.md +1915 -1911
  117. package/skill/references/classes/PCB_ManufactureData.md +2968 -2968
  118. package/skill/references/classes/PCB_MathPolygon.md +916 -785
  119. package/skill/references/classes/PCB_Net.md +1128 -1128
  120. package/skill/references/classes/PCB_Primitive.md +217 -217
  121. package/skill/references/classes/PCB_PrimitiveArc.md +820 -894
  122. package/skill/references/classes/PCB_PrimitiveAttribute.md +635 -717
  123. package/skill/references/classes/PCB_PrimitiveComponent.md +1050 -1050
  124. package/skill/references/classes/PCB_PrimitiveDimension.md +789 -833
  125. package/skill/references/classes/PCB_PrimitiveFill.md +783 -861
  126. package/skill/references/classes/PCB_PrimitiveImage.md +803 -875
  127. package/skill/references/classes/PCB_PrimitiveLine.md +787 -858
  128. package/skill/references/classes/PCB_PrimitiveObject.md +796 -800
  129. package/skill/references/classes/PCB_PrimitivePad.md +947 -944
  130. package/skill/references/classes/PCB_PrimitivePolyline.md +744 -819
  131. package/skill/references/classes/PCB_PrimitivePour.md +808 -845
  132. package/skill/references/classes/PCB_PrimitivePoured.md +363 -363
  133. package/skill/references/classes/PCB_PrimitiveRegion.md +765 -799
  134. package/skill/references/classes/PCB_PrimitiveString.md +828 -910
  135. package/skill/references/classes/PCB_PrimitiveVia.md +761 -765
  136. package/skill/references/classes/PCB_RayTracerEngine.md +603 -263
  137. package/skill/references/classes/PCB_SelectControl.md +495 -495
  138. package/skill/references/classes/PCB_Tool.md +9 -0
  139. package/skill/references/classes/PNL_Document.md +83 -83
  140. package/skill/references/classes/SCH_Document.md +797 -809
  141. package/skill/references/classes/SCH_Drc.md +246 -242
  142. package/skill/references/classes/SCH_Event.md +583 -583
  143. package/skill/references/classes/SCH_ManufactureData.md +1209 -1205
  144. package/skill/references/classes/SCH_Net.md +200 -200
  145. package/skill/references/classes/SCH_Netlist.md +191 -191
  146. package/skill/references/classes/SCH_Primitive.md +337 -337
  147. package/skill/references/classes/SCH_PrimitiveArc.md +686 -692
  148. package/skill/references/classes/SCH_PrimitiveAttribute.md +579 -590
  149. package/skill/references/classes/SCH_PrimitiveBus.md +618 -624
  150. package/skill/references/classes/SCH_PrimitiveCircle.md +667 -683
  151. package/skill/references/classes/SCH_PrimitiveComponent.md +2256 -2240
  152. package/skill/references/classes/SCH_PrimitiveObject.md +666 -666
  153. package/skill/references/classes/SCH_PrimitivePin.md +737 -754
  154. package/skill/references/classes/SCH_PrimitivePolygon.md +621 -627
  155. package/skill/references/classes/SCH_PrimitiveRectangle.md +715 -731
  156. package/skill/references/classes/SCH_PrimitiveText.md +736 -746
  157. package/skill/references/classes/SCH_PrimitiveWire.md +701 -703
  158. package/skill/references/classes/SCH_SelectControl.md +520 -520
  159. package/skill/references/classes/SCH_SimulationEngine.md +133 -133
  160. package/skill/references/classes/SCH_Utils.md +121 -121
  161. package/skill/references/classes/SYS_ClientUrl.md +173 -173
  162. package/skill/references/classes/SYS_Dialog.md +825 -825
  163. package/skill/references/classes/SYS_Environment.md +640 -502
  164. package/skill/references/classes/SYS_ExternalApi.md +246 -0
  165. package/skill/references/classes/SYS_FileManager.md +1664 -1686
  166. package/skill/references/classes/SYS_FileSystem.md +1366 -1171
  167. package/skill/references/classes/SYS_FontManager.md +224 -224
  168. package/skill/references/classes/SYS_FormatConversion.md +349 -349
  169. package/skill/references/classes/SYS_HeaderMenu.md +480 -479
  170. package/skill/references/classes/SYS_Help.md +141 -0
  171. package/skill/references/classes/SYS_I18n.md +861 -861
  172. package/skill/references/classes/SYS_IFrame.md +541 -535
  173. package/skill/references/classes/SYS_LoadingAndProgressBar.md +246 -246
  174. package/skill/references/classes/SYS_Log.md +422 -424
  175. package/skill/references/classes/SYS_Math.md +1565 -1565
  176. package/skill/references/classes/SYS_Message.md +363 -363
  177. package/skill/references/classes/SYS_MessageBox.md +285 -285
  178. package/skill/references/classes/SYS_MessageBus.md +1618 -1618
  179. package/skill/references/classes/SYS_PanelControl.md +696 -696
  180. package/skill/references/classes/SYS_RightClickMenu.md +175 -175
  181. package/skill/references/classes/SYS_Setting.md +134 -85
  182. package/skill/references/classes/SYS_ShortcutKey.md +623 -623
  183. package/skill/references/classes/SYS_Storage.md +484 -484
  184. package/skill/references/classes/SYS_Timer.md +447 -447
  185. package/skill/references/classes/SYS_ToastMessage.md +194 -194
  186. package/skill/references/classes/SYS_Tool.md +317 -241
  187. package/skill/references/classes/SYS_Unit.md +594 -594
  188. package/skill/references/classes/SYS_WebSocket.md +401 -401
  189. package/skill/references/classes/SYS_Window.md +849 -850
  190. package/skill/references/enums/EDMT_EditorDocumentType.md +324 -278
  191. package/skill/references/enums/EDMT_EditorSplitScreenDirection.md +51 -47
  192. package/skill/references/enums/EDMT_EditorTabEventType.md +68 -62
  193. package/skill/references/enums/EDMT_IndicatorMarkerType.md +90 -80
  194. package/skill/references/enums/EDMT_ItemType.md +181 -157
  195. package/skill/references/enums/EDMT_ProjectCollaborationMode.md +51 -47
  196. package/skill/references/enums/EDMT_ProjectFileFormat.md +60 -0
  197. package/skill/references/enums/EDMT_ProjectReadyState.md +82 -0
  198. package/skill/references/enums/ELIB_DeviceJlcLibraryCategory.md +51 -47
  199. package/skill/references/enums/ELIB_LibraryType.md +129 -113
  200. package/skill/references/enums/ELIB_PreviewType.md +77 -69
  201. package/skill/references/enums/ELIB_SimulationModelType.md +51 -47
  202. package/skill/references/enums/ELIB_SymbolType.md +142 -124
  203. package/skill/references/enums/EPCB_AutoRoutingCornerStyle.md +51 -47
  204. package/skill/references/enums/EPCB_AutoRoutingExistingPrimitiveMode.md +51 -47
  205. package/skill/references/enums/EPCB_AutoRoutingOptimization.md +51 -47
  206. package/skill/references/enums/EPCB_DocumentCanvasUpdateCalculationActiveStatus.md +51 -47
  207. package/skill/references/enums/EPCB_DocumentRatlineCalculatingActiveStatus.md +55 -51
  208. package/skill/references/enums/EPCB_InactiveLayerDisplayMode.md +64 -58
  209. package/skill/references/enums/EPCB_LayerColorConfiguration.md +90 -80
  210. package/skill/references/enums/EPCB_LayerId.md +1169 -881
  211. package/skill/references/enums/EPCB_LayerStatus.md +64 -58
  212. package/skill/references/enums/EPCB_LayerType.md +129 -113
  213. package/skill/references/enums/EPCB_MouseEventType.md +64 -58
  214. package/skill/references/enums/EPCB_NetEventType.md +64 -58
  215. package/skill/references/enums/EPCB_PcbPlateType.md +51 -47
  216. package/skill/references/enums/EPCB_PdfOutputMethod.md +64 -58
  217. package/skill/references/enums/EPCB_PrimitiveArcInteractiveMode.md +51 -47
  218. package/skill/references/enums/EPCB_PrimitiveDimensionType.md +64 -58
  219. package/skill/references/enums/EPCB_PrimitiveEventType.md +64 -58
  220. package/skill/references/enums/EPCB_PrimitiveFillMode.md +68 -62
  221. package/skill/references/enums/EPCB_PrimitivePadHeatWeldingConnectionMethod.md +64 -58
  222. package/skill/references/enums/EPCB_PrimitivePadHoleType.md +64 -58
  223. package/skill/references/enums/EPCB_PrimitivePadShapeType.md +90 -80
  224. package/skill/references/enums/EPCB_PrimitivePadType.md +64 -58
  225. package/skill/references/enums/EPCB_PrimitivePourFillMethod.md +64 -58
  226. package/skill/references/enums/EPCB_PrimitiveRegionRuleType.md +107 -95
  227. package/skill/references/enums/EPCB_PrimitiveStringAlignMode.md +142 -124
  228. package/skill/references/enums/EPCB_PrimitiveType.md +233 -201
  229. package/skill/references/enums/EPCB_PrimitiveViaType.md +64 -58
  230. package/skill/references/enums/ESCH_DynamicSimulationEnginePullEventType.md +116 -102
  231. package/skill/references/enums/ESCH_DynamicSimulationEnginePushEventType.md +90 -80
  232. package/skill/references/enums/ESCH_ExportDocumentFileType.md +64 -58
  233. package/skill/references/enums/ESCH_MouseEventType.md +51 -47
  234. package/skill/references/enums/ESCH_PrimitiveComponentType.md +142 -124
  235. package/skill/references/enums/ESCH_PrimitiveEventType.md +77 -69
  236. package/skill/references/enums/ESCH_PrimitiveFillStyle.md +129 -113
  237. package/skill/references/enums/ESCH_PrimitiveLineType.md +77 -69
  238. package/skill/references/enums/ESCH_PrimitivePinShape.md +77 -69
  239. package/skill/references/enums/ESCH_PrimitivePinType.md +168 -146
  240. package/skill/references/enums/ESCH_PrimitiveTextAlignMode.md +142 -124
  241. package/skill/references/enums/ESCH_PrimitiveType.md +207 -179
  242. package/skill/references/enums/ESCH_SimulationNetlistType.md +38 -36
  243. package/skill/references/enums/ESCH_SpiceSimulationEnginePullEventType.md +51 -47
  244. package/skill/references/enums/ESCH_SpiceSimulationEnginePushEventType.md +77 -69
  245. package/skill/references/enums/ESYS_BottomPanelTab.md +94 -80
  246. package/skill/references/enums/ESYS_HeaderMenuEnvironment.md +181 -157
  247. package/skill/references/enums/ESYS_ImportProjectBoardOutlineSource.md +55 -51
  248. package/skill/references/enums/ESYS_ImportProjectImportOption.md +64 -58
  249. package/skill/references/enums/ESYS_ImportProjectSchematicObjectStyle.md +51 -47
  250. package/skill/references/enums/ESYS_ImportProjectViaSolderMaskExpansion.md +55 -51
  251. package/skill/references/enums/ESYS_JobState.md +95 -0
  252. package/skill/references/enums/ESYS_LeftPanelTab.md +94 -80
  253. package/skill/references/enums/ESYS_LogType.md +77 -102
  254. package/skill/references/enums/ESYS_NetlistType.md +129 -113
  255. package/skill/references/enums/ESYS_PanelPosition.md +69 -0
  256. package/skill/references/enums/ESYS_PanelTab.md +368 -0
  257. package/skill/references/enums/ESYS_RightPanelTab.md +237 -201
  258. package/skill/references/enums/ESYS_ShortcutKeyEffectiveEditorRange.md +220 -190
  259. package/skill/references/enums/ESYS_ShortcutKeyEffectiveEditorScene.md +103 -91
  260. package/skill/references/enums/ESYS_StartPageQuickStartItem.md +237 -205
  261. package/skill/references/enums/ESYS_Theme.md +51 -47
  262. package/skill/references/enums/ESYS_ToastMessageType.md +90 -80
  263. package/skill/references/enums/ESYS_Unit.md +116 -102
  264. package/skill/references/enums/ESYS_WindowEventType.md +64 -47
  265. package/skill/references/enums/ESYS_WindowOpenTarget.md +51 -47
  266. package/skill/references/enums/NetportDeviceName.md +146 -146
  267. package/skill/references/enums/SchToolBarDeviceName.md +278 -278
  268. package/skill/references/interfaces/BoardProps.md +169 -169
  269. package/skill/references/interfaces/BorderConfig.md +109 -0
  270. package/skill/references/interfaces/ButtonProps.md +196 -169
  271. package/skill/references/interfaces/CellClickInfo.md +142 -0
  272. package/skill/references/interfaces/CellCoord.md +88 -0
  273. package/skill/references/interfaces/CheckBoxProps.md +223 -196
  274. package/skill/references/interfaces/CheckChangeDetail.md +88 -0
  275. package/skill/references/interfaces/CheckboxEditConfig.md +159 -0
  276. package/skill/references/interfaces/ClipboardCellData.md +142 -0
  277. package/skill/references/interfaces/ClipboardConfig.md +115 -0
  278. package/skill/references/interfaces/ColorPickerProps.md +169 -0
  279. package/skill/references/interfaces/ColumnDef.md +605 -0
  280. package/skill/references/interfaces/ColumnEditTrigger.md +57 -0
  281. package/skill/references/interfaces/ColumnGroupDef.md +192 -0
  282. package/skill/references/interfaces/ColumnResizeConfig.md +142 -0
  283. package/skill/references/interfaces/ComponentPropsMap.md +517 -448
  284. package/skill/references/interfaces/CustomHeaderConfig.md +169 -0
  285. package/skill/references/interfaces/DialogProps.md +385 -385
  286. package/skill/references/interfaces/DragSortConfig.md +115 -0
  287. package/skill/references/interfaces/EditingConfig.md +196 -0
  288. package/skill/references/interfaces/FilteringConfig.md +250 -0
  289. package/skill/references/interfaces/FixedColumnConfig.md +88 -0
  290. package/skill/references/interfaces/FlexItemProps.md +116 -116
  291. package/skill/references/interfaces/FlexProps.md +224 -224
  292. package/skill/references/interfaces/GridItemProps.md +143 -143
  293. package/skill/references/interfaces/GridProps.md +143 -143
  294. package/skill/references/interfaces/IDMT_BoardItem.md +171 -171
  295. package/skill/references/interfaces/IDMT_BriefProjectItem.md +171 -171
  296. package/skill/references/interfaces/IDMT_EditorDocumentItem.md +169 -169
  297. package/skill/references/interfaces/IDMT_EditorSplitScreenItem.md +173 -173
  298. package/skill/references/interfaces/IDMT_EditorTabItem.md +169 -169
  299. package/skill/references/interfaces/IDMT_FolderItem.md +225 -225
  300. package/skill/references/interfaces/IDMT_IndicatorMarkerShape.md +393 -393
  301. package/skill/references/interfaces/IDMT_PanelItem.md +144 -144
  302. package/skill/references/interfaces/IDMT_PcbItem.md +171 -171
  303. package/skill/references/interfaces/IDMT_ProjectItem.md +143 -143
  304. package/skill/references/interfaces/IDMT_SchematicItem.md +225 -225
  305. package/skill/references/interfaces/IDMT_SchematicPageItem.md +198 -198
  306. package/skill/references/interfaces/IDMT_TeamItem.md +144 -144
  307. package/skill/references/interfaces/IDMT_WorkspaceItem.md +117 -117
  308. package/skill/references/interfaces/IDesignPortal.md +103 -103
  309. package/skill/references/interfaces/ILIB_3DModelItem.md +198 -198
  310. package/skill/references/interfaces/ILIB_3DModelSearchItem.md +277 -277
  311. package/skill/references/interfaces/ILIB_CbbItem.md +225 -225
  312. package/skill/references/interfaces/ILIB_CbbSearchItem.md +277 -277
  313. package/skill/references/interfaces/ILIB_ClassificationIndex.md +150 -150
  314. package/skill/references/interfaces/ILIB_ClassificationNode.md +98 -0
  315. package/skill/references/interfaces/ILIB_DeviceAssociationItem.md +210 -210
  316. package/skill/references/interfaces/ILIB_DeviceExtendPropertyItem.md +304 -304
  317. package/skill/references/interfaces/ILIB_DeviceItem.md +279 -279
  318. package/skill/references/interfaces/ILIB_DevicePropertiesForSearch.md +250 -250
  319. package/skill/references/interfaces/ILIB_DeviceSearchItem.md +521 -521
  320. package/skill/references/interfaces/ILIB_ExtendLibrary3DModelFunctions.md +64 -64
  321. package/skill/references/interfaces/ILIB_ExtendLibraryCbbFunctions.md +93 -99
  322. package/skill/references/interfaces/ILIB_ExtendLibraryClassificationIndex.md +150 -150
  323. package/skill/references/interfaces/ILIB_ExtendLibraryDeviceFunctions.md +143 -157
  324. package/skill/references/interfaces/ILIB_ExtendLibraryFootprintFunctions.md +63 -63
  325. package/skill/references/interfaces/ILIB_ExtendLibraryFunctions.md +123 -123
  326. package/skill/references/interfaces/ILIB_ExtendLibraryItem.md +97 -97
  327. package/skill/references/interfaces/ILIB_ExtendLibraryItemIndex.md +98 -98
  328. package/skill/references/interfaces/ILIB_ExtendLibrarySearchProperty.md +115 -115
  329. package/skill/references/interfaces/ILIB_ExtendLibrarySearchResult.md +169 -169
  330. package/skill/references/interfaces/ILIB_ExtendLibrarySearchResultDataLine.md +234 -234
  331. package/skill/references/interfaces/ILIB_ExtendLibrarySymbolFunctions.md +91 -105
  332. package/skill/references/interfaces/ILIB_ExtendLibraryUserIndex.md +96 -96
  333. package/skill/references/interfaces/ILIB_FootprintItem.md +256 -198
  334. package/skill/references/interfaces/ILIB_FootprintPropertiesForSearch.md +61 -61
  335. package/skill/references/interfaces/ILIB_FootprintSearchItem.md +277 -277
  336. package/skill/references/interfaces/ILIB_LibraryInfo.md +92 -92
  337. package/skill/references/interfaces/ILIB_LibraryItem.md +115 -115
  338. package/skill/references/interfaces/ILIB_PanelLibraryItem.md +198 -198
  339. package/skill/references/interfaces/ILIB_PanelLibrarySearchItem.md +277 -277
  340. package/skill/references/interfaces/ILIB_RegisterExtendLibraryProps.md +71 -0
  341. package/skill/references/interfaces/ILIB_SimulationModelItem.md +306 -306
  342. package/skill/references/interfaces/ILIB_SimulationModelSearchItem.md +304 -304
  343. package/skill/references/interfaces/ILIB_SymbolItem.md +306 -279
  344. package/skill/references/interfaces/ILIB_SymbolPropertiesForSearch.md +61 -61
  345. package/skill/references/interfaces/ILIB_SymbolSearchItem.md +304 -304
  346. package/skill/references/interfaces/IPCB_AutoLayoutResult.md +169 -169
  347. package/skill/references/interfaces/IPCB_AutoRoutingProps.md +220 -220
  348. package/skill/references/interfaces/IPCB_AutoRoutingResult.md +169 -169
  349. package/skill/references/interfaces/IPCB_BomPropertiesTableColumns.md +169 -169
  350. package/skill/references/interfaces/IPCB_DifferentialPairItem.md +115 -115
  351. package/skill/references/interfaces/IPCB_DiscretizeOptions.md +65 -65
  352. package/skill/references/interfaces/IPCB_DiscretizedPoint.md +88 -88
  353. package/skill/references/interfaces/IPCB_EqualLengthNetGroupItem.md +115 -115
  354. package/skill/references/interfaces/IPCB_LayerItem.md +277 -277
  355. package/skill/references/interfaces/IPCB_NetClassItem.md +115 -115
  356. package/skill/references/interfaces/IPCB_NetInfo.md +115 -115
  357. package/skill/references/interfaces/IPCB_PadPairGroupItem.md +88 -88
  358. package/skill/references/interfaces/IPCB_PadPairMinWireLengthItem.md +88 -88
  359. package/skill/references/interfaces/IPCB_PhysicalStackingConfiguration.md +115 -115
  360. package/skill/references/interfaces/IPCB_Primitive.md +218 -218
  361. package/skill/references/interfaces/IPCB_PrimitiveAPI.md +174 -175
  362. package/skill/references/interfaces/IPCB_PrimitivePadHeatWelding.md +151 -151
  363. package/skill/references/interfaces/IPCB_PrimitivePouredPourFill.md +142 -142
  364. package/skill/references/interfaces/IPCB_PrimitiveSolderMaskAndPasteMaskExpansion.md +154 -154
  365. package/skill/references/interfaces/IPCB_RayTracerBackgroundConfig.md +223 -0
  366. package/skill/references/interfaces/IPCB_RayTracerLightConfig.md +412 -0
  367. package/skill/references/interfaces/IPCB_RayTracerMaterialConfig.md +547 -0
  368. package/skill/references/interfaces/IPCB_RayTracerPcbMaterialConfig.md +196 -0
  369. package/skill/references/interfaces/IPCB_RayTracerRenderConfigurations.md +200 -0
  370. package/skill/references/interfaces/IPCB_RayTracerRendererConfig.md +196 -0
  371. package/skill/references/interfaces/IPCB_RayTracerSceneElement.md +115 -0
  372. package/skill/references/interfaces/IPCB_RayTracerSceneElementTransform.md +123 -0
  373. package/skill/references/interfaces/IPCB_RayTracerTexture.md +88 -0
  374. package/skill/references/interfaces/IPCB_SubstratePhysicalProperties.md +88 -88
  375. package/skill/references/interfaces/IRawNet.md +103 -103
  376. package/skill/references/interfaces/IRawPureSchematic.md +80 -80
  377. package/skill/references/interfaces/IRawSchematic.md +103 -103
  378. package/skill/references/interfaces/IRawWire.md +149 -149
  379. package/skill/references/interfaces/ISCH_DrcError.md +142 -142
  380. package/skill/references/interfaces/ISCH_DrcErrorPrimitive.md +142 -142
  381. package/skill/references/interfaces/ISCH_ExportPngResolution.md +94 -94
  382. package/skill/references/interfaces/ISCH_NetInfo.md +88 -88
  383. package/skill/references/interfaces/ISCH_Primitive.md +218 -219
  384. package/skill/references/interfaces/ISCH_PrimitiveAPI.md +174 -175
  385. package/skill/references/interfaces/ISCH_ProjectNetInfo.md +142 -142
  386. package/skill/references/interfaces/ISCH_WireInfo.md +169 -169
  387. package/skill/references/interfaces/ISYS_ComparisonResponse.md +115 -0
  388. package/skill/references/interfaces/ISYS_ExtensionExternalApiIndex.md +13 -0
  389. package/skill/references/interfaces/ISYS_ExtensionRegisteredExternalApis.md +13 -0
  390. package/skill/references/interfaces/ISYS_ExternalApiHelp.md +173 -0
  391. package/skill/references/interfaces/ISYS_ExternalApiRegistration.md +146 -0
  392. package/skill/references/interfaces/ISYS_FileSystemFileList.md +169 -169
  393. package/skill/references/interfaces/ISYS_HeaderMenuSub1MenuItem.md +205 -174
  394. package/skill/references/interfaces/ISYS_HeaderMenuSub2MenuItem.md +178 -147
  395. package/skill/references/interfaces/ISYS_HeaderMenuTopMenuItem.md +115 -115
  396. package/skill/references/interfaces/ISYS_HeaderMenus.md +408 -408
  397. package/skill/references/interfaces/ISYS_HelpAudienceEntry.md +92 -0
  398. package/skill/references/interfaces/ISYS_HelpClassSummary.md +205 -0
  399. package/skill/references/interfaces/ISYS_HelpData.md +92 -0
  400. package/skill/references/interfaces/ISYS_HelpMethodDetail.md +310 -0
  401. package/skill/references/interfaces/ISYS_JobHandle.md +65 -0
  402. package/skill/references/interfaces/ISYS_JobLogEntry.md +142 -0
  403. package/skill/references/interfaces/ISYS_JobStatus.md +176 -0
  404. package/skill/references/interfaces/ISYS_LogLine.md +115 -115
  405. package/skill/references/interfaces/ISYS_MathBBox.md +142 -142
  406. package/skill/references/interfaces/ISYS_MathPoint.md +88 -88
  407. package/skill/references/interfaces/ISYS_MathPolygonWithHoles.md +92 -92
  408. package/skill/references/interfaces/ISYS_MessageBusTask.md +115 -115
  409. package/skill/references/interfaces/ISYS_MultilingualLanguagesData.md +12 -12
  410. package/skill/references/interfaces/ISYS_RightClickMenuItem.md +174 -174
  411. package/skill/references/interfaces/ISYS_ShortcutKeyData.md +169 -169
  412. package/skill/references/interfaces/ISYS_ShortcutKeyDataWithCallFn.md +62 -62
  413. package/skill/references/interfaces/ISYS_ShortcutKeyDataWithUserDefinedShortcutKey.md +62 -62
  414. package/skill/references/interfaces/ISYS_WindowEventListenerRemovableObject.md +109 -109
  415. package/skill/references/interfaces/IconProps.md +88 -88
  416. package/skill/references/interfaces/ImageProps.md +115 -115
  417. package/skill/references/interfaces/InputEditConfig.md +182 -0
  418. package/skill/references/interfaces/InputProps.md +547 -520
  419. package/skill/references/interfaces/KeyboardConfig.md +61 -0
  420. package/skill/references/interfaces/ListChildren.md +223 -223
  421. package/skill/references/interfaces/ListProps.md +250 -223
  422. package/skill/references/interfaces/ModalProps.md +358 -358
  423. package/skill/references/interfaces/NumberEditConfig.md +234 -0
  424. package/skill/references/interfaces/RadioGroupProps.md +196 -196
  425. package/skill/references/interfaces/RadioItem.md +115 -115
  426. package/skill/references/interfaces/RichTableProps.md +1357 -0
  427. package/skill/references/interfaces/RowMetaConfig.md +142 -0
  428. package/skill/references/interfaces/ScrollerProps.md +169 -169
  429. package/skill/references/interfaces/SelectEditConfig.md +211 -0
  430. package/skill/references/interfaces/SelectListItem.md +142 -142
  431. package/skill/references/interfaces/SelectOption.md +142 -0
  432. package/skill/references/interfaces/SelectProps.md +169 -169
  433. package/skill/references/interfaces/SelectionConfig.md +358 -0
  434. package/skill/references/interfaces/SliderProps.md +142 -0
  435. package/skill/references/interfaces/SlotProps.md +88 -88
  436. package/skill/references/interfaces/SortState.md +88 -0
  437. package/skill/references/interfaces/SortingConfig.md +169 -0
  438. package/skill/references/interfaces/StyleProps.md +439 -385
  439. package/skill/references/interfaces/TextAreaProps.md +196 -196
  440. package/skill/references/interfaces/TextProps.md +169 -169
  441. package/skill/references/interfaces/TextareaEditConfig.md +182 -0
  442. package/skill/references/interfaces/ValidationRule.md +223 -0
  443. package/skill/references/interfaces/VirtualScrollConfig.md +115 -0
  444. package/skill/references/types/Align.md +9 -0
  445. package/skill/references/types/CellContentType.md +9 -0
  446. package/skill/references/types/ColumnDefOrGroup.md +12 -0
  447. package/skill/references/types/ColumnEditConfig.md +13 -0
  448. package/skill/references/types/ColumnType.md +9 -0
  449. package/skill/references/types/DataChangeType.md +9 -0
  450. package/skill/references/types/FilterMatchMode.md +9 -0
  451. package/skill/references/types/RichTableRow.md +12 -0
  452. package/skill/references/types/Serializable.md +10 -0
  453. package/skill/references/types/SerializablePrimitive.md +9 -0
  454. package/skill/references/types/SortOrder.md +9 -0
  455. package/skill/references/types/TPCB_LayerTypesOfInnerLayer.md +11 -11
  456. package/skill/references/types/TPCB_LayersInTheSelectable.md +42 -42
  457. package/skill/references/types/TPCB_LayersOfComponent.md +11 -11
  458. package/skill/references/types/TPCB_LayersOfCopper.md +15 -15
  459. package/skill/references/types/TPCB_LayersOfCustom.md +41 -41
  460. package/skill/references/types/TPCB_LayersOfDimension.md +16 -16
  461. package/skill/references/types/TPCB_LayersOfFill.md +28 -28
  462. package/skill/references/types/TPCB_LayersOfImage.md +22 -22
  463. package/skill/references/types/TPCB_LayersOfInner.md +41 -41
  464. package/skill/references/types/TPCB_LayersOfLine.md +25 -25
  465. package/skill/references/types/TPCB_LayersOfObject.md +12 -12
  466. package/skill/references/types/TPCB_LayersOfPad.md +11 -11
  467. package/skill/references/types/TPCB_LayersOfRegion.md +11 -11
  468. package/skill/references/types/TPCB_NumberOfCopperLayers.md +9 -9
  469. package/skill/references/types/TPCB_PolygonSourceArray.md +85 -83
  470. package/skill/references/types/TPCB_PrimitiveDimensionCoordinateSet.md +66 -66
  471. package/skill/references/types/TPCB_PrimitivePadHole.md +30 -30
  472. package/skill/references/types/TPCB_PrimitivePadShape.md +61 -61
  473. package/skill/references/types/TPCB_PrimitiveSpecialPadShape.md +19 -19
  474. package/skill/references/types/TSYS_ComparisonErrorCode.md +15 -0
  475. package/skill/references/types/TSYS_LanguageKeyValuePairs.md +13 -0
  476. package/skill/references/types/TSYS_MathPolygonGroup.md +15 -15
  477. package/skill/references/types/TSYS_MathPolygonInput.md +20 -20
  478. package/skill/references/types/TSYS_ShortcutKeys.md +96 -96
  479. package/skill/user-guide/using-extension.md +47 -47
  480. package/src/json-gen.test.js +430 -0
  481. package/skill/guide/ancillary-projects/pro-api-sdk.md +0 -1
  482. package/skill/references/interfaces/ISYS_PcbComparisonResponse.md +0 -115
  483. package/skill/references/types/ISYS_LanguageKeyValuePairs.md +0 -13
  484. package/skill/references/types/TSYS_PcbComparisonErrorCode.md +0 -10
@@ -1,1754 +1,1770 @@
1
- # PCB\_Document class
2
-
3
- PCB & footprint / document operation class
4
-
5
- ## Signature
6
-
7
- ```typescript
8
- class PCB_Document
9
- ```
10
-
11
- ## Remarks
12
-
13
- Operations performed on the design document as a whole
14
-
15
- ## Methods
16
-
17
- <table><thead><tr><th>
18
-
19
- Method
20
-
21
- </th><th>
22
-
23
- Modifiers
24
-
25
- </th><th>
26
-
27
- Description
28
-
29
- </th></tr></thead>
30
- <tbody><tr><td>
31
-
32
- [autoLayout()](./PCB_Document.md)
33
-
34
- </td><td>
35
-
36
- </td><td>
37
-
38
- **_(BETA)_** Auto layout
39
-
40
- </td></tr>
41
- <tr><td>
42
-
43
- [autoRouting(props)](./PCB_Document.md)
44
-
45
- </td><td>
46
-
47
- </td><td>
48
-
49
- **_(BETA)_** Auto routing
50
-
51
- </td></tr>
52
- <tr><td>
53
-
54
- [clearRouting(type)](./PCB_Document.md)
55
-
56
- </td><td>
57
-
58
- </td><td>
59
-
60
- **_(BETA)_** Clear routing
61
-
62
- </td></tr>
63
- <tr><td>
64
-
65
- [convertCanvasOriginToDataOrigin(x, y)](./PCB_Document.md)
66
-
67
- </td><td>
68
-
69
- </td><td>
70
-
71
- Input a canvas coordinate and return the data coordinate corresponding to that coordinate
72
-
73
- </td></tr>
74
- <tr><td>
75
-
76
- [convertDataOriginToCanvasOrigin(x, y)](./PCB_Document.md)
77
-
78
- </td><td>
79
-
80
- </td><td>
81
-
82
- Input a data coordinate and return the canvas coordinate corresponding to that coordinate
83
-
84
- </td></tr>
85
- <tr><td>
86
-
87
- [getCalculatingRatlineStatus()](./PCB_Document.md)
88
-
89
- </td><td>
90
-
91
- </td><td>
92
-
93
- Get the current ratline calculation function status
94
-
95
- </td></tr>
96
- <tr><td>
97
-
98
- [getCanvasOrigin()](./PCB_Document.md)
99
-
100
- </td><td>
101
-
102
- </td><td>
103
-
104
- Get the offset coordinate of the canvas origin relative to the data origin
105
-
106
- </td></tr>
107
- <tr><td>
108
-
109
- [getCanvasUpdateCalculationStatus()](./PCB_Document.md)
110
-
111
- </td><td>
112
-
113
- </td><td>
114
-
115
- **_(BETA)_** Query the current canvas update calculation status
116
-
117
- </td></tr>
118
- <tr><td>
119
-
120
- [getCurrentFilterConfiguration()](./PCB_Document.md)
121
-
122
- </td><td>
123
-
124
- </td><td>
125
-
126
- **_(BETA)_** Get Current canvas filter configuration
127
-
128
- </td></tr>
129
- <tr><td>
130
-
131
- [getPrimitiveAtPoint(x, y)](./PCB_Document.md)
132
-
133
- </td><td>
134
-
135
- </td><td>
136
-
137
- **_(BETA)_** Get The primitive at the coordinate point
138
-
139
- </td></tr>
140
- <tr><td>
141
-
142
- [getPrimitivesInRegion(left, right, top, bottom, leftToRight)](./PCB_Document.md)
143
-
144
- </td><td>
145
-
146
- </td><td>
147
-
148
- **_(BETA)_** Get All primitives in the region
149
-
150
- </td></tr>
151
- <tr><td>
152
-
153
- [importAutoLayoutJsonFile(autoLayoutFile)](./PCB_Document.md)
154
-
155
- </td><td>
156
-
157
- </td><td>
158
-
159
- **_(BETA)_** Import auto layout file (JSON)
160
-
161
- </td></tr>
162
- <tr><td>
163
-
164
- [importAutoRouteJsonFile(autoRouteFile)](./PCB_Document.md)
165
-
166
- </td><td>
167
-
168
- </td><td>
169
-
170
- **_(BETA)_** Import auto routing file (JSON)
171
-
172
- </td></tr>
173
- <tr><td>
174
-
175
- [importAutoRouteSesFile(autoRouteFile)](./PCB_Document.md)
176
-
177
- </td><td>
178
-
179
- </td><td>
180
-
181
- **_(BETA)_** Import auto routing file (SES)
182
-
183
- </td></tr>
184
- <tr><td>
185
-
186
- [importChanges(uuid)](./PCB_Document.md)
187
-
188
- </td><td>
189
-
190
- </td><td>
191
-
192
- Import changes from the schematic
193
-
194
- </td></tr>
195
- <tr><td>
196
-
197
- [navigateToCoordinates(x, y)](./PCB_Document.md)
198
-
199
- </td><td>
200
-
201
- </td><td>
202
-
203
- Locate to canvas coordinate
204
-
205
- </td></tr>
206
- <tr><td>
207
-
208
- [navigateToRegion(left, right, top, bottom)](./PCB_Document.md)
209
-
210
- </td><td>
211
-
212
- </td><td>
213
-
214
- **_(BETA)_** Locate to canvas region
215
-
216
- </td></tr>
217
- <tr><td>
218
-
219
- [save()](./PCB_Document.md)
220
-
221
- </td><td>
222
-
223
- </td><td>
224
-
225
- Save Document
226
-
227
- </td></tr>
228
- <tr><td>
229
-
230
- [setCanvasOrigin(offsetX, offsetY)](./PCB_Document.md)
231
-
232
- </td><td>
233
-
234
- </td><td>
235
-
236
- Set the offset coordinate of the canvas origin relative to the data origin
237
-
238
- </td></tr>
239
- <tr><td>
240
-
241
- [startCalculatingRatline()](./PCB_Document.md)
242
-
243
- </td><td>
244
-
245
- </td><td>
246
-
247
- Start the ratline calculation function
248
-
249
- </td></tr>
250
- <tr><td>
251
-
252
- [startCanvasUpdateCalculation()](./PCB_Document.md)
253
-
254
- </td><td>
255
-
256
- </td><td>
257
-
258
- **_(BETA)_** Start canvas update calculation
259
-
260
- </td></tr>
261
- <tr><td>
262
-
263
- [stopCalculatingRatline()](./PCB_Document.md)
264
-
265
- </td><td>
266
-
267
- </td><td>
268
-
269
- Stop the ratline calculation function
270
-
271
- </td></tr>
272
- <tr><td>
273
-
274
- [stopCanvasUpdateCalculation()](./PCB_Document.md)
275
-
276
- </td><td>
277
-
278
- </td><td>
279
-
280
- **_(BETA)_** Stop canvas update calculation
281
-
282
- </td></tr>
283
- <tr><td>
284
-
285
- [triggerCanvasUpdateCalculation()](./PCB_Document.md)
286
-
287
- </td><td>
288
-
289
- </td><td>
290
-
291
- **_(BETA)_** Trigger a canvas update calculation
292
-
293
- </td></tr>
294
- <tr><td>
295
-
296
- [zoomToBoardOutline()](./PCB_Document.md)
297
-
298
- </td><td>
299
-
300
- </td><td>
301
-
302
- **_(BETA)_** Zoom to the board outline (fit the board outline)
303
-
304
- </td></tr>
305
- </tbody></table>
306
-
307
- ---
308
-
309
- ## 方法详情
310
-
311
- ### autolayout
312
-
313
- # PCB\_Document.autoLayout() method
314
-
315
- > 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.
316
-
317
- Auto layout
318
-
319
- ## Signature
320
-
321
- ```typescript
322
- function autoLayout(): Promise<IPCB_AutoLayoutResult>;
323
- ```
324
-
325
- ## Returns
326
-
327
- Promise&lt;[IPCB\_AutoLayoutResult](../interfaces/IPCB_AutoLayoutResult.md)<!-- -->&gt;
328
-
329
- Auto layout result
330
-
331
- ## Remarks
332
-
333
- ADD since EDA v3.2.162
334
-
335
- ### autorouting
336
-
337
- # PCB\_Document.autoRouting() method
338
-
339
- > 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.
340
-
341
- Auto routing
342
-
343
- ## Signature
344
-
345
- ```typescript
346
- function autoRouting(props?: IPCB_AutoRoutingProps): Promise<IPCB_AutoRoutingResult>;
347
- ```
348
-
349
- ## Parameters
350
-
351
- <table><thead><tr><th>
352
-
353
- Parameter
354
-
355
- </th><th>
356
-
357
- Type
358
-
359
- </th><th>
360
-
361
- Description
362
-
363
- </th></tr></thead>
364
- <tbody><tr><td>
365
-
366
- props
367
-
368
- </td><td>
369
-
370
- [IPCB\_AutoRoutingProps](../interfaces/IPCB_AutoRoutingProps.md)
371
-
372
- </td><td>
373
-
374
- _(Optional)_ Auto routing parameter
375
-
376
- </td></tr>
377
- </tbody></table>
378
-
379
- ## Returns
380
-
381
- Promise&lt;[IPCB\_AutoRoutingResult](../interfaces/IPCB_AutoRoutingResult.md)<!-- -->&gt;
382
-
383
- Auto routing result
384
-
385
- ## Remarks
386
-
387
- If no parameters are passed in, auto routing will be performed for all unrouted nets ADD since EDA v3.2.162
388
-
389
- ## Example
390
-
391
- ```javascript
392
- // 对所有未布线的网络进行自动布线
393
- const result = await eda.pcb_Document.autoRouting();
394
- console.log(`布线完成:${result.routedNets}/${result.totalNets}`);
395
-
396
- // 指定网络进行自动布线,并忽略部分网络
397
- const result = await eda.pcb_Document.autoRouting({
398
- nets: ['VCC', 'GND', 'SDA', 'SCL'],
399
- ignoreNets: ['NC'],
400
- cornerStyle: EPCB_AutoRoutingCornerStyle.DEGREE_45,
401
- optimization: EPCB_AutoRoutingOptimization.COMPLETION,
402
- });
403
- ```
404
-
405
- ### clearrouting
406
-
407
- # PCB\_Document.clearRouting() method
408
-
409
- > 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.
410
-
411
- Clear routing
412
-
413
- ## Signature
414
-
415
- ```typescript
416
- function clearRouting(type?: 'all' | 'net' | 'connection'): Promise<boolean>;
417
- ```
418
-
419
- ## Parameters
420
-
421
- <table><thead><tr><th>
422
-
423
- Parameter
424
-
425
- </th><th>
426
-
427
- Type
428
-
429
- </th><th>
430
-
431
- Description
432
-
433
- </th></tr></thead>
434
- <tbody><tr><td>
435
-
436
- type
437
-
438
- </td><td>
439
-
440
- 'all' \| 'net' \| 'connection'
441
-
442
- </td><td>
443
-
444
- _(Optional)_ Clear type. If you need to specify a clear type, select the specified primitive in advance
445
-
446
- </td></tr>
447
- </tbody></table>
448
-
449
- ## Returns
450
-
451
- Promise&lt;boolean&gt;
452
-
453
- ### convertcanvasorigintodataorigin
454
-
455
- # PCB\_Document.convertCanvasOriginToDataOrigin() method
456
-
457
- Input a canvas coordinate and return the data coordinate corresponding to that coordinate
458
-
459
- ## Signature
460
-
461
- ```typescript
462
- function convertCanvasOriginToDataOrigin(x: number, y: number): Promise<{ x: number; y: number }>;
463
- ```
464
-
465
- ## Parameters
466
-
467
- <table><thead><tr><th>
468
-
469
- Parameter
470
-
471
- </th><th>
472
-
473
- Type
474
-
475
- </th><th>
476
-
477
- Description
478
-
479
- </th></tr></thead>
480
- <tbody><tr><td>
481
-
482
- x
483
-
484
- </td><td>
485
-
486
- number
487
-
488
- </td><td>
489
-
490
- </td></tr>
491
- <tr><td>
492
-
493
- y
494
-
495
- </td><td>
496
-
497
- number
498
-
499
- </td><td>
500
-
501
- </td></tr>
502
- </tbody></table>
503
-
504
- ## Returns
505
-
506
- Promise&lt;{ x: number; y: number }&gt;
507
-
508
- Data origin coordinate
509
-
510
- ## Remarks
511
-
512
- The coordinates displayed on the EasyEDA front end are all relative to the canvas origin; the EasyEDA API uses the data origin; when creating a PCB, the default canvas origin equals the data origin
513
-
514
- ## Example
515
-
516
- ```javascript
517
- // 1. 创建测试 PCB 并打开(文档级 API 作用于当前激活的 PCB)
518
- const pcbUuid = await eda.dmt_Pcb.createPcb();
519
- await new Promise(r => setTimeout(r, 1500));
520
- await eda.dmt_EditorControl.openDocument(pcbUuid);
521
- await new Promise(r => setTimeout(r, 1000));
522
-
523
- // 2. 换算画布坐标 (300, 400)。新建 PCB 画布原点与数据原点重合,换算值不变
524
- const before = await eda.pcb_Document.convertCanvasOriginToDataOrigin(300, 400);
525
- console.log('before:', JSON.stringify(before));
526
-
527
- // 3. 设置画布原点偏移后再换算同一坐标,观察映射随之变化
528
- await eda.pcb_Document.setCanvasOrigin(50, 100);
529
- const after = await eda.pcb_Document.convertCanvasOriginToDataOrigin(300, 400);
530
- console.log('after:', JSON.stringify(after));
531
-
532
- // 4. 清理测试 PCB(偏移随文档一起删除)
533
- await eda.dmt_Pcb.deletePcb(pcbUuid);
534
- ```
535
-
536
- ### convertdataorigintocanvasorigin
537
-
538
- # PCB\_Document.convertDataOriginToCanvasOrigin() method
539
-
540
- Input a data coordinate and return the canvas coordinate corresponding to that coordinate
541
-
542
- ## Signature
543
-
544
- ```typescript
545
- function convertDataOriginToCanvasOrigin(x: number, y: number): Promise<{ x: number; y: number }>;
546
- ```
547
-
548
- ## Parameters
549
-
550
- <table><thead><tr><th>
551
-
552
- Parameter
553
-
554
- </th><th>
555
-
556
- Type
557
-
558
- </th><th>
559
-
560
- Description
561
-
562
- </th></tr></thead>
563
- <tbody><tr><td>
564
-
565
- x
566
-
567
- </td><td>
568
-
569
- number
570
-
571
- </td><td>
572
-
573
- Data origin X
574
-
575
- </td></tr>
576
- <tr><td>
577
-
578
- y
579
-
580
- </td><td>
581
-
582
- number
583
-
584
- </td><td>
585
-
586
- Data origin Y
587
-
588
- </td></tr>
589
- </tbody></table>
590
-
591
- ## Returns
592
-
593
- Promise&lt;{ x: number; y: number }&gt;
594
-
595
- Canvas origin coordinate
596
-
597
- ## Remarks
598
-
599
- The coordinates displayed on the EasyEDA front end are all relative to the canvas origin; the EasyEDA API uses the data origin; when creating a PCB, the default canvas origin equals the data origin
600
-
601
- ## Example
602
-
603
- ```javascript
604
- // 1. 创建测试 PCB 并打开(文档级 API 作用于当前激活的 PCB)
605
- const pcbUuid = await eda.dmt_Pcb.createPcb();
606
- await new Promise(r => setTimeout(r, 1500));
607
- await eda.dmt_EditorControl.openDocument(pcbUuid);
608
- await new Promise(r => setTimeout(r, 1000));
609
-
610
- // 2. 换算数据坐标 (300, 400)。新建 PCB 画布原点与数据原点重合,换算值不变
611
- const before = await eda.pcb_Document.convertDataOriginToCanvasOrigin(300, 400);
612
- console.log('before:', JSON.stringify(before));
613
-
614
- // 3. 设置画布原点偏移后再换算同一坐标,观察映射随之变化
615
- await eda.pcb_Document.setCanvasOrigin(50, 100);
616
- const after = await eda.pcb_Document.convertDataOriginToCanvasOrigin(300, 400);
617
- console.log('after:', JSON.stringify(after));
618
-
619
- // 4. 清理测试 PCB(偏移随文档一起删除)
620
- await eda.dmt_Pcb.deletePcb(pcbUuid);
621
- ```
622
-
623
- ### getcalculatingratlinestatus
624
-
625
- # PCB\_Document.getCalculatingRatlineStatus() method
626
-
627
- > Warning: This API is now obsolete.
628
- >
629
- > since EDA v4.2
630
-
631
- Get the current ratline calculation function status
632
-
633
- ## Signature
634
-
635
- ```typescript
636
- function getCalculatingRatlineStatus(): Promise<
637
- EPCB_DocumentRatlineCalculatingActiveStatus | undefined
638
- >;
639
- ```
640
-
641
- ## Returns
642
-
643
- Promise&lt;[EPCB\_DocumentRatlineCalculatingActiveStatus](../enums/EPCB_DocumentRatlineCalculatingActiveStatus.md) \| undefined&gt;
644
-
645
- Function state
646
-
647
- ### getcanvasorigin
648
-
649
- # PCB\_Document.getCanvasOrigin() method
650
-
651
- Get the offset coordinate of the canvas origin relative to the data origin
652
-
653
- ## Signature
654
-
655
- ```typescript
656
- function getCanvasOrigin(): Promise<{ offsetX: number; offsetY: number }>;
657
- ```
658
-
659
- ## Returns
660
-
661
- Promise&lt;{ offsetX: number; offsetY: number }&gt;
662
-
663
- The offset coordinate of the canvas origin relative to the data origin
664
-
665
- ## Remarks
666
-
667
- The coordinates displayed on the EasyEDA Pro front end are all relative to the canvas origin;
668
-
669
- The EasyEDA Pro API uses the data origin;
670
-
671
- If the returned data is `{ canvasOriginOffsetX: 100, canvasOriginOffsetY: 200 }`<!-- -->, it means the canvas origin is at a position 100 units to the right and 200 units up from the data origin;
672
-
673
- The units here are data-level units, which are equivalent to mil on the canvas level in span
674
-
675
- ### getcanvasupdatecalculationstatus
676
-
677
- # PCB\_Document.getCanvasUpdateCalculationStatus() method
678
-
679
- > 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.
680
-
681
- Query the current canvas update calculation status
682
-
683
- ## Signature
684
-
685
- ```typescript
686
- function getCanvasUpdateCalculationStatus(): Promise<
687
- EPCB_DocumentCanvasUpdateCalculationActiveStatus | undefined
688
- >;
689
- ```
690
-
691
- ## Returns
692
-
693
- Promise&lt;[EPCB\_DocumentCanvasUpdateCalculationActiveStatus](../enums/EPCB_DocumentCanvasUpdateCalculationActiveStatus.md) \| undefined&gt;
694
-
695
- Canvas update calculation function status
696
-
697
- ## Remarks
698
-
699
- Canvas update calculation includes canvas render updates, property panel updates, etc. ADD since EDA v4.2
700
-
701
- ### getcurrentfilterconfiguration
702
-
703
- # PCB\_Document.getCurrentFilterConfiguration() method
704
-
705
- > 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.
706
-
707
- Get Current canvas filter configuration
708
-
709
- ## Signature
710
-
711
- ```typescript
712
- function getCurrentFilterConfiguration(): Promise<Record<string, any> | undefined>;
713
- ```
714
-
715
- ## Returns
716
-
717
- Promise&lt;Record&lt;string, any&gt; \| undefined&gt;
718
-
719
- Current canvas filter configuration; `undefined` indicates that the retrieval failed
720
-
721
- ### getprimitiveatpoint
722
-
723
- # PCB\_Document.getPrimitiveAtPoint() method
724
-
725
- > 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.
726
-
727
- Get The primitive at the coordinate point
728
-
729
- ## Signature
730
-
731
- ```typescript
732
- function getPrimitiveAtPoint(x: number, y: number): Promise<IPCB_Primitive | undefined>;
733
- ```
734
-
735
- ## Parameters
736
-
737
- <table><thead><tr><th>
738
-
739
- Parameter
740
-
741
- </th><th>
742
-
743
- Type
744
-
745
- </th><th>
746
-
747
- Description
748
-
749
- </th></tr></thead>
750
- <tbody><tr><td>
751
-
752
- x
753
-
754
- </td><td>
755
-
756
- number
757
-
758
- </td><td>
759
-
760
- Coordinate point X
761
-
762
- </td></tr>
763
- <tr><td>
764
-
765
- y
766
-
767
- </td><td>
768
-
769
- number
770
-
771
- </td><td>
772
-
773
- Coordinate point Y
774
-
775
- </td></tr>
776
- </tbody></table>
777
-
778
- ## Returns
779
-
780
- Promise&lt;[IPCB\_Primitive](../interfaces/IPCB_Primitive.md) \| undefined&gt;
781
-
782
- The primitive at the coordinate point. If no primitive can be found at the coordinate point, `undefined` will be returned
783
-
784
- ## Remarks
785
-
786
- This operation is similar to clicking with the mouse on the front end; it will get the primitive at the specified coordinate point
787
-
788
- ## Example
789
-
790
- ```javascript
791
- // 1. 创建测试 PCB 并打开
792
- const pcbUuid = await eda.dmt_Pcb.createPcb();
793
- await new Promise(r => setTimeout(r, 1500));
794
- await eda.dmt_EditorControl.openDocument(pcbUuid);
795
- await new Promise(r => setTimeout(r, 1000));
796
-
797
- // 2. 在 (500, 500) 放一个测试焊盘作为拾取目标
798
- const pad = await eda.pcb_PrimitivePad.create(1, '1', 500, 500, 0, ['ELLIPSE', 60, 60], '', null, 0, 0, 0, false, 0);
799
- const padId = pad.getState_PrimitiveId();
800
-
801
- // 3. 拾取焊盘中心点,返回该焊盘图元
802
- const hit = await eda.pcb_Document.getPrimitiveAtPoint(500, 500);
803
- console.log('hitPrimitiveId:', hit.getState_PrimitiveId());
804
-
805
- // 4. 拾取空白坐标点,返回 undefined
806
- const miss = await eda.pcb_Document.getPrimitiveAtPoint(90000, 90000);
807
- console.log('空白坐标点:', miss === undefined ? '未找到图元' : '找到图元');
808
-
809
- // 5. 清理测试图元和测试 PCB
810
- await eda.pcb_PrimitivePad.delete([padId]);
811
- await eda.dmt_Pcb.deletePcb(pcbUuid);
812
- ```
813
-
814
- ### getprimitivesinregion
815
-
816
- # PCB\_Document.getPrimitivesInRegion() method
817
-
818
- > 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.
819
-
820
- Get All primitives in the region
821
-
822
- ## Signature
823
-
824
- ```typescript
825
- function getPrimitivesInRegion(
826
- left: number,
827
- right: number,
828
- top: number,
829
- bottom: number,
830
- leftToRight?: boolean,
831
- ): Promise<Array<IPCB_Primitive>>;
832
- ```
833
-
834
- ## Parameters
835
-
836
- <table><thead><tr><th>
837
-
838
- Parameter
839
-
840
- </th><th>
841
-
842
- Type
843
-
844
- </th><th>
845
-
846
- Description
847
-
848
- </th></tr></thead>
849
- <tbody><tr><td>
850
-
851
- left
852
-
853
- </td><td>
854
-
855
- number
856
-
857
- </td><td>
858
-
859
- First X coordinate of the rectangle
860
-
861
- </td></tr>
862
- <tr><td>
863
-
864
- right
865
-
866
- </td><td>
867
-
868
- number
869
-
870
- </td><td>
871
-
872
- Second X coordinate of the rectangle
873
-
874
- </td></tr>
875
- <tr><td>
876
-
877
- top
878
-
879
- </td><td>
880
-
881
- number
882
-
883
- </td><td>
884
-
885
- First Y coordinate of the rectangle
886
-
887
- </td></tr>
888
- <tr><td>
889
-
890
- bottom
891
-
892
- </td><td>
893
-
894
- number
895
-
896
- </td><td>
897
-
898
- Second Y coordinate of the rectangle
899
-
900
- </td></tr>
901
- <tr><td>
902
-
903
- leftToRight
904
-
905
- </td><td>
906
-
907
- boolean
908
-
909
- </td><td>
910
-
911
- _(Optional)_ Whether to only get primitives that are fully enclosed by the box selection. If `false`<!-- -->, primitives touched by the selection are also obtained
912
-
913
- </td></tr>
914
- </tbody></table>
915
-
916
- ## Returns
917
-
918
- Promise&lt;Array&lt;[IPCB\_Primitive](../interfaces/IPCB_Primitive.md)<!-- -->&gt;&gt;
919
-
920
- All primitives in the region
921
-
922
- ## Example
923
-
924
- ```javascript
925
- // 1. 创建测试 PCB 并打开
926
- const pcbUuid = await eda.dmt_Pcb.createPcb();
927
- await new Promise(r => setTimeout(r, 1500));
928
- await eda.dmt_EditorControl.openDocument(pcbUuid);
929
- await new Promise(r => setTimeout(r, 1000));
930
-
931
- // 2. 放两个测试焊盘:一个在 (500, 500),一个在 (3000, 3000)
932
- const padA = await eda.pcb_PrimitivePad.create(1, '1', 500, 500, 0, ['ELLIPSE', 60, 60], '', null, 0, 0, 0, false, 0);
933
- const padB = await eda.pcb_PrimitivePad.create(1, '2', 3000, 3000, 0, ['ELLIPSE', 60, 60], '', null, 0, 0, 0, false, 0);
934
-
935
- // 3. 小区域 (0,1000,1000,0) 只盖住第一个焊盘
936
- const small = await eda.pcb_Document.getPrimitivesInRegion(0, 1000, 1000, 0);
937
- console.log('smallRegionCount:', small.length);
938
-
939
- // 4. 大区域 (0,4000,4000,0) 盖住两个焊盘,完全框选模式
940
- const big = await eda.pcb_Document.getPrimitivesInRegion(0, 4000, 4000, 0, true);
941
- console.log('bigRegionCount:', big.length);
942
-
943
- // 5. 清理测试图元和测试 PCB
944
- await eda.pcb_PrimitivePad.delete([padA.getState_PrimitiveId(), padB.getState_PrimitiveId()]);
945
- await eda.dmt_Pcb.deletePcb(pcbUuid);
946
- ```
947
-
948
- ### importautolayoutjsonfile
949
-
950
- # PCB\_Document.importAutoLayoutJsonFile() method
951
-
952
- > 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.
953
-
954
- Import auto layout file (JSON)
955
-
956
- ## Signature
957
-
958
- ```typescript
959
- function importAutoLayoutJsonFile(autoLayoutFile: File): Promise<boolean>;
960
- ```
961
-
962
- ## Parameters
963
-
964
- <table><thead><tr><th>
965
-
966
- Parameter
967
-
968
- </th><th>
969
-
970
- Type
971
-
972
- </th><th>
973
-
974
- Description
975
-
976
- </th></tr></thead>
977
- <tbody><tr><td>
978
-
979
- autoLayoutFile
980
-
981
- </td><td>
982
-
983
- File
984
-
985
- </td><td>
986
-
987
- The JSON file to import
988
-
989
- </td></tr>
990
- </tbody></table>
991
-
992
- ## Returns
993
-
994
- Promise&lt;boolean&gt;
995
-
996
- Whether the import operation is successful
997
-
998
- ## Remarks
999
-
1000
- You can use to read in a file
1001
-
1002
- ## Example
1003
-
1004
- ```javascript
1005
- // 1. 创建测试 PCB 并打开(导入作用于当前激活的 PCB)
1006
- const pcbUuid = await eda.dmt_Pcb.createPcb();
1007
- await new Promise(r => setTimeout(r, 1500));
1008
- await eda.dmt_EditorControl.openDocument(pcbUuid);
1009
- await new Promise(r => setTimeout(r, 1000));
1010
-
1011
- // 2. 构造布局 JSON 文件对象(真实场景:readFileFromFileSystem 读取外部导出的文件)
1012
- const layoutFile = new File([JSON.stringify({})], 'auto-layout.json', { type: 'application/json' });
1013
-
1014
- // 3. 导入自动布局文件
1015
- const imported = await eda.pcb_Document.importAutoLayoutJsonFile(layoutFile);
1016
- console.log('imported:', imported);
1017
-
1018
- // 4. 清理测试 PCB
1019
- await eda.dmt_Pcb.deletePcb(pcbUuid);
1020
- ```
1021
-
1022
- ### importautoroutejsonfile
1023
-
1024
- # PCB\_Document.importAutoRouteJsonFile() method
1025
-
1026
- > 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.
1027
-
1028
- Import auto routing file (JSON)
1029
-
1030
- ## Signature
1031
-
1032
- ```typescript
1033
- function importAutoRouteJsonFile(autoRouteFile: File): Promise<boolean>;
1034
- ```
1035
-
1036
- ## Parameters
1037
-
1038
- <table><thead><tr><th>
1039
-
1040
- Parameter
1041
-
1042
- </th><th>
1043
-
1044
- Type
1045
-
1046
- </th><th>
1047
-
1048
- Description
1049
-
1050
- </th></tr></thead>
1051
- <tbody><tr><td>
1052
-
1053
- autoRouteFile
1054
-
1055
- </td><td>
1056
-
1057
- File
1058
-
1059
- </td><td>
1060
-
1061
- The JSON file to import
1062
-
1063
- </td></tr>
1064
- </tbody></table>
1065
-
1066
- ## Returns
1067
-
1068
- Promise&lt;boolean&gt;
1069
-
1070
- Whether the import operation is successful
1071
-
1072
- ## Remarks
1073
-
1074
- You can use to read in a file
1075
-
1076
- ## Example
1077
-
1078
- ```javascript
1079
- // 1. 创建测试 PCB 并打开(导入作用于当前激活的 PCB)
1080
- const pcbUuid = await eda.dmt_Pcb.createPcb();
1081
- await new Promise(r => setTimeout(r, 1500));
1082
- await eda.dmt_EditorControl.openDocument(pcbUuid);
1083
- await new Promise(r => setTimeout(r, 1000));
1084
-
1085
- // 2. 构造布线 JSON 文件对象(真实场景:readFileFromFileSystem 读取外部导出的文件)
1086
- const routeFile = new File([JSON.stringify({})], 'auto-route.json', { type: 'application/json' });
1087
-
1088
- // 3. 导入自动布线文件
1089
- const imported = await eda.pcb_Document.importAutoRouteJsonFile(routeFile);
1090
- console.log('imported:', imported);
1091
-
1092
- // 4. 清理测试 PCB
1093
- await eda.dmt_Pcb.deletePcb(pcbUuid);
1094
- ```
1095
-
1096
- ### importautoroutesesfile
1097
-
1098
- # PCB\_Document.importAutoRouteSesFile() method
1099
-
1100
- > 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.
1101
-
1102
- Import auto routing file (SES)
1103
-
1104
- ## Signature
1105
-
1106
- ```typescript
1107
- function importAutoRouteSesFile(autoRouteFile: File): Promise<boolean>;
1108
- ```
1109
-
1110
- ## Parameters
1111
-
1112
- <table><thead><tr><th>
1113
-
1114
- Parameter
1115
-
1116
- </th><th>
1117
-
1118
- Type
1119
-
1120
- </th><th>
1121
-
1122
- Description
1123
-
1124
- </th></tr></thead>
1125
- <tbody><tr><td>
1126
-
1127
- autoRouteFile
1128
-
1129
- </td><td>
1130
-
1131
- File
1132
-
1133
- </td><td>
1134
-
1135
- The SES file to import
1136
-
1137
- </td></tr>
1138
- </tbody></table>
1139
-
1140
- ## Returns
1141
-
1142
- Promise&lt;boolean&gt;
1143
-
1144
- Whether the import operation is successful
1145
-
1146
- ## Remarks
1147
-
1148
- You can use to read in a file
1149
-
1150
- ### importchanges
1151
-
1152
- # PCB\_Document.importChanges() method
1153
-
1154
- Import changes from the schematic
1155
-
1156
- ## Signature
1157
-
1158
- ```typescript
1159
- function importChanges(uuid?: string): Promise<boolean>;
1160
- ```
1161
-
1162
- ## Parameters
1163
-
1164
- <table><thead><tr><th>
1165
-
1166
- Parameter
1167
-
1168
- </th><th>
1169
-
1170
- Type
1171
-
1172
- </th><th>
1173
-
1174
- Description
1175
-
1176
- </th></tr></thead>
1177
- <tbody><tr><td>
1178
-
1179
- uuid
1180
-
1181
- </td><td>
1182
-
1183
- string
1184
-
1185
- </td><td>
1186
-
1187
- _(Optional)_ Schematic UUID. By default, the schematic associated with the same Board is used
1188
-
1189
- </td></tr>
1190
- </tbody></table>
1191
-
1192
- ## Returns
1193
-
1194
- Promise&lt;boolean&gt;
1195
-
1196
- Whether the import operation was successful. If the import fails or the free PCB has no schematic UUID passed in, `false` is returned
1197
-
1198
- ## Example
1199
-
1200
- ```javascript
1201
- // 1. 创建测试原理图和测试 PCB
1202
- const schUuid = await eda.dmt_Schematic.createSchematic();
1203
- await new Promise(r => setTimeout(r, 1500));
1204
- const pcbUuid = await eda.dmt_Pcb.createPcb();
1205
- await new Promise(r => setTimeout(r, 1500));
1206
-
1207
- // 2. 创建板子把原理图与 PCB 关联起来(返回板子名称)
1208
- const boardName = await eda.dmt_Board.createBoard(schUuid, pcbUuid);
1209
- await new Promise(r => setTimeout(r, 1500));
1210
- console.log('boardName:', boardName);
1211
-
1212
- // 3. 打开 PCB 并从关联原理图导入变更
1213
- await eda.dmt_EditorControl.openDocument(pcbUuid);
1214
- await new Promise(r => setTimeout(r, 1000));
1215
- const imported = await eda.pcb_Document.importChanges();
1216
- console.log('imported:', imported);
1217
-
1218
- // 4. 清理:删板子、删 PCB、删原理图
1219
- await eda.dmt_Board.deleteBoard(boardName);
1220
- await new Promise(r => setTimeout(r, 1000));
1221
- await eda.dmt_Pcb.deletePcb(pcbUuid);
1222
- await eda.dmt_Schematic.deleteSchematic(schUuid);
1223
- ```
1224
-
1225
- ### navigatetocoordinates
1226
-
1227
- # PCB\_Document.navigateToCoordinates() method
1228
-
1229
- Locate to canvas coordinate
1230
-
1231
- ## Signature
1232
-
1233
- ```typescript
1234
- function navigateToCoordinates(x: number, y: number): Promise<boolean>;
1235
- ```
1236
-
1237
- ## Parameters
1238
-
1239
- <table><thead><tr><th>
1240
-
1241
- Parameter
1242
-
1243
- </th><th>
1244
-
1245
- Type
1246
-
1247
- </th><th>
1248
-
1249
- Description
1250
-
1251
- </th></tr></thead>
1252
- <tbody><tr><td>
1253
-
1254
- x
1255
-
1256
- </td><td>
1257
-
1258
- number
1259
-
1260
- </td><td>
1261
-
1262
- X coordinate
1263
-
1264
- </td></tr>
1265
- <tr><td>
1266
-
1267
- y
1268
-
1269
- </td><td>
1270
-
1271
- number
1272
-
1273
- </td><td>
1274
-
1275
- Y coordinate
1276
-
1277
- </td></tr>
1278
- </tbody></table>
1279
-
1280
- ## Returns
1281
-
1282
- Promise&lt;boolean&gt;
1283
-
1284
- Whether the operation is successful
1285
-
1286
- ## Remarks
1287
-
1288
- This API positions on the front-end canvas to the specified data-level coordinate;
1289
-
1290
- If you want the front-end canvas coordinate to be consistent with the passed-in data during this operation, it is recommended to call the [PCB\_Document.setCanvasOrigin()](./PCB_Document.md) method and set the offset to zero;
1291
-
1292
- The units here are data-level units, which are equivalent to mil on the canvas level in span
1293
-
1294
- ## Example
1295
-
1296
- ```javascript
1297
- // 1. 创建测试 PCB 并打开(视口操作作用于当前激活的 PCB)
1298
- const pcbUuid = await eda.dmt_Pcb.createPcb();
1299
- await new Promise(r => setTimeout(r, 1500));
1300
- await eda.dmt_EditorControl.openDocument(pcbUuid);
1301
- await new Promise(r => setTimeout(r, 1000));
1302
-
1303
- // 2. 定位到数据坐标 (1000, 800)
1304
- const navigated = await eda.pcb_Document.navigateToCoordinates(1000, 800);
1305
- console.log('navigated:', navigated);
1306
-
1307
- // 3. 清理测试 PCB
1308
- await eda.dmt_Pcb.deletePcb(pcbUuid);
1309
- ```
1310
-
1311
- ### navigatetoregion
1312
-
1313
- # PCB\_Document.navigateToRegion() method
1314
-
1315
- > 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.
1316
-
1317
- Locate to canvas region
1318
-
1319
- ## Signature
1320
-
1321
- ```typescript
1322
- function navigateToRegion(
1323
- left: number,
1324
- right: number,
1325
- top: number,
1326
- bottom: number,
1327
- ): Promise<boolean>;
1328
- ```
1329
-
1330
- ## Parameters
1331
-
1332
- <table><thead><tr><th>
1333
-
1334
- Parameter
1335
-
1336
- </th><th>
1337
-
1338
- Type
1339
-
1340
- </th><th>
1341
-
1342
- Description
1343
-
1344
- </th></tr></thead>
1345
- <tbody><tr><td>
1346
-
1347
- left
1348
-
1349
- </td><td>
1350
-
1351
- number
1352
-
1353
- </td><td>
1354
-
1355
- First X coordinate of the rectangle
1356
-
1357
- </td></tr>
1358
- <tr><td>
1359
-
1360
- right
1361
-
1362
- </td><td>
1363
-
1364
- number
1365
-
1366
- </td><td>
1367
-
1368
- Second X coordinate of the rectangle
1369
-
1370
- </td></tr>
1371
- <tr><td>
1372
-
1373
- top
1374
-
1375
- </td><td>
1376
-
1377
- number
1378
-
1379
- </td><td>
1380
-
1381
- First Y coordinate of the rectangle
1382
-
1383
- </td></tr>
1384
- <tr><td>
1385
-
1386
- bottom
1387
-
1388
- </td><td>
1389
-
1390
- number
1391
-
1392
- </td><td>
1393
-
1394
- Second Y coordinate of the rectangle
1395
-
1396
- </td></tr>
1397
- </tbody></table>
1398
-
1399
- ## Returns
1400
-
1401
- Promise&lt;boolean&gt;
1402
-
1403
- Whether the operation is successful
1404
-
1405
- ## Remarks
1406
-
1407
- This API positions on the front-end canvas to the specified region. The region data is an offset relative to the data origin;
1408
-
1409
- For example: the passed-in data is `{left: 0, right: 60, top: 100, bottom: -20}` =<!-- -->&gt; `navigateToRegion(0, 60, 100, -20)`<!-- -->, then the canvas will be positioned to a rectangular range centered at `[30, 40]` with a length of `60` in the x-axis direction and `120` in the y-axis direction;
1410
-
1411
- This API does not perform zooming, but it will generate a rectangle frame indicating the positioning center and the region range;
1412
-
1413
- The units here are data-level units, which are equivalent to mil on the canvas level in span
1414
-
1415
- ## Example
1416
-
1417
- ```javascript
1418
- // 1. 创建测试 PCB 并打开(视口操作作用于当前激活的 PCB)
1419
- const pcbUuid = await eda.dmt_Pcb.createPcb();
1420
- await new Promise(r => setTimeout(r, 1500));
1421
- await eda.dmt_EditorControl.openDocument(pcbUuid);
1422
- await new Promise(r => setTimeout(r, 1000));
1423
-
1424
- // 2. 定位到矩形区域:X 从 0 到 2000,Y 从 2000 到 0(视口将以中心 (1000,1000) 呈现)
1425
- const navigated = await eda.pcb_Document.navigateToRegion(0, 2000, 2000, 0);
1426
- console.log('navigated:', navigated);
1427
-
1428
- // 3. 清理测试 PCB
1429
- await eda.dmt_Pcb.deletePcb(pcbUuid);
1430
- ```
1431
-
1432
- ### save
1433
-
1434
- # PCB\_Document.save() method
1435
-
1436
- Save Document
1437
-
1438
- ## Signature
1439
-
1440
- ```typescript
1441
- function save(): Promise<boolean>;
1442
- ```
1443
-
1444
- ## Returns
1445
-
1446
- Promise&lt;boolean&gt;
1447
-
1448
- Whether the save operation was successful. Errors such as save failure and upload failure all return `false`
1449
-
1450
- ## Example
1451
-
1452
- ```javascript
1453
- // 1. 创建测试 PCB 并打开(保存作用于当前激活的 PCB)
1454
- const pcbUuid = await eda.dmt_Pcb.createPcb();
1455
- await new Promise(r => setTimeout(r, 1500));
1456
- await eda.dmt_EditorControl.openDocument(pcbUuid);
1457
- await new Promise(r => setTimeout(r, 1000));
1458
-
1459
- // 2. 保存当前 PCB
1460
- const saved = await eda.pcb_Document.save();
1461
- console.log('saved:', saved);
1462
-
1463
- // 3. 清理测试 PCB
1464
- await eda.dmt_Pcb.deletePcb(pcbUuid);
1465
- ```
1466
-
1467
- ### setcanvasorigin
1468
-
1469
- # PCB\_Document.setCanvasOrigin() method
1470
-
1471
- Set the offset coordinate of the canvas origin relative to the data origin
1472
-
1473
- ## Signature
1474
-
1475
- ```typescript
1476
- function setCanvasOrigin(offsetX: number, offsetY: number): Promise<boolean>;
1477
- ```
1478
-
1479
- ## Parameters
1480
-
1481
- <table><thead><tr><th>
1482
-
1483
- Parameter
1484
-
1485
- </th><th>
1486
-
1487
- Type
1488
-
1489
- </th><th>
1490
-
1491
- Description
1492
-
1493
- </th></tr></thead>
1494
- <tbody><tr><td>
1495
-
1496
- offsetX
1497
-
1498
- </td><td>
1499
-
1500
- number
1501
-
1502
- </td><td>
1503
-
1504
- X coordinate offset of the canvas origin relative to the data origin
1505
-
1506
- </td></tr>
1507
- <tr><td>
1508
-
1509
- offsetY
1510
-
1511
- </td><td>
1512
-
1513
- number
1514
-
1515
- </td><td>
1516
-
1517
- Y coordinate offset of the canvas origin relative to the data origin
1518
-
1519
- </td></tr>
1520
- </tbody></table>
1521
-
1522
- ## Returns
1523
-
1524
- Promise&lt;boolean&gt;
1525
-
1526
- Whether the operation is successful
1527
-
1528
- ## Remarks
1529
-
1530
- The coordinates displayed on the EasyEDA Pro front end are all relative to the canvas origin;
1531
-
1532
- The EasyEDA Pro API uses the data origin;
1533
-
1534
- If you want the front-end canvas coordinate to be consistent with the data during API operations, it is recommended to call this method and set the offset to zero, i.e. `setCanvasOrigin(0, 0)`<!-- -->;
1535
-
1536
- The units here are data-level units, which are equivalent to mil on the canvas level in span
1537
-
1538
- ## Example
1539
-
1540
- ```javascript
1541
- // 1. 创建测试 PCB 并打开(原点设置作用于当前激活的 PCB)
1542
- const pcbUuid = await eda.dmt_Pcb.createPcb();
1543
- await new Promise(r => setTimeout(r, 1500));
1544
- await eda.dmt_EditorControl.openDocument(pcbUuid);
1545
- await new Promise(r => setTimeout(r, 1000));
1546
-
1547
- // 2. 设置画布原点偏移为 (50, 100)
1548
- const set = await eda.pcb_Document.setCanvasOrigin(50, 100);
1549
- console.log('set:', set);
1550
-
1551
- // 3. 读回偏移验证已生效
1552
- const origin = await eda.pcb_Document.getCanvasOrigin();
1553
- console.log('origin:', JSON.stringify(origin));
1554
-
1555
- // 4. 清理测试 PCB(偏移随文档一起删除)
1556
- await eda.dmt_Pcb.deletePcb(pcbUuid);
1557
- ```
1558
-
1559
- ### startcalculatingratline
1560
-
1561
- # PCB\_Document.startCalculatingRatline() method
1562
-
1563
- > Warning: This API is now obsolete.
1564
- >
1565
- > since EDA v4.2
1566
-
1567
- Start the ratline calculation function
1568
-
1569
- ## Signature
1570
-
1571
- ```typescript
1572
- function startCalculatingRatline(): Promise<boolean>;
1573
- ```
1574
-
1575
- ## Returns
1576
-
1577
- Promise&lt;boolean&gt;
1578
-
1579
- Whether the operation is successful
1580
-
1581
- ## Remarks
1582
-
1583
- A ratline calculation will be triggered when starting
1584
-
1585
- ## Example
1586
-
1587
- ```javascript
1588
- // 1. 创建测试 PCB 并打开(飞线开关作用于当前激活的 PCB)
1589
- const pcbUuid = await eda.dmt_Pcb.createPcb();
1590
- await new Promise(r => setTimeout(r, 1500));
1591
- await eda.dmt_EditorControl.openDocument(pcbUuid);
1592
- await new Promise(r => setTimeout(r, 1000));
1593
-
1594
- // 2. 启动飞线计算
1595
- const started = await eda.pcb_Document.startCalculatingRatline();
1596
- console.log('started:', started);
1597
-
1598
- // 3. 清理测试 PCB
1599
- await eda.dmt_Pcb.deletePcb(pcbUuid);
1600
- ```
1601
-
1602
- ### startcanvasupdatecalculation
1603
-
1604
- # PCB\_Document.startCanvasUpdateCalculation() method
1605
-
1606
- > 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.
1607
-
1608
- Start canvas update calculation
1609
-
1610
- ## Signature
1611
-
1612
- ```typescript
1613
- function startCanvasUpdateCalculation(): Promise<boolean>;
1614
- ```
1615
-
1616
- ## Returns
1617
-
1618
- Promise&lt;boolean&gt;
1619
-
1620
- Whether the operation is successful
1621
-
1622
- ## Remarks
1623
-
1624
- Canvas update calculation includes canvas render updates, property panel updates, etc.
1625
-
1626
- If you do not understand the meaning of this switch, do not call this API for any operation ADD since EDA v4.2
1627
-
1628
- ### stopcalculatingratline
1629
-
1630
- # PCB\_Document.stopCalculatingRatline() method
1631
-
1632
- > Warning: This API is now obsolete.
1633
- >
1634
- > since EDA v4.2
1635
-
1636
- Stop the ratline calculation function
1637
-
1638
- ## Signature
1639
-
1640
- ```typescript
1641
- function stopCalculatingRatline(): Promise<boolean>;
1642
- ```
1643
-
1644
- ## Returns
1645
-
1646
- Promise&lt;boolean&gt;
1647
-
1648
- Whether the operation is successful
1649
-
1650
- ## Example
1651
-
1652
- ```javascript
1653
- // 1. 创建测试 PCB 并打开(飞线开关作用于当前激活的 PCB)
1654
- const pcbUuid = await eda.dmt_Pcb.createPcb();
1655
- await new Promise(r => setTimeout(r, 1500));
1656
- await eda.dmt_EditorControl.openDocument(pcbUuid);
1657
- await new Promise(r => setTimeout(r, 1000));
1658
-
1659
- // 2. 停止飞线计算
1660
- const stopped = await eda.pcb_Document.stopCalculatingRatline();
1661
- console.log('stopped:', stopped);
1662
-
1663
- // 3. 清理测试 PCB
1664
- await eda.dmt_Pcb.deletePcb(pcbUuid);
1665
- ```
1666
-
1667
- ### stopcanvasupdatecalculation
1668
-
1669
- # PCB\_Document.stopCanvasUpdateCalculation() method
1670
-
1671
- > 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.
1672
-
1673
- Stop canvas update calculation
1674
-
1675
- ## Signature
1676
-
1677
- ```typescript
1678
- function stopCanvasUpdateCalculation(): Promise<boolean>;
1679
- ```
1680
-
1681
- ## Returns
1682
-
1683
- Promise&lt;boolean&gt;
1684
-
1685
- Whether the operation is successful
1686
-
1687
- ## Remarks
1688
-
1689
- Canvas update calculation includes canvas render updates, property panel updates, etc.
1690
-
1691
- If you do not understand the meaning of this switch, do not call this API for any operation ADD since EDA v4.2
1692
-
1693
- ### triggercanvasupdatecalculation
1694
-
1695
- # PCB\_Document.triggerCanvasUpdateCalculation() method
1696
-
1697
- > 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.
1698
-
1699
- Trigger a canvas update calculation
1700
-
1701
- ## Signature
1702
-
1703
- ```typescript
1704
- function triggerCanvasUpdateCalculation(): Promise<boolean>;
1705
- ```
1706
-
1707
- ## Returns
1708
-
1709
- Promise&lt;boolean&gt;
1710
-
1711
- Whether the operation is successful
1712
-
1713
- ## Remarks
1714
-
1715
- Canvas update calculation includes canvas render updates, property panel updates, etc.
1716
-
1717
- If you do not understand the meaning of this switch, do not call this API for any operation ADD since EDA v4.2
1718
-
1719
- ### zoomtoboardoutline
1720
-
1721
- # PCB\_Document.zoomToBoardOutline() method
1722
-
1723
- > 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.
1724
-
1725
- Zoom to the board outline (fit the board outline)
1726
-
1727
- ## Signature
1728
-
1729
- ```typescript
1730
- function zoomToBoardOutline(): Promise<boolean>;
1731
- ```
1732
-
1733
- ## Returns
1734
-
1735
- Promise&lt;boolean&gt;
1736
-
1737
- Whether the operation is successful
1738
-
1739
- ## Example
1740
-
1741
- ```javascript
1742
- // 1. 创建测试 PCB 并打开(视口操作作用于当前激活的 PCB)
1743
- const pcbUuid = await eda.dmt_Pcb.createPcb();
1744
- await new Promise(r => setTimeout(r, 1500));
1745
- await eda.dmt_EditorControl.openDocument(pcbUuid);
1746
- await new Promise(r => setTimeout(r, 1000));
1747
-
1748
- // 2. 缩放到板框
1749
- const zoomed = await eda.pcb_Document.zoomToBoardOutline();
1750
- console.log('zoomed:', zoomed);
1751
-
1752
- // 3. 清理测试 PCB
1753
- await eda.dmt_Pcb.deletePcb(pcbUuid);
1754
- ```
1
+ # PCB\_Document class
2
+
3
+ PCB &amp; footprint / document operation class
4
+
5
+ ## Signature
6
+
7
+ ```typescript
8
+ class PCB_Document
9
+ ```
10
+
11
+ ## Remarks
12
+
13
+ Operations performed on the design document as a whole
14
+
15
+ ## Methods
16
+
17
+ <table><thead><tr><th>
18
+
19
+ Method
20
+
21
+ </th><th>
22
+
23
+ Modifiers
24
+
25
+ </th><th>
26
+
27
+ Description
28
+
29
+ </th></tr></thead>
30
+ <tbody><tr><td>
31
+
32
+ [autoLayout()](./PCB_Document.md)
33
+
34
+ </td><td>
35
+
36
+ </td><td>
37
+
38
+ **_(BETA)_** Auto layout
39
+
40
+ </td></tr>
41
+ <tr><td>
42
+
43
+ [autoRouting(props)](./PCB_Document.md)
44
+
45
+ </td><td>
46
+
47
+ </td><td>
48
+
49
+ **_(BETA)_** Auto routing
50
+
51
+ </td></tr>
52
+ <tr><td>
53
+
54
+ [clearRouting(type)](./PCB_Document.md)
55
+
56
+ </td><td>
57
+
58
+ </td><td>
59
+
60
+ **_(BETA)_** Clear routing
61
+
62
+ </td></tr>
63
+ <tr><td>
64
+
65
+ [convertCanvasOriginToDataOrigin(x, y)](./PCB_Document.md)
66
+
67
+ </td><td>
68
+
69
+ </td><td>
70
+
71
+ Input a canvas coordinate and return the data coordinate corresponding to that coordinate
72
+
73
+ </td></tr>
74
+ <tr><td>
75
+
76
+ [convertDataOriginToCanvasOrigin(x, y)](./PCB_Document.md)
77
+
78
+ </td><td>
79
+
80
+ </td><td>
81
+
82
+ Input a data coordinate and return the canvas coordinate corresponding to that coordinate
83
+
84
+ </td></tr>
85
+ <tr><td>
86
+
87
+ [getCalculatingRatlineStatus()](./PCB_Document.md)
88
+
89
+ </td><td>
90
+
91
+ </td><td>
92
+
93
+ Get the current ratline calculation function status
94
+
95
+ </td></tr>
96
+ <tr><td>
97
+
98
+ [getCanvasOrigin()](./PCB_Document.md)
99
+
100
+ </td><td>
101
+
102
+ </td><td>
103
+
104
+ Get the offset coordinate of the canvas origin relative to the data origin
105
+
106
+ </td></tr>
107
+ <tr><td>
108
+
109
+ [getCanvasUpdateCalculationStatus()](./PCB_Document.md)
110
+
111
+ </td><td>
112
+
113
+ </td><td>
114
+
115
+ **_(BETA)_** 查询当前画布更新计算状态
116
+
117
+ </td></tr>
118
+ <tr><td>
119
+
120
+ [getCurrentFilterConfiguration()](./PCB_Document.md)
121
+
122
+ </td><td>
123
+
124
+ </td><td>
125
+
126
+ **_(BETA)_** Get Current canvas filter configuration
127
+
128
+ </td></tr>
129
+ <tr><td>
130
+
131
+ [getPrimitiveAtPoint(x, y)](./PCB_Document.md)
132
+
133
+ </td><td>
134
+
135
+ </td><td>
136
+
137
+ **_(BETA)_** Get The primitive at the coordinate point
138
+
139
+ </td></tr>
140
+ <tr><td>
141
+
142
+ [getPrimitivesInRegion(left, right, top, bottom, leftToRight)](./PCB_Document.md)
143
+
144
+ </td><td>
145
+
146
+ </td><td>
147
+
148
+ **_(BETA)_** Get All primitives in the region
149
+
150
+ </td></tr>
151
+ <tr><td>
152
+
153
+ [importAutoLayoutJsonFile(autoLayoutFile)](./PCB_Document.md)
154
+
155
+ </td><td>
156
+
157
+ </td><td>
158
+
159
+ **_(BETA)_** Import auto layout file (JSON)
160
+
161
+ </td></tr>
162
+ <tr><td>
163
+
164
+ [importAutoRouteJsonFile(autoRouteFile)](./PCB_Document.md)
165
+
166
+ </td><td>
167
+
168
+ </td><td>
169
+
170
+ **_(BETA)_** Import auto routing file (JSON)
171
+
172
+ </td></tr>
173
+ <tr><td>
174
+
175
+ [importAutoRouteSesFile(autoRouteFile)](./PCB_Document.md)
176
+
177
+ </td><td>
178
+
179
+ </td><td>
180
+
181
+ **_(BETA)_** Import auto routing file (SES)
182
+
183
+ </td></tr>
184
+ <tr><td>
185
+
186
+ [importChanges(uuid)](./PCB_Document.md)
187
+
188
+ </td><td>
189
+
190
+ </td><td>
191
+
192
+ Import changes from the schematic
193
+
194
+ </td></tr>
195
+ <tr><td>
196
+
197
+ [navigateToCoordinates(x, y)](./PCB_Document.md)
198
+
199
+ </td><td>
200
+
201
+ </td><td>
202
+
203
+ Locate to canvas coordinate
204
+
205
+ </td></tr>
206
+ <tr><td>
207
+
208
+ [navigateToRegion(left, right, top, bottom)](./PCB_Document.md)
209
+
210
+ </td><td>
211
+
212
+ </td><td>
213
+
214
+ **_(BETA)_** Locate to canvas region
215
+
216
+ </td></tr>
217
+ <tr><td>
218
+
219
+ [save()](./PCB_Document.md)
220
+
221
+ </td><td>
222
+
223
+ </td><td>
224
+
225
+ Save Document
226
+
227
+ </td></tr>
228
+ <tr><td>
229
+
230
+ [setCanvasOrigin(offsetX, offsetY)](./PCB_Document.md)
231
+
232
+ </td><td>
233
+
234
+ </td><td>
235
+
236
+ Set the offset coordinate of the canvas origin relative to the data origin
237
+
238
+ </td></tr>
239
+ <tr><td>
240
+
241
+ [startCalculatingRatline()](./PCB_Document.md)
242
+
243
+ </td><td>
244
+
245
+ </td><td>
246
+
247
+ Start the ratline calculation function
248
+
249
+ </td></tr>
250
+ <tr><td>
251
+
252
+ [startCanvasUpdateCalculation()](./PCB_Document.md)
253
+
254
+ </td><td>
255
+
256
+ </td><td>
257
+
258
+ **_(BETA)_** 开始画布更新计算
259
+
260
+ </td></tr>
261
+ <tr><td>
262
+
263
+ [stopCalculatingRatline()](./PCB_Document.md)
264
+
265
+ </td><td>
266
+
267
+ </td><td>
268
+
269
+ Stop the ratline calculation function
270
+
271
+ </td></tr>
272
+ <tr><td>
273
+
274
+ [stopCanvasUpdateCalculation()](./PCB_Document.md)
275
+
276
+ </td><td>
277
+
278
+ </td><td>
279
+
280
+ **_(BETA)_** 停止画布更新计算
281
+
282
+ </td></tr>
283
+ <tr><td>
284
+
285
+ [triggerCanvasUpdateCalculation()](./PCB_Document.md)
286
+
287
+ </td><td>
288
+
289
+ </td><td>
290
+
291
+ **_(BETA)_** 触发一次画布更新计算
292
+
293
+ </td></tr>
294
+ <tr><td>
295
+
296
+ [zoomToBoardOutline()](./PCB_Document.md)
297
+
298
+ </td><td>
299
+
300
+ </td><td>
301
+
302
+ **_(BETA)_** Zoom to the board outline (fit the board outline)
303
+
304
+ </td></tr>
305
+ </tbody></table>
306
+
307
+ ---
308
+
309
+ ## 方法详情
310
+
311
+ ### autolayout
312
+
313
+ # PCB\_Document.autoLayout() method
314
+
315
+ > 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.
316
+
317
+ Auto layout
318
+
319
+ ## Signature
320
+
321
+ ```typescript
322
+ function autoLayout(): Promise<IPCB_AutoLayoutResult>;
323
+ ```
324
+
325
+ ## Returns
326
+
327
+ Promise&lt;[IPCB\_AutoLayoutResult](../interfaces/IPCB_AutoLayoutResult.md)<!-- -->&gt;
328
+
329
+ Auto layout result
330
+
331
+ ## Remarks
332
+
333
+ ADD since EDA v3.2.150 本接口预期将会执行较长时间,可以尝试异步处理或增加超时时限
334
+
335
+ / EDA v4.1.66
336
+
337
+ ### autorouting
338
+
339
+ # PCB\_Document.autoRouting() method
340
+
341
+ > 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.
342
+
343
+ Auto routing
344
+
345
+ ## Signature
346
+
347
+ ```typescript
348
+ function autoRouting(props?: IPCB_AutoRoutingProps): Promise<IPCB_AutoRoutingResult>;
349
+ ```
350
+
351
+ ## Parameters
352
+
353
+ <table><thead><tr><th>
354
+
355
+ Parameter
356
+
357
+ </th><th>
358
+
359
+ Type
360
+
361
+ </th><th>
362
+
363
+ Description
364
+
365
+ </th></tr></thead>
366
+ <tbody><tr><td>
367
+
368
+ props
369
+
370
+ </td><td>
371
+
372
+ [IPCB\_AutoRoutingProps](../interfaces/IPCB_AutoRoutingProps.md)
373
+
374
+ </td><td>
375
+
376
+ _(Optional)_ Auto routing parameter
377
+
378
+ </td></tr>
379
+ </tbody></table>
380
+
381
+ ## Returns
382
+
383
+ Promise&lt;[IPCB\_AutoRoutingResult](../interfaces/IPCB_AutoRoutingResult.md)<!-- -->&gt;
384
+
385
+ Auto routing result
386
+
387
+ ## Remarks
388
+
389
+ ADD since EDA v3.2.150 If no parameters are passed in, auto routing will be performed for all unrouted nets
390
+
391
+ 本接口预期将会执行较长时间,可以尝试异步处理或增加超时时限
392
+
393
+ 注意事项: - 本接口内部存在固定的 900 秒(15 分钟)硬上限,CLI 的 `--timeout` 参数无法覆盖该上限; - 超时或失败后,中间几何结果不会提交(超时后调用 `save()` 图元可能仍为 0/0),如需保留中间结果请改用 作业模型; - `props.layers` 必须传入\*\*启用层\*\*(`layerStatus !== NOT_USED`<!-- -->),传停用层会被静默忽略
394
+
395
+ / EDA v4.1.66
396
+
397
+ ## Example
398
+
399
+ ```javascript
400
+ // 对所有未布线的网络进行自动布线
401
+ const result = await eda.pcb_Document.autoRouting();
402
+ console.log(`布线完成:${result.routedNets}/${result.totalNets}`);
403
+
404
+ // 指定网络进行自动布线,并忽略部分网络
405
+ const result = await eda.pcb_Document.autoRouting({
406
+ nets: ['VCC', 'GND', 'SDA', 'SCL'],
407
+ ignoreNets: ['NC'],
408
+ cornerStyle: EPCB_AutoRoutingCornerStyle.DEGREE_45,
409
+ optimization: EPCB_AutoRoutingOptimization.COMPLETION,
410
+ });
411
+ ```
412
+
413
+ ### clearrouting
414
+
415
+ # PCB\_Document.clearRouting() method
416
+
417
+ > 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.
418
+
419
+ Clear routing
420
+
421
+ ## Signature
422
+
423
+ ```typescript
424
+ function clearRouting(type?: 'all' | 'net' | 'connection'): Promise<boolean>;
425
+ ```
426
+
427
+ ## Parameters
428
+
429
+ <table><thead><tr><th>
430
+
431
+ Parameter
432
+
433
+ </th><th>
434
+
435
+ Type
436
+
437
+ </th><th>
438
+
439
+ Description
440
+
441
+ </th></tr></thead>
442
+ <tbody><tr><td>
443
+
444
+ type
445
+
446
+ </td><td>
447
+
448
+ 'all' \| 'net' \| 'connection'
449
+
450
+ </td><td>
451
+
452
+ _(Optional)_ Clear type. If you need to specify a clear type, select the specified primitive in advance
453
+
454
+ </td></tr>
455
+ </tbody></table>
456
+
457
+ ## Returns
458
+
459
+ Promise&lt;boolean&gt;
460
+
461
+ ### convertcanvasorigintodataorigin
462
+
463
+ # PCB\_Document.convertCanvasOriginToDataOrigin() method
464
+
465
+ Input a canvas coordinate and return the data coordinate corresponding to that coordinate
466
+
467
+ ## Signature
468
+
469
+ ```typescript
470
+ function convertCanvasOriginToDataOrigin(x: number, y: number): Promise<{ x: number; y: number }>;
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
+ x
491
+
492
+ </td><td>
493
+
494
+ number
495
+
496
+ </td><td>
497
+
498
+ </td></tr>
499
+ <tr><td>
500
+
501
+ y
502
+
503
+ </td><td>
504
+
505
+ number
506
+
507
+ </td><td>
508
+
509
+ </td></tr>
510
+ </tbody></table>
511
+
512
+ ## Returns
513
+
514
+ Promise&lt;{ x: number; y: number }&gt;
515
+
516
+ Data origin coordinate
517
+
518
+ ## Remarks
519
+
520
+ The coordinates displayed on the EasyEDA front end are all relative to the canvas origin; the EasyEDA API uses the data origin; when creating a PCB, the default canvas origin equals the data origin
521
+
522
+ ## Example
523
+
524
+ ```javascript
525
+ // 1. 创建测试 PCB 并打开(文档级 API 作用于当前激活的 PCB)
526
+ const pcbUuid = await eda.dmt_Pcb.createPcb();
527
+ await new Promise(r => setTimeout(r, 1500));
528
+ await eda.dmt_EditorControl.openDocument(pcbUuid);
529
+ await new Promise(r => setTimeout(r, 1000));
530
+
531
+ // 2. 换算画布坐标 (300, 400)。新建 PCB 画布原点与数据原点重合,换算值不变
532
+ const before = await eda.pcb_Document.convertCanvasOriginToDataOrigin(300, 400);
533
+ console.log('before:', JSON.stringify(before));
534
+
535
+ // 3. 设置画布原点偏移后再换算同一坐标,观察映射随之变化
536
+ await eda.pcb_Document.setCanvasOrigin(50, 100);
537
+ const after = await eda.pcb_Document.convertCanvasOriginToDataOrigin(300, 400);
538
+ console.log('after:', JSON.stringify(after));
539
+
540
+ // 4. 清理测试 PCB(偏移随文档一起删除)
541
+ await eda.dmt_Pcb.deletePcb(pcbUuid);
542
+ ```
543
+
544
+ ### convertdataorigintocanvasorigin
545
+
546
+ # PCB\_Document.convertDataOriginToCanvasOrigin() method
547
+
548
+ Input a data coordinate and return the canvas coordinate corresponding to that coordinate
549
+
550
+ ## Signature
551
+
552
+ ```typescript
553
+ function convertDataOriginToCanvasOrigin(x: number, y: number): Promise<{ x: number; y: number }>;
554
+ ```
555
+
556
+ ## Parameters
557
+
558
+ <table><thead><tr><th>
559
+
560
+ Parameter
561
+
562
+ </th><th>
563
+
564
+ Type
565
+
566
+ </th><th>
567
+
568
+ Description
569
+
570
+ </th></tr></thead>
571
+ <tbody><tr><td>
572
+
573
+ x
574
+
575
+ </td><td>
576
+
577
+ number
578
+
579
+ </td><td>
580
+
581
+ Data origin X
582
+
583
+ </td></tr>
584
+ <tr><td>
585
+
586
+ y
587
+
588
+ </td><td>
589
+
590
+ number
591
+
592
+ </td><td>
593
+
594
+ Data origin Y
595
+
596
+ </td></tr>
597
+ </tbody></table>
598
+
599
+ ## Returns
600
+
601
+ Promise&lt;{ x: number; y: number }&gt;
602
+
603
+ Canvas origin coordinate
604
+
605
+ ## Remarks
606
+
607
+ The coordinates displayed on the EasyEDA front end are all relative to the canvas origin; the EasyEDA API uses the data origin; when creating a PCB, the default canvas origin equals the data origin
608
+
609
+ ## Example
610
+
611
+ ```javascript
612
+ // 1. 创建测试 PCB 并打开(文档级 API 作用于当前激活的 PCB)
613
+ const pcbUuid = await eda.dmt_Pcb.createPcb();
614
+ await new Promise(r => setTimeout(r, 1500));
615
+ await eda.dmt_EditorControl.openDocument(pcbUuid);
616
+ await new Promise(r => setTimeout(r, 1000));
617
+
618
+ // 2. 换算数据坐标 (300, 400)。新建 PCB 画布原点与数据原点重合,换算值不变
619
+ const before = await eda.pcb_Document.convertDataOriginToCanvasOrigin(300, 400);
620
+ console.log('before:', JSON.stringify(before));
621
+
622
+ // 3. 设置画布原点偏移后再换算同一坐标,观察映射随之变化
623
+ await eda.pcb_Document.setCanvasOrigin(50, 100);
624
+ const after = await eda.pcb_Document.convertDataOriginToCanvasOrigin(300, 400);
625
+ console.log('after:', JSON.stringify(after));
626
+
627
+ // 4. 清理测试 PCB(偏移随文档一起删除)
628
+ await eda.dmt_Pcb.deletePcb(pcbUuid);
629
+ ```
630
+
631
+ ### getcalculatingratlinestatus
632
+
633
+ # PCB\_Document.getCalculatingRatlineStatus() method
634
+
635
+ > Warning: This API is now obsolete.
636
+ >
637
+ > since EDA v4.2
638
+
639
+ Get the current ratline calculation function status
640
+
641
+ ## Signature
642
+
643
+ ```typescript
644
+ function getCalculatingRatlineStatus(): Promise<
645
+ EPCB_DocumentRatlineCalculatingActiveStatus | undefined
646
+ >;
647
+ ```
648
+
649
+ ## Returns
650
+
651
+ Promise&lt;[EPCB\_DocumentRatlineCalculatingActiveStatus](../enums/EPCB_DocumentRatlineCalculatingActiveStatus.md) \| undefined&gt;
652
+
653
+ Function state
654
+
655
+ ### getcanvasorigin
656
+
657
+ # PCB\_Document.getCanvasOrigin() method
658
+
659
+ Get the offset coordinate of the canvas origin relative to the data origin
660
+
661
+ ## Signature
662
+
663
+ ```typescript
664
+ function getCanvasOrigin(): Promise<{ offsetX: number; offsetY: number }>;
665
+ ```
666
+
667
+ ## Returns
668
+
669
+ Promise&lt;{ offsetX: number; offsetY: number }&gt;
670
+
671
+ The offset coordinate of the canvas origin relative to the data origin
672
+
673
+ ## Remarks
674
+
675
+ The coordinates displayed on the EasyEDA Pro front end are all relative to the canvas origin;
676
+
677
+ The EasyEDA Pro API uses the data origin;
678
+
679
+ If the returned data is `{ canvasOriginOffsetX: 100, canvasOriginOffsetY: 200 }`<!-- -->, it means the canvas origin is at a position 100 units to the right and 200 units up from the data origin;
680
+
681
+ The units here are data-level units, which are equivalent to mil on the canvas level in span
682
+
683
+ ### getcanvasupdatecalculationstatus
684
+
685
+ # PCB\_Document.getCanvasUpdateCalculationStatus() method
686
+
687
+ > 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.
688
+
689
+ 查询当前画布更新计算状态
690
+
691
+ ## Signature
692
+
693
+ ```typescript
694
+ function getCanvasUpdateCalculationStatus(): Promise<
695
+ EPCB_DocumentCanvasUpdateCalculationActiveStatus | undefined
696
+ >;
697
+ ```
698
+
699
+ ## Returns
700
+
701
+ Promise&lt;[EPCB\_DocumentCanvasUpdateCalculationActiveStatus](../enums/EPCB_DocumentCanvasUpdateCalculationActiveStatus.md) \| undefined&gt;
702
+
703
+ 画布更新计算功能状态
704
+
705
+ ## Remarks
706
+
707
+ 画布更新计算包括画布渲染更新、属性面板更新等 ADD since EDA v4.2
708
+
709
+ ### getcurrentfilterconfiguration
710
+
711
+ # PCB\_Document.getCurrentFilterConfiguration() method
712
+
713
+ > 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.
714
+
715
+ Get Current canvas filter configuration
716
+
717
+ ## Signature
718
+
719
+ ```typescript
720
+ function getCurrentFilterConfiguration(): Promise<Record<string, any> | undefined>;
721
+ ```
722
+
723
+ ## Returns
724
+
725
+ Promise&lt;Record&lt;string, any&gt; \| undefined&gt;
726
+
727
+ Current canvas filter configuration; `undefined` indicates that the retrieval failed
728
+
729
+ ### getprimitiveatpoint
730
+
731
+ # PCB\_Document.getPrimitiveAtPoint() method
732
+
733
+ > 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.
734
+
735
+ Get The primitive at the coordinate point
736
+
737
+ ## Signature
738
+
739
+ ```typescript
740
+ function getPrimitiveAtPoint(x: number, y: number): Promise<IPCB_Primitive | undefined>;
741
+ ```
742
+
743
+ ## Parameters
744
+
745
+ <table><thead><tr><th>
746
+
747
+ Parameter
748
+
749
+ </th><th>
750
+
751
+ Type
752
+
753
+ </th><th>
754
+
755
+ Description
756
+
757
+ </th></tr></thead>
758
+ <tbody><tr><td>
759
+
760
+ x
761
+
762
+ </td><td>
763
+
764
+ number
765
+
766
+ </td><td>
767
+
768
+ Coordinate point X
769
+
770
+ </td></tr>
771
+ <tr><td>
772
+
773
+ y
774
+
775
+ </td><td>
776
+
777
+ number
778
+
779
+ </td><td>
780
+
781
+ Coordinate point Y
782
+
783
+ </td></tr>
784
+ </tbody></table>
785
+
786
+ ## Returns
787
+
788
+ Promise&lt;[IPCB\_Primitive](../interfaces/IPCB_Primitive.md) \| undefined&gt;
789
+
790
+ The primitive at the coordinate point. If no primitive can be found at the coordinate point, `undefined` will be returned
791
+
792
+ ## Remarks
793
+
794
+ This operation is similar to clicking with the mouse on the front end; it will get the primitive at the specified coordinate point
795
+
796
+ ## Example
797
+
798
+ ```javascript
799
+ // 1. 创建测试 PCB 并打开
800
+ const pcbUuid = await eda.dmt_Pcb.createPcb();
801
+ await new Promise(r => setTimeout(r, 1500));
802
+ await eda.dmt_EditorControl.openDocument(pcbUuid);
803
+ await new Promise(r => setTimeout(r, 1000));
804
+
805
+ // 2. 在 (500, 500) 放一个测试焊盘作为拾取目标
806
+ const pad = await eda.pcb_PrimitivePad.create(1, '1', 500, 500, 0, ['ELLIPSE', 60, 60], '', null, 0, 0, 0, false, 0);
807
+ const padId = pad.getState_PrimitiveId();
808
+
809
+ // 3. 拾取焊盘中心点,返回该焊盘图元
810
+ const hit = await eda.pcb_Document.getPrimitiveAtPoint(500, 500);
811
+ console.log('hitPrimitiveId:', hit.getState_PrimitiveId());
812
+
813
+ // 4. 拾取空白坐标点,返回 undefined
814
+ const miss = await eda.pcb_Document.getPrimitiveAtPoint(90000, 90000);
815
+ console.log('空白坐标点:', miss === undefined ? '未找到图元' : '找到图元');
816
+
817
+ // 5. 清理测试图元和测试 PCB
818
+ await eda.pcb_PrimitivePad.delete([padId]);
819
+ await eda.dmt_Pcb.deletePcb(pcbUuid);
820
+ ```
821
+
822
+ ### getprimitivesinregion
823
+
824
+ # PCB\_Document.getPrimitivesInRegion() method
825
+
826
+ > 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.
827
+
828
+ Get All primitives in the region
829
+
830
+ ## Signature
831
+
832
+ ```typescript
833
+ function getPrimitivesInRegion(
834
+ left: number,
835
+ right: number,
836
+ top: number,
837
+ bottom: number,
838
+ leftToRight?: boolean,
839
+ ): Promise<Array<IPCB_Primitive>>;
840
+ ```
841
+
842
+ ## Parameters
843
+
844
+ <table><thead><tr><th>
845
+
846
+ Parameter
847
+
848
+ </th><th>
849
+
850
+ Type
851
+
852
+ </th><th>
853
+
854
+ Description
855
+
856
+ </th></tr></thead>
857
+ <tbody><tr><td>
858
+
859
+ left
860
+
861
+ </td><td>
862
+
863
+ number
864
+
865
+ </td><td>
866
+
867
+ First X coordinate of the rectangle
868
+
869
+ </td></tr>
870
+ <tr><td>
871
+
872
+ right
873
+
874
+ </td><td>
875
+
876
+ number
877
+
878
+ </td><td>
879
+
880
+ Second X coordinate of the rectangle
881
+
882
+ </td></tr>
883
+ <tr><td>
884
+
885
+ top
886
+
887
+ </td><td>
888
+
889
+ number
890
+
891
+ </td><td>
892
+
893
+ First Y coordinate of the rectangle
894
+
895
+ </td></tr>
896
+ <tr><td>
897
+
898
+ bottom
899
+
900
+ </td><td>
901
+
902
+ number
903
+
904
+ </td><td>
905
+
906
+ Second Y coordinate of the rectangle
907
+
908
+ </td></tr>
909
+ <tr><td>
910
+
911
+ leftToRight
912
+
913
+ </td><td>
914
+
915
+ boolean
916
+
917
+ </td><td>
918
+
919
+ _(Optional)_ Whether to only get primitives that are fully enclosed by the box selection. If `false`<!-- -->, primitives touched by the selection are also obtained
920
+
921
+ </td></tr>
922
+ </tbody></table>
923
+
924
+ ## Returns
925
+
926
+ Promise&lt;Array&lt;[IPCB\_Primitive](../interfaces/IPCB_Primitive.md)<!-- -->&gt;&gt;
927
+
928
+ All primitives in the region
929
+
930
+ ## Example
931
+
932
+ ```javascript
933
+ // 1. 创建测试 PCB 并打开
934
+ const pcbUuid = await eda.dmt_Pcb.createPcb();
935
+ await new Promise(r => setTimeout(r, 1500));
936
+ await eda.dmt_EditorControl.openDocument(pcbUuid);
937
+ await new Promise(r => setTimeout(r, 1000));
938
+
939
+ // 2. 放两个测试焊盘:一个在 (500, 500),一个在 (3000, 3000)
940
+ const padA = await eda.pcb_PrimitivePad.create(1, '1', 500, 500, 0, ['ELLIPSE', 60, 60], '', null, 0, 0, 0, false, 0);
941
+ const padB = await eda.pcb_PrimitivePad.create(1, '2', 3000, 3000, 0, ['ELLIPSE', 60, 60], '', null, 0, 0, 0, false, 0);
942
+
943
+ // 3. 小区域 (0,1000,1000,0) 只盖住第一个焊盘
944
+ const small = await eda.pcb_Document.getPrimitivesInRegion(0, 1000, 1000, 0);
945
+ console.log('smallRegionCount:', small.length);
946
+
947
+ // 4. 大区域 (0,4000,4000,0) 盖住两个焊盘,完全框选模式
948
+ const big = await eda.pcb_Document.getPrimitivesInRegion(0, 4000, 4000, 0, true);
949
+ console.log('bigRegionCount:', big.length);
950
+
951
+ // 5. 清理测试图元和测试 PCB
952
+ await eda.pcb_PrimitivePad.delete([padA.getState_PrimitiveId(), padB.getState_PrimitiveId()]);
953
+ await eda.dmt_Pcb.deletePcb(pcbUuid);
954
+ ```
955
+
956
+ ### importautolayoutjsonfile
957
+
958
+ # PCB\_Document.importAutoLayoutJsonFile() method
959
+
960
+ > 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.
961
+
962
+ Import auto layout file (JSON)
963
+
964
+ ## Signature
965
+
966
+ ```typescript
967
+ function importAutoLayoutJsonFile(autoLayoutFile: File): Promise<boolean>;
968
+ ```
969
+
970
+ ## Parameters
971
+
972
+ <table><thead><tr><th>
973
+
974
+ Parameter
975
+
976
+ </th><th>
977
+
978
+ Type
979
+
980
+ </th><th>
981
+
982
+ Description
983
+
984
+ </th></tr></thead>
985
+ <tbody><tr><td>
986
+
987
+ autoLayoutFile
988
+
989
+ </td><td>
990
+
991
+ File
992
+
993
+ </td><td>
994
+
995
+ The JSON file to import
996
+
997
+ </td></tr>
998
+ </tbody></table>
999
+
1000
+ ## Returns
1001
+
1002
+ Promise&lt;boolean&gt;
1003
+
1004
+ Whether the import operation is successful
1005
+
1006
+ ## Remarks
1007
+
1008
+ You can use to read in a file
1009
+
1010
+ ## Example
1011
+
1012
+ ```javascript
1013
+ // 1. 创建测试 PCB 并打开(导入作用于当前激活的 PCB)
1014
+ const pcbUuid = await eda.dmt_Pcb.createPcb();
1015
+ await new Promise(r => setTimeout(r, 1500));
1016
+ await eda.dmt_EditorControl.openDocument(pcbUuid);
1017
+ await new Promise(r => setTimeout(r, 1000));
1018
+
1019
+ // 2. 构造布局 JSON 文件对象(真实场景:readFileFromFileSystem 读取外部导出的文件)
1020
+ const layoutFile = new File([JSON.stringify({})], 'auto-layout.json', { type: 'application/json' });
1021
+
1022
+ // 3. 导入自动布局文件
1023
+ const imported = await eda.pcb_Document.importAutoLayoutJsonFile(layoutFile);
1024
+ console.log('imported:', imported);
1025
+
1026
+ // 4. 清理测试 PCB
1027
+ await eda.dmt_Pcb.deletePcb(pcbUuid);
1028
+ ```
1029
+
1030
+ ### importautoroutejsonfile
1031
+
1032
+ # PCB\_Document.importAutoRouteJsonFile() method
1033
+
1034
+ > 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.
1035
+
1036
+ Import auto routing file (JSON)
1037
+
1038
+ ## Signature
1039
+
1040
+ ```typescript
1041
+ function importAutoRouteJsonFile(autoRouteFile: File): Promise<boolean>;
1042
+ ```
1043
+
1044
+ ## Parameters
1045
+
1046
+ <table><thead><tr><th>
1047
+
1048
+ Parameter
1049
+
1050
+ </th><th>
1051
+
1052
+ Type
1053
+
1054
+ </th><th>
1055
+
1056
+ Description
1057
+
1058
+ </th></tr></thead>
1059
+ <tbody><tr><td>
1060
+
1061
+ autoRouteFile
1062
+
1063
+ </td><td>
1064
+
1065
+ File
1066
+
1067
+ </td><td>
1068
+
1069
+ The JSON file to import
1070
+
1071
+ </td></tr>
1072
+ </tbody></table>
1073
+
1074
+ ## Returns
1075
+
1076
+ Promise&lt;boolean&gt;
1077
+
1078
+ Whether the import operation is successful
1079
+
1080
+ ## Remarks
1081
+
1082
+ You can use to read in a file
1083
+
1084
+ ## Example
1085
+
1086
+ ```javascript
1087
+ // 1. 创建测试 PCB 并打开(导入作用于当前激活的 PCB)
1088
+ const pcbUuid = await eda.dmt_Pcb.createPcb();
1089
+ await new Promise(r => setTimeout(r, 1500));
1090
+ await eda.dmt_EditorControl.openDocument(pcbUuid);
1091
+ await new Promise(r => setTimeout(r, 1000));
1092
+
1093
+ // 2. 构造布线 JSON 文件对象(真实场景:readFileFromFileSystem 读取外部导出的文件)
1094
+ const routeFile = new File([JSON.stringify({})], 'auto-route.json', { type: 'application/json' });
1095
+
1096
+ // 3. 导入自动布线文件
1097
+ const imported = await eda.pcb_Document.importAutoRouteJsonFile(routeFile);
1098
+ console.log('imported:', imported);
1099
+
1100
+ // 4. 清理测试 PCB
1101
+ await eda.dmt_Pcb.deletePcb(pcbUuid);
1102
+ ```
1103
+
1104
+ ### importautoroutesesfile
1105
+
1106
+ # PCB\_Document.importAutoRouteSesFile() method
1107
+
1108
+ > 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.
1109
+
1110
+ Import auto routing file (SES)
1111
+
1112
+ ## Signature
1113
+
1114
+ ```typescript
1115
+ function importAutoRouteSesFile(autoRouteFile: File): Promise<boolean>;
1116
+ ```
1117
+
1118
+ ## Parameters
1119
+
1120
+ <table><thead><tr><th>
1121
+
1122
+ Parameter
1123
+
1124
+ </th><th>
1125
+
1126
+ Type
1127
+
1128
+ </th><th>
1129
+
1130
+ Description
1131
+
1132
+ </th></tr></thead>
1133
+ <tbody><tr><td>
1134
+
1135
+ autoRouteFile
1136
+
1137
+ </td><td>
1138
+
1139
+ File
1140
+
1141
+ </td><td>
1142
+
1143
+ The SES file to import
1144
+
1145
+ </td></tr>
1146
+ </tbody></table>
1147
+
1148
+ ## Returns
1149
+
1150
+ Promise&lt;boolean&gt;
1151
+
1152
+ Whether the import operation is successful
1153
+
1154
+ ## Remarks
1155
+
1156
+ You can use to read in a file
1157
+
1158
+ ### importchanges
1159
+
1160
+ # PCB\_Document.importChanges() method
1161
+
1162
+ Import changes from the schematic
1163
+
1164
+ ## Signature
1165
+
1166
+ ```typescript
1167
+ function importChanges(uuid?: string): Promise<boolean>;
1168
+ ```
1169
+
1170
+ ## Parameters
1171
+
1172
+ <table><thead><tr><th>
1173
+
1174
+ Parameter
1175
+
1176
+ </th><th>
1177
+
1178
+ Type
1179
+
1180
+ </th><th>
1181
+
1182
+ Description
1183
+
1184
+ </th></tr></thead>
1185
+ <tbody><tr><td>
1186
+
1187
+ uuid
1188
+
1189
+ </td><td>
1190
+
1191
+ string
1192
+
1193
+ </td><td>
1194
+
1195
+ _(Optional)_ Schematic UUID. By default, the schematic associated with the same Board is used
1196
+
1197
+ </td></tr>
1198
+ </tbody></table>
1199
+
1200
+ ## Returns
1201
+
1202
+ Promise&lt;boolean&gt;
1203
+
1204
+ Whether the import operation was successful. If the import fails or the free PCB has no schematic UUID passed in, `false` is returned
1205
+
1206
+ ## Remarks
1207
+
1208
+ 如需尽可能不被弹窗阻断(CLI 调用时推荐),请传入 `force` 为 `true`<!-- -->,这样在不遇到严重错误时不会出现任何弹窗; `force=true` 会跳过确认弹窗并自动全量导入,且等待导入完成后再返回(非交互执行方式,见 [参数 \`force\`](./PCB_Document.md)<!-- -->)
1209
+
1210
+ ## Example
1211
+
1212
+ ```javascript
1213
+ // 1. 创建测试原理图和测试 PCB
1214
+ const schUuid = await eda.dmt_Schematic.createSchematic();
1215
+ await new Promise(r => setTimeout(r, 1500));
1216
+ const pcbUuid = await eda.dmt_Pcb.createPcb();
1217
+ await new Promise(r => setTimeout(r, 1500));
1218
+
1219
+ // 2. 创建板子把原理图与 PCB 关联起来(返回板子名称)
1220
+ const boardName = await eda.dmt_Board.createBoard(schUuid, pcbUuid);
1221
+ await new Promise(r => setTimeout(r, 1500));
1222
+ console.log('boardName:', boardName);
1223
+
1224
+ // 3. 打开 PCB 并从关联原理图导入变更
1225
+ await eda.dmt_EditorControl.openDocument(pcbUuid);
1226
+ await new Promise(r => setTimeout(r, 1000));
1227
+ const imported = await eda.pcb_Document.importChanges();
1228
+ console.log('imported:', imported);
1229
+
1230
+ // 4. 清理:删板子、删 PCB、删原理图
1231
+ await eda.dmt_Board.deleteBoard(boardName);
1232
+ await new Promise(r => setTimeout(r, 1000));
1233
+ await eda.dmt_Pcb.deletePcb(pcbUuid);
1234
+ await eda.dmt_Schematic.deleteSchematic(schUuid);
1235
+ ```
1236
+
1237
+ ### navigatetocoordinates
1238
+
1239
+ # PCB\_Document.navigateToCoordinates() method
1240
+
1241
+ Locate to canvas coordinate
1242
+
1243
+ ## Signature
1244
+
1245
+ ```typescript
1246
+ function navigateToCoordinates(x: number, y: number): Promise<boolean>;
1247
+ ```
1248
+
1249
+ ## Parameters
1250
+
1251
+ <table><thead><tr><th>
1252
+
1253
+ Parameter
1254
+
1255
+ </th><th>
1256
+
1257
+ Type
1258
+
1259
+ </th><th>
1260
+
1261
+ Description
1262
+
1263
+ </th></tr></thead>
1264
+ <tbody><tr><td>
1265
+
1266
+ x
1267
+
1268
+ </td><td>
1269
+
1270
+ number
1271
+
1272
+ </td><td>
1273
+
1274
+ X coordinate
1275
+
1276
+ </td></tr>
1277
+ <tr><td>
1278
+
1279
+ y
1280
+
1281
+ </td><td>
1282
+
1283
+ number
1284
+
1285
+ </td><td>
1286
+
1287
+ Y coordinate
1288
+
1289
+ </td></tr>
1290
+ </tbody></table>
1291
+
1292
+ ## Returns
1293
+
1294
+ Promise&lt;boolean&gt;
1295
+
1296
+ Whether the operation is successful
1297
+
1298
+ ## Remarks
1299
+
1300
+ This API positions on the front-end canvas to the specified data-level coordinate;
1301
+
1302
+ If you want the front-end canvas coordinate to be consistent with the passed-in data during this operation, it is recommended to call the [PCB\_Document.setCanvasOrigin()](./PCB_Document.md) method and set the offset to zero;
1303
+
1304
+ The units here are data-level units, which are equivalent to mil on the canvas level in span
1305
+
1306
+ ## Example
1307
+
1308
+ ```javascript
1309
+ // 1. 创建测试 PCB 并打开(视口操作作用于当前激活的 PCB)
1310
+ const pcbUuid = await eda.dmt_Pcb.createPcb();
1311
+ await new Promise(r => setTimeout(r, 1500));
1312
+ await eda.dmt_EditorControl.openDocument(pcbUuid);
1313
+ await new Promise(r => setTimeout(r, 1000));
1314
+
1315
+ // 2. 定位到数据坐标 (1000, 800)
1316
+ const navigated = await eda.pcb_Document.navigateToCoordinates(1000, 800);
1317
+ console.log('navigated:', navigated);
1318
+
1319
+ // 3. 清理测试 PCB
1320
+ await eda.dmt_Pcb.deletePcb(pcbUuid);
1321
+ ```
1322
+
1323
+ ### navigatetoregion
1324
+
1325
+ # PCB\_Document.navigateToRegion() method
1326
+
1327
+ > 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.
1328
+
1329
+ Locate to canvas region
1330
+
1331
+ ## Signature
1332
+
1333
+ ```typescript
1334
+ function navigateToRegion(
1335
+ left: number,
1336
+ right: number,
1337
+ top: number,
1338
+ bottom: number,
1339
+ ): Promise<boolean>;
1340
+ ```
1341
+
1342
+ ## Parameters
1343
+
1344
+ <table><thead><tr><th>
1345
+
1346
+ Parameter
1347
+
1348
+ </th><th>
1349
+
1350
+ Type
1351
+
1352
+ </th><th>
1353
+
1354
+ Description
1355
+
1356
+ </th></tr></thead>
1357
+ <tbody><tr><td>
1358
+
1359
+ left
1360
+
1361
+ </td><td>
1362
+
1363
+ number
1364
+
1365
+ </td><td>
1366
+
1367
+ First X coordinate of the rectangle
1368
+
1369
+ </td></tr>
1370
+ <tr><td>
1371
+
1372
+ right
1373
+
1374
+ </td><td>
1375
+
1376
+ number
1377
+
1378
+ </td><td>
1379
+
1380
+ Second X coordinate of the rectangle
1381
+
1382
+ </td></tr>
1383
+ <tr><td>
1384
+
1385
+ top
1386
+
1387
+ </td><td>
1388
+
1389
+ number
1390
+
1391
+ </td><td>
1392
+
1393
+ First Y coordinate of the rectangle
1394
+
1395
+ </td></tr>
1396
+ <tr><td>
1397
+
1398
+ bottom
1399
+
1400
+ </td><td>
1401
+
1402
+ number
1403
+
1404
+ </td><td>
1405
+
1406
+ Second Y coordinate of the rectangle
1407
+
1408
+ </td></tr>
1409
+ </tbody></table>
1410
+
1411
+ ## Returns
1412
+
1413
+ Promise&lt;boolean&gt;
1414
+
1415
+ Whether the operation is successful
1416
+
1417
+ ## Remarks
1418
+
1419
+ This API positions on the front-end canvas to the specified region. The region data is an offset relative to the data origin;
1420
+
1421
+ For example: the passed-in data is `{left: 0, right: 60, top: 100, bottom: -20}` =<!-- -->&gt; `navigateToRegion(0, 60, 100, -20)`<!-- -->, then the canvas will be positioned to a rectangular range centered at `[30, 40]` with a length of `60` in the x-axis direction and `120` in the y-axis direction;
1422
+
1423
+ This API does not perform zooming, but it will generate a rectangle frame indicating the positioning center and the region range;
1424
+
1425
+ The units here are data-level units, which are equivalent to mil on the canvas level in span
1426
+
1427
+ ## Example
1428
+
1429
+ ```javascript
1430
+ // 1. 创建测试 PCB 并打开(视口操作作用于当前激活的 PCB)
1431
+ const pcbUuid = await eda.dmt_Pcb.createPcb();
1432
+ await new Promise(r => setTimeout(r, 1500));
1433
+ await eda.dmt_EditorControl.openDocument(pcbUuid);
1434
+ await new Promise(r => setTimeout(r, 1000));
1435
+
1436
+ // 2. 定位到矩形区域:X 从 0 到 2000,Y 从 2000 到 0(视口将以中心 (1000,1000) 呈现)
1437
+ const navigated = await eda.pcb_Document.navigateToRegion(0, 2000, 2000, 0);
1438
+ console.log('navigated:', navigated);
1439
+
1440
+ // 3. 清理测试 PCB
1441
+ await eda.dmt_Pcb.deletePcb(pcbUuid);
1442
+ ```
1443
+
1444
+ ### save
1445
+
1446
+ # PCB\_Document.save() method
1447
+
1448
+ Save Document
1449
+
1450
+ ## Signature
1451
+
1452
+ ```typescript
1453
+ function save(): Promise<boolean>;
1454
+ ```
1455
+
1456
+ ## Returns
1457
+
1458
+ Promise&lt;boolean&gt;
1459
+
1460
+ Whether the save operation was successful. Errors such as save failure and upload failure all return `false`
1461
+
1462
+ ## Remarks
1463
+
1464
+ 在 headless / 无头环境下,本接口可能返回 `true` 但实际未真正落盘(如网络 / 上传链路异常), 对落盘结果敏感的流程应通过 [文件系统接口](./SYS_FileSystem.md) 二次核验
1465
+
1466
+ ## Example
1467
+
1468
+ ```javascript
1469
+ // 1. 创建测试 PCB 并打开(保存作用于当前激活的 PCB)
1470
+ const pcbUuid = await eda.dmt_Pcb.createPcb();
1471
+ await new Promise(r => setTimeout(r, 1500));
1472
+ await eda.dmt_EditorControl.openDocument(pcbUuid);
1473
+ await new Promise(r => setTimeout(r, 1000));
1474
+
1475
+ // 2. 保存当前 PCB
1476
+ const saved = await eda.pcb_Document.save();
1477
+ console.log('saved:', saved);
1478
+
1479
+ // 3. 清理测试 PCB
1480
+ await eda.dmt_Pcb.deletePcb(pcbUuid);
1481
+ ```
1482
+
1483
+ ### setcanvasorigin
1484
+
1485
+ # PCB\_Document.setCanvasOrigin() method
1486
+
1487
+ Set the offset coordinate of the canvas origin relative to the data origin
1488
+
1489
+ ## Signature
1490
+
1491
+ ```typescript
1492
+ function setCanvasOrigin(offsetX: number, offsetY: number): Promise<boolean>;
1493
+ ```
1494
+
1495
+ ## Parameters
1496
+
1497
+ <table><thead><tr><th>
1498
+
1499
+ Parameter
1500
+
1501
+ </th><th>
1502
+
1503
+ Type
1504
+
1505
+ </th><th>
1506
+
1507
+ Description
1508
+
1509
+ </th></tr></thead>
1510
+ <tbody><tr><td>
1511
+
1512
+ offsetX
1513
+
1514
+ </td><td>
1515
+
1516
+ number
1517
+
1518
+ </td><td>
1519
+
1520
+ X coordinate offset of the canvas origin relative to the data origin
1521
+
1522
+ </td></tr>
1523
+ <tr><td>
1524
+
1525
+ offsetY
1526
+
1527
+ </td><td>
1528
+
1529
+ number
1530
+
1531
+ </td><td>
1532
+
1533
+ Y coordinate offset of the canvas origin relative to the data origin
1534
+
1535
+ </td></tr>
1536
+ </tbody></table>
1537
+
1538
+ ## Returns
1539
+
1540
+ Promise&lt;boolean&gt;
1541
+
1542
+ Whether the operation is successful
1543
+
1544
+ ## Remarks
1545
+
1546
+ The coordinates displayed on the EasyEDA Pro front end are all relative to the canvas origin;
1547
+
1548
+ The EasyEDA Pro API uses the data origin;
1549
+
1550
+ If you want the front-end canvas coordinate to be consistent with the data during API operations, it is recommended to call this method and set the offset to zero, i.e. `setCanvasOrigin(0, 0)`<!-- -->;
1551
+
1552
+ The units here are data-level units, which are equivalent to mil on the canvas level in span
1553
+
1554
+ ## Example
1555
+
1556
+ ```javascript
1557
+ // 1. 创建测试 PCB 并打开(原点设置作用于当前激活的 PCB)
1558
+ const pcbUuid = await eda.dmt_Pcb.createPcb();
1559
+ await new Promise(r => setTimeout(r, 1500));
1560
+ await eda.dmt_EditorControl.openDocument(pcbUuid);
1561
+ await new Promise(r => setTimeout(r, 1000));
1562
+
1563
+ // 2. 设置画布原点偏移为 (50, 100)
1564
+ const set = await eda.pcb_Document.setCanvasOrigin(50, 100);
1565
+ console.log('set:', set);
1566
+
1567
+ // 3. 读回偏移验证已生效
1568
+ const origin = await eda.pcb_Document.getCanvasOrigin();
1569
+ console.log('origin:', JSON.stringify(origin));
1570
+
1571
+ // 4. 清理测试 PCB(偏移随文档一起删除)
1572
+ await eda.dmt_Pcb.deletePcb(pcbUuid);
1573
+ ```
1574
+
1575
+ ### startcalculatingratline
1576
+
1577
+ # PCB\_Document.startCalculatingRatline() method
1578
+
1579
+ > Warning: This API is now obsolete.
1580
+ >
1581
+ > since EDA v4.2
1582
+
1583
+ Start the ratline calculation function
1584
+
1585
+ ## Signature
1586
+
1587
+ ```typescript
1588
+ function startCalculatingRatline(): Promise<boolean>;
1589
+ ```
1590
+
1591
+ ## Returns
1592
+
1593
+ Promise&lt;boolean&gt;
1594
+
1595
+ Whether the operation is successful
1596
+
1597
+ ## Remarks
1598
+
1599
+ A ratline calculation will be triggered when starting
1600
+
1601
+ ## Example
1602
+
1603
+ ```javascript
1604
+ // 1. 创建测试 PCB 并打开(飞线开关作用于当前激活的 PCB)
1605
+ const pcbUuid = await eda.dmt_Pcb.createPcb();
1606
+ await new Promise(r => setTimeout(r, 1500));
1607
+ await eda.dmt_EditorControl.openDocument(pcbUuid);
1608
+ await new Promise(r => setTimeout(r, 1000));
1609
+
1610
+ // 2. 启动飞线计算
1611
+ const started = await eda.pcb_Document.startCalculatingRatline();
1612
+ console.log('started:', started);
1613
+
1614
+ // 3. 清理测试 PCB
1615
+ await eda.dmt_Pcb.deletePcb(pcbUuid);
1616
+ ```
1617
+
1618
+ ### startcanvasupdatecalculation
1619
+
1620
+ # PCB\_Document.startCanvasUpdateCalculation() method
1621
+
1622
+ > 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.
1623
+
1624
+ 开始画布更新计算
1625
+
1626
+ ## Signature
1627
+
1628
+ ```typescript
1629
+ function startCanvasUpdateCalculation(): Promise<boolean>;
1630
+ ```
1631
+
1632
+ ## Returns
1633
+
1634
+ Promise&lt;boolean&gt;
1635
+
1636
+ 操作是否成功
1637
+
1638
+ ## Remarks
1639
+
1640
+ 画布更新计算包括画布渲染更新、属性面板更新等
1641
+
1642
+ 如若不理解该开关的含义,请勿调用本接口进行任何操作 ADD since EDA v4.2
1643
+
1644
+ ### stopcalculatingratline
1645
+
1646
+ # PCB\_Document.stopCalculatingRatline() method
1647
+
1648
+ > Warning: This API is now obsolete.
1649
+ >
1650
+ > since EDA v4.2
1651
+
1652
+ Stop the ratline calculation function
1653
+
1654
+ ## Signature
1655
+
1656
+ ```typescript
1657
+ function stopCalculatingRatline(): Promise<boolean>;
1658
+ ```
1659
+
1660
+ ## Returns
1661
+
1662
+ Promise&lt;boolean&gt;
1663
+
1664
+ Whether the operation is successful
1665
+
1666
+ ## Example
1667
+
1668
+ ```javascript
1669
+ // 1. 创建测试 PCB 并打开(飞线开关作用于当前激活的 PCB)
1670
+ const pcbUuid = await eda.dmt_Pcb.createPcb();
1671
+ await new Promise(r => setTimeout(r, 1500));
1672
+ await eda.dmt_EditorControl.openDocument(pcbUuid);
1673
+ await new Promise(r => setTimeout(r, 1000));
1674
+
1675
+ // 2. 停止飞线计算
1676
+ const stopped = await eda.pcb_Document.stopCalculatingRatline();
1677
+ console.log('stopped:', stopped);
1678
+
1679
+ // 3. 清理测试 PCB
1680
+ await eda.dmt_Pcb.deletePcb(pcbUuid);
1681
+ ```
1682
+
1683
+ ### stopcanvasupdatecalculation
1684
+
1685
+ # PCB\_Document.stopCanvasUpdateCalculation() method
1686
+
1687
+ > 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.
1688
+
1689
+ 停止画布更新计算
1690
+
1691
+ ## Signature
1692
+
1693
+ ```typescript
1694
+ function stopCanvasUpdateCalculation(): Promise<boolean>;
1695
+ ```
1696
+
1697
+ ## Returns
1698
+
1699
+ Promise&lt;boolean&gt;
1700
+
1701
+ 操作是否成功
1702
+
1703
+ ## Remarks
1704
+
1705
+ 画布更新计算包括画布渲染更新、属性面板更新等
1706
+
1707
+ 如若不理解该开关的含义,请勿调用本接口进行任何操作 ADD since EDA v4.2
1708
+
1709
+ ### triggercanvasupdatecalculation
1710
+
1711
+ # PCB\_Document.triggerCanvasUpdateCalculation() method
1712
+
1713
+ > 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.
1714
+
1715
+ 触发一次画布更新计算
1716
+
1717
+ ## Signature
1718
+
1719
+ ```typescript
1720
+ function triggerCanvasUpdateCalculation(): Promise<boolean>;
1721
+ ```
1722
+
1723
+ ## Returns
1724
+
1725
+ Promise&lt;boolean&gt;
1726
+
1727
+ 操作是否成功
1728
+
1729
+ ## Remarks
1730
+
1731
+ 画布更新计算包括画布渲染更新、属性面板更新等
1732
+
1733
+ 如若不理解该开关的含义,请勿调用本接口进行任何操作 ADD since EDA v4.2
1734
+
1735
+ ### zoomtoboardoutline
1736
+
1737
+ # PCB\_Document.zoomToBoardOutline() method
1738
+
1739
+ > 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.
1740
+
1741
+ Zoom to the board outline (fit the board outline)
1742
+
1743
+ ## Signature
1744
+
1745
+ ```typescript
1746
+ function zoomToBoardOutline(): Promise<boolean>;
1747
+ ```
1748
+
1749
+ ## Returns
1750
+
1751
+ Promise&lt;boolean&gt;
1752
+
1753
+ Whether the operation is successful
1754
+
1755
+ ## Example
1756
+
1757
+ ```javascript
1758
+ // 1. 创建测试 PCB 并打开(视口操作作用于当前激活的 PCB)
1759
+ const pcbUuid = await eda.dmt_Pcb.createPcb();
1760
+ await new Promise(r => setTimeout(r, 1500));
1761
+ await eda.dmt_EditorControl.openDocument(pcbUuid);
1762
+ await new Promise(r => setTimeout(r, 1000));
1763
+
1764
+ // 2. 缩放到板框
1765
+ const zoomed = await eda.pcb_Document.zoomToBoardOutline();
1766
+ console.log('zoomed:', zoomed);
1767
+
1768
+ // 3. 清理测试 PCB
1769
+ await eda.dmt_Pcb.deletePcb(pcbUuid);
1770
+ ```