@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,2240 +1,2256 @@
1
- # SCH\_PrimitiveComponent class
2
-
3
- Schematic & symbol / device primitive class
4
-
5
- ## Signature
6
-
7
- ```typescript
8
- class SCH_PrimitiveComponent implements ISCH_PrimitiveAPI
9
- ```
10
- **Implements:** [ISCH\_PrimitiveAPI](../interfaces/ISCH_PrimitiveAPI.md)
11
-
12
- ## Remarks
13
-
14
- ## Methods
15
-
16
- <table><thead><tr><th>
17
-
18
- Method
19
-
20
- </th><th>
21
-
22
- Modifiers
23
-
24
- </th><th>
25
-
26
- Description
27
-
28
- </th></tr></thead>
29
- <tbody><tr><td>
30
-
31
- [create(component, x, y, subPartName, rotation, mirror, addIntoBom, addIntoPcb)](./SCH_PrimitiveComponent.md)
32
-
33
- </td><td>
34
-
35
- </td><td>
36
-
37
- **_(BETA)_** Create Device
38
-
39
- </td></tr>
40
- <tr><td>
41
-
42
- [createCbbSymbol(cbbSymbol, x, y, rotation, mirror)](./SCH_PrimitiveComponent.md)
43
-
44
- </td><td>
45
-
46
- </td><td>
47
-
48
- **_(BETA)_** Create Reuse block symbol
49
-
50
- </td></tr>
51
- <tr><td>
52
-
53
- [createNetFlag(identification, net, x, y, rotation, mirror)](./SCH_PrimitiveComponent.md)
54
-
55
- </td><td>
56
-
57
- </td><td>
58
-
59
- **_(BETA)_** Create Net flag
60
-
61
- </td></tr>
62
- <tr><td>
63
-
64
- [createNetPort(direction, net, x, y, rotation, mirror)](./SCH_PrimitiveComponent.md)
65
-
66
- </td><td>
67
-
68
- </td><td>
69
-
70
- **_(BETA)_** Create Net port
71
-
72
- </td></tr>
73
- <tr><td>
74
-
75
- [createShortCircuitFlag(x, y, rotation, mirror)](./SCH_PrimitiveComponent.md)
76
-
77
- </td><td>
78
-
79
- </td><td>
80
-
81
- **_(BETA)_** Create a short circuit flag
82
-
83
- </td></tr>
84
- <tr><td>
85
-
86
- [delete(primitiveIds)](./SCH_PrimitiveComponent.md)
87
-
88
- </td><td>
89
-
90
- </td><td>
91
-
92
- **_(BETA)_** Delete Device
93
-
94
- </td></tr>
95
- <tr><td>
96
-
97
- [get(primitiveIds)](./SCH_PrimitiveComponent.md)
98
-
99
- </td><td>
100
-
101
- </td><td>
102
-
103
- **_(BETA)_** Get Device
104
-
105
- </td></tr>
106
- <tr><td>
107
-
108
- [get(primitiveIds)](./SCH_PrimitiveComponent.md)
109
-
110
- </td><td>
111
-
112
- </td><td>
113
-
114
- **_(BETA)_** Get Device
115
-
116
- </td></tr>
117
- <tr><td>
118
-
119
- [getAll(componentType, allSchematicPages)](./SCH_PrimitiveComponent.md)
120
-
121
- </td><td>
122
-
123
- </td><td>
124
-
125
- **_(BETA)_** Get all Device
126
-
127
- </td></tr>
128
- <tr><td>
129
-
130
- [getAllPinsByPrimitiveId(primitiveId)](./SCH_PrimitiveComponent.md)
131
-
132
- </td><td>
133
-
134
- </td><td>
135
-
136
- **_(BETA)_** Get all pins associated with the device
137
-
138
- </td></tr>
139
- <tr><td>
140
-
141
- [getAllPrimitiveId(componentType, allSchematicPages)](./SCH_PrimitiveComponent.md)
142
-
143
- </td><td>
144
-
145
- </td><td>
146
-
147
- **_(BETA)_** Get all Device primitive IDs
148
-
149
- </td></tr>
150
- <tr><td>
151
-
152
- [getAllPropertyNames()](./SCH_PrimitiveComponent.md)
153
-
154
- </td><td>
155
-
156
- </td><td>
157
-
158
- **_(BETA)_** Get The set of all property names of all devices
159
-
160
- </td></tr>
161
- <tr><td>
162
-
163
- [modify(primitiveId, property)](./SCH_PrimitiveComponent.md)
164
-
165
- </td><td>
166
-
167
- </td><td>
168
-
169
- **_(BETA)_** Modify Device
170
-
171
- </td></tr>
172
- <tr><td>
173
-
174
- [placeCbbSchematicPage(cbbSchematicPage, x, y, props)](./SCH_PrimitiveComponent.md)
175
-
176
- </td><td>
177
-
178
- </td><td>
179
-
180
- **_(BETA)_** Place reuse block schematic sheet
181
-
182
- </td></tr>
183
- <tr><td>
184
-
185
- [placeComponentWithMouse(component, subPartName)](./SCH_PrimitiveComponent.md)
186
-
187
- </td><td>
188
-
189
- </td><td>
190
-
191
- **_(BETA)_** Place with the mouse device
192
-
193
- </td></tr>
194
- <tr><td>
195
-
196
- [placeSymbolWithMouse(symbol, subPartName, properties)](./SCH_PrimitiveComponent.md)
197
-
198
- </td><td>
199
-
200
- </td><td>
201
-
202
- **_(BETA)_** Place with the mouse symbol
203
-
204
- </td></tr>
205
- <tr><td>
206
-
207
- [setNetFlagComponentUuid\_AnalogGround(component)](./SCH_PrimitiveComponent.md)
208
-
209
- </td><td>
210
-
211
- </td><td>
212
-
213
- **_(BETA)_** Set the device UUID associated with the AnalogGround net flag in the extension API
214
-
215
- </td></tr>
216
- <tr><td>
217
-
218
- [setNetFlagComponentUuid\_Ground(component)](./SCH_PrimitiveComponent.md)
219
-
220
- </td><td>
221
-
222
- </td><td>
223
-
224
- **_(BETA)_** Set the device UUID associated with the Ground net flag in the extension API
225
-
226
- </td></tr>
227
- <tr><td>
228
-
229
- [setNetFlagComponentUuid\_Power(component)](./SCH_PrimitiveComponent.md)
230
-
231
- </td><td>
232
-
233
- </td><td>
234
-
235
- **_(BETA)_** Set the device UUID associated with the Power net flag in the extension API
236
-
237
- </td></tr>
238
- <tr><td>
239
-
240
- [setNetFlagComponentUuid\_ProtectGround(component)](./SCH_PrimitiveComponent.md)
241
-
242
- </td><td>
243
-
244
- </td><td>
245
-
246
- **_(BETA)_** Set the device UUID associated with the ProtectGround net flag in the extension API
247
-
248
- </td></tr>
249
- <tr><td>
250
-
251
- [setNetPortComponentUuid\_BI(component)](./SCH_PrimitiveComponent.md)
252
-
253
- </td><td>
254
-
255
- </td><td>
256
-
257
- **_(BETA)_** Set the device UUID associated with the BI net port in the extension API
258
-
259
- </td></tr>
260
- <tr><td>
261
-
262
- [setNetPortComponentUuid\_IN(component)](./SCH_PrimitiveComponent.md)
263
-
264
- </td><td>
265
-
266
- </td><td>
267
-
268
- **_(BETA)_** Set the device UUID associated with the IN net port in the extension API
269
-
270
- </td></tr>
271
- <tr><td>
272
-
273
- [setNetPortComponentUuid\_OUT(component)](./SCH_PrimitiveComponent.md)
274
-
275
- </td><td>
276
-
277
- </td><td>
278
-
279
- **_(BETA)_** Set the device UUID associated with the OUT net port in the extension API
280
-
281
- </td></tr>
282
- </tbody></table>
283
-
284
- ---
285
-
286
- ## 方法详情
287
-
288
- ### create
289
-
290
- # SCH\_PrimitiveComponent.create() method
291
-
292
- > 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.
293
-
294
- Create Device
295
-
296
- ## Signature
297
-
298
- ```typescript
299
- function create(
300
- component:
301
- | { libraryType?: undefined | ELIB_LibraryType.DEVICE; libraryUuid: string; uuid: string }
302
- | ILIB_DeviceItem
303
- | ILIB_DeviceSearchItem
304
- | { libraryType: ELIB_LibraryType.SYMBOL; libraryUuid: string; uuid: string }
305
- | ILIB_SymbolItem
306
- | ILIB_SymbolSearchItem,
307
- x: number,
308
- y: number,
309
- subPartName?: string,
310
- rotation?: number,
311
- mirror?: boolean,
312
- addIntoBom?: boolean,
313
- addIntoPcb?: boolean,
314
- ): Promise<ISCH_PrimitiveComponent | undefined>;
315
- ```
316
-
317
- ## Parameters
318
-
319
- <table><thead><tr><th>
320
-
321
- Parameter
322
-
323
- </th><th>
324
-
325
- Type
326
-
327
- </th><th>
328
-
329
- Description
330
-
331
- </th></tr></thead>
332
- <tbody><tr><td>
333
-
334
- component
335
-
336
- </td><td>
337
-
338
- { libraryType?: undefined \| [ELIB\_LibraryType.DEVICE](../enums/ELIB_LibraryType.md)<!-- -->; libraryUuid: string; uuid: string } \| [ILIB\_DeviceItem](../interfaces/ILIB_DeviceItem.md) \| [ILIB\_DeviceSearchItem](../interfaces/ILIB_DeviceSearchItem.md) \| { libraryType: [ELIB\_LibraryType.SYMBOL](../enums/ELIB_LibraryType.md)<!-- -->; libraryUuid: string; uuid: string } \| [ILIB\_SymbolItem](../interfaces/ILIB_SymbolItem.md) \| [ILIB\_SymbolSearchItem](../interfaces/ILIB_SymbolSearchItem.md)
339
-
340
- </td><td>
341
-
342
- Associate library device
343
-
344
- </td></tr>
345
- <tr><td>
346
-
347
- x
348
-
349
- </td><td>
350
-
351
- number
352
-
353
- </td><td>
354
-
355
- X coordinate
356
-
357
- </td></tr>
358
- <tr><td>
359
-
360
- y
361
-
362
- </td><td>
363
-
364
- number
365
-
366
- </td><td>
367
-
368
- Y coordinate
369
-
370
- </td></tr>
371
- <tr><td>
372
-
373
- subPartName
374
-
375
- </td><td>
376
-
377
- string
378
-
379
- </td><td>
380
-
381
- _(Optional)_ Sub-part name
382
-
383
- </td></tr>
384
- <tr><td>
385
-
386
- rotation
387
-
388
- </td><td>
389
-
390
- number
391
-
392
- </td><td>
393
-
394
- _(Optional)_ Rotation angle
395
-
396
- </td></tr>
397
- <tr><td>
398
-
399
- mirror
400
-
401
- </td><td>
402
-
403
- boolean
404
-
405
- </td><td>
406
-
407
- _(Optional)_ Whether it is mirrored
408
-
409
- </td></tr>
410
- <tr><td>
411
-
412
- addIntoBom
413
-
414
- </td><td>
415
-
416
- boolean
417
-
418
- </td><td>
419
-
420
- _(Optional)_ Whether Add to BOM
421
-
422
- </td></tr>
423
- <tr><td>
424
-
425
- addIntoPcb
426
-
427
- </td><td>
428
-
429
- boolean
430
-
431
- </td><td>
432
-
433
- _(Optional)_ Whether Transfer to PCB
434
-
435
- </td></tr>
436
- </tbody></table>
437
-
438
- ## Returns
439
-
440
- Promise&lt;[ISCH\_PrimitiveComponent](./ISCH_PrimitiveComponent.md) \| undefined&gt;
441
-
442
- Device primitive object
443
-
444
- ## Example
445
-
446
- ```javascript
447
- // 1. 从系统库搜索器件,随机坐标避免与画布已有器件重合(SCH 坐标单位 10mil)
448
- const devices = await eda.lib_Device.search('');
449
- const x = 2000 + Math.floor(Math.random() * 8000);
450
- const y = 2000 + Math.floor(Math.random() * 8000);
451
-
452
- // 2. 创建器件:搜索结果直接作为关联库器件传入,加入 BOM 并转到 PCB
453
- const comp = await eda.sch_PrimitiveComponent.create(
454
- devices[0], // 关联库器件
455
- x, // 坐标 X
456
- y, // 坐标 Y
457
- undefined, // 子部件名称(多子部件器件才需要指定)
458
- 0, // 旋转角度
459
- false, // 是否镜像
460
- true, // 是否加入 BOM
461
- true // 是否转到 PCB
462
- );
463
-
464
- // 3. 创建类保留现场,供在画布上观察摆放结果
465
- console.log('primitiveId:', comp.getState_PrimitiveId());
466
- console.log('designator:', comp.getState_Designator());
467
- console.log('position:', comp.getState_X(), ',', comp.getState_Y());
468
- console.log('addIntoBom:', comp.getState_AddIntoBom());
469
- ```
470
-
471
- ### createcbbsymbol
472
-
473
- # SCH\_PrimitiveComponent.createCbbSymbol() method
474
-
475
- > 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.
476
-
477
- Create Reuse block symbol
478
-
479
- ## Signature
480
-
481
- ```typescript
482
- function createCbbSymbol(
483
- cbbSymbol: { libraryUuid: string; cbbUuid: string; uuid?: undefined | string },
484
- x: number,
485
- y: number,
486
- rotation?: number,
487
- mirror?: boolean,
488
- ): Promise<ISCH_PrimitiveCbbSymbolComponent | undefined>;
489
- ```
490
-
491
- ## Parameters
492
-
493
- <table><thead><tr><th>
494
-
495
- Parameter
496
-
497
- </th><th>
498
-
499
- Type
500
-
501
- </th><th>
502
-
503
- Description
504
-
505
- </th></tr></thead>
506
- <tbody><tr><td>
507
-
508
- cbbSymbol
509
-
510
- </td><td>
511
-
512
- \{ libraryUuid: string; cbbUuid: string; uuid?: undefined \| string \}
513
-
514
- </td><td>
515
-
516
- Associated library reuse block symbol. `libraryUuid` is the UUID of the library where the CBB project is located, `cbbUuid` is the UUID of the CBB project, and `uuid` is the UUID of the symbol in the CBB project
517
-
518
- </td></tr>
519
- <tr><td>
520
-
521
- x
522
-
523
- </td><td>
524
-
525
- number
526
-
527
- </td><td>
528
-
529
- X coordinate
530
-
531
- </td></tr>
532
- <tr><td>
533
-
534
- y
535
-
536
- </td><td>
537
-
538
- number
539
-
540
- </td><td>
541
-
542
- Y coordinate
543
-
544
- </td></tr>
545
- <tr><td>
546
-
547
- rotation
548
-
549
- </td><td>
550
-
551
- number
552
-
553
- </td><td>
554
-
555
- _(Optional)_ Rotation angle
556
-
557
- </td></tr>
558
- <tr><td>
559
-
560
- mirror
561
-
562
- </td><td>
563
-
564
- boolean
565
-
566
- </td><td>
567
-
568
- _(Optional)_ Whether it is mirrored
569
-
570
- </td></tr>
571
- </tbody></table>
572
-
573
- ## Returns
574
-
575
- Promise&lt;[ISCH\_PrimitiveCbbSymbolComponent](./ISCH_PrimitiveCbbSymbolComponent.md) \| undefined&gt;
576
-
577
- Reuse block symbol primitive object
578
-
579
- ## Example
580
-
581
- ```javascript
582
- // 1. 从系统库搜索可用的复用模块
583
- const cbbList = await eda.lib_Cbb.search('');
584
- const cbb = cbbList[0];
585
-
586
- // 2. 随机坐标避免与画布已有图元重合(SCH 坐标单位 10mil)
587
- const x = 2000 + Math.floor(Math.random() * 8000);
588
- const y = 2000 + Math.floor(Math.random() * 8000);
589
-
590
- // 3. 创建复用模块符号(cbbUuid 传模块工程 UUID,符号 uuid 可省略由模块默认提供)
591
- const symbol = await eda.sch_PrimitiveComponent.createCbbSymbol(
592
- {
593
- libraryUuid: cbb.libraryUuid, // CBB 工程所在库的 UUID
594
- cbbUuid: cbb.uuid // CBB 工程的 UUID
595
- },
596
- x, // 坐标 X
597
- y, // 坐标 Y
598
- 0, // 旋转角度
599
- false // 是否镜像
600
- );
601
-
602
- // 4. 创建类保留现场,供在画布上观察模块符号
603
- console.log('primitiveId:', symbol.getState_PrimitiveId());
604
- console.log('primitiveType:', symbol.getState_PrimitiveType());
605
- console.log('position:', symbol.getState_X(), ',', symbol.getState_Y());
606
- ```
607
-
608
- ### createnetflag
609
-
610
- # SCH\_PrimitiveComponent.createNetFlag() method
611
-
612
- > 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.
613
-
614
- Create Net flag
615
-
616
- ## Signature
617
-
618
- ```typescript
619
- function createNetFlag(
620
- identification: 'Power' | 'Ground' | 'AnalogGround' | 'ProtectGround',
621
- net: string,
622
- x: number,
623
- y: number,
624
- rotation?: number,
625
- mirror?: boolean,
626
- ): Promise<ISCH_PrimitiveComponent | undefined>;
627
- ```
628
-
629
- ## Parameters
630
-
631
- <table><thead><tr><th>
632
-
633
- Parameter
634
-
635
- </th><th>
636
-
637
- Type
638
-
639
- </th><th>
640
-
641
- Description
642
-
643
- </th></tr></thead>
644
- <tbody><tr><td>
645
-
646
- identification
647
-
648
- </td><td>
649
-
650
- 'Power' \| 'Ground' \| 'AnalogGround' \| 'ProtectGround'
651
-
652
- </td><td>
653
-
654
- Identification type
655
-
656
- </td></tr>
657
- <tr><td>
658
-
659
- net
660
-
661
- </td><td>
662
-
663
- string
664
-
665
- </td><td>
666
-
667
- Net name
668
-
669
- </td></tr>
670
- <tr><td>
671
-
672
- x
673
-
674
- </td><td>
675
-
676
- number
677
-
678
- </td><td>
679
-
680
- X coordinate
681
-
682
- </td></tr>
683
- <tr><td>
684
-
685
- y
686
-
687
- </td><td>
688
-
689
- number
690
-
691
- </td><td>
692
-
693
- Y coordinate
694
-
695
- </td></tr>
696
- <tr><td>
697
-
698
- rotation
699
-
700
- </td><td>
701
-
702
- number
703
-
704
- </td><td>
705
-
706
- _(Optional)_ Rotation angle
707
-
708
- </td></tr>
709
- <tr><td>
710
-
711
- mirror
712
-
713
- </td><td>
714
-
715
- boolean
716
-
717
- </td><td>
718
-
719
- _(Optional)_ Whether it is mirrored
720
-
721
- </td></tr>
722
- </tbody></table>
723
-
724
- ## Returns
725
-
726
- Promise&lt;[ISCH\_PrimitiveComponent](./ISCH_PrimitiveComponent.md) \| undefined&gt;
727
-
728
- Device primitive object
729
-
730
- ## Example
731
-
732
- ```javascript
733
- // 1. 随机坐标避免与画布已有图元重合(SCH 坐标单位 10mil)
734
- const x = 2000 + Math.floor(Math.random() * 8000);
735
- const y = 2000 + Math.floor(Math.random() * 8000);
736
-
737
- // 2. 创建 Power 类型的网络标识,网络名为 VCC
738
- const flag = await eda.sch_PrimitiveComponent.createNetFlag(
739
- 'Power', // 标识类型:'Power' / 'Ground' / 'AnalogGround' / 'ProtectGround'
740
- '嘉立创示例_VCC', // 网络名称
741
- x, // 坐标 X
742
- y, // 坐标 Y
743
- 0, // 旋转角度
744
- false // 是否镜像
745
- );
746
-
747
- // 3. 创建类保留现场,供在画布上观察标识样式
748
- console.log('primitiveId:', flag.getState_PrimitiveId());
749
- console.log('net:', flag.getState_Net());
750
- console.log('componentType:', flag.getState_ComponentType());
751
- ```
752
-
753
- ### createnetport
754
-
755
- # SCH\_PrimitiveComponent.createNetPort() method
756
-
757
- > 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.
758
-
759
- Create Net port
760
-
761
- ## Signature
762
-
763
- ```typescript
764
- function createNetPort(
765
- direction: 'IN' | 'OUT' | 'BI',
766
- net: string,
767
- x: number,
768
- y: number,
769
- rotation?: number,
770
- mirror?: boolean,
771
- ): Promise<ISCH_PrimitiveComponent | undefined>;
772
- ```
773
-
774
- ## Parameters
775
-
776
- <table><thead><tr><th>
777
-
778
- Parameter
779
-
780
- </th><th>
781
-
782
- Type
783
-
784
- </th><th>
785
-
786
- Description
787
-
788
- </th></tr></thead>
789
- <tbody><tr><td>
790
-
791
- direction
792
-
793
- </td><td>
794
-
795
- 'IN' \| 'OUT' \| 'BI'
796
-
797
- </td><td>
798
-
799
- Port direction
800
-
801
- </td></tr>
802
- <tr><td>
803
-
804
- net
805
-
806
- </td><td>
807
-
808
- string
809
-
810
- </td><td>
811
-
812
- Net name
813
-
814
- </td></tr>
815
- <tr><td>
816
-
817
- x
818
-
819
- </td><td>
820
-
821
- number
822
-
823
- </td><td>
824
-
825
- X coordinate
826
-
827
- </td></tr>
828
- <tr><td>
829
-
830
- y
831
-
832
- </td><td>
833
-
834
- number
835
-
836
- </td><td>
837
-
838
- Y coordinate
839
-
840
- </td></tr>
841
- <tr><td>
842
-
843
- rotation
844
-
845
- </td><td>
846
-
847
- number
848
-
849
- </td><td>
850
-
851
- _(Optional)_ Rotation angle
852
-
853
- </td></tr>
854
- <tr><td>
855
-
856
- mirror
857
-
858
- </td><td>
859
-
860
- boolean
861
-
862
- </td><td>
863
-
864
- _(Optional)_ Whether it is mirrored
865
-
866
- </td></tr>
867
- </tbody></table>
868
-
869
- ## Returns
870
-
871
- Promise&lt;[ISCH\_PrimitiveComponent](./ISCH_PrimitiveComponent.md) \| undefined&gt;
872
-
873
- Device primitive object
874
-
875
- ## Example
876
-
877
- ```javascript
878
- // 1. 随机坐标避免与画布已有图元重合(SCH 坐标单位 10mil)
879
- const x = 2000 + Math.floor(Math.random() * 8000);
880
- const y = 2000 + Math.floor(Math.random() * 8000);
881
-
882
- // 2. 创建输入方向的端口,网络名为 SIG_IN
883
- const port = await eda.sch_PrimitiveComponent.createNetPort(
884
- 'IN', // 端口方向:'IN' / 'OUT' / 'BI'
885
- '嘉立创示例_SIG', // 网络名称
886
- x, // 坐标 X
887
- y, // 坐标 Y
888
- 0, // 旋转角度
889
- false // 是否镜像
890
- );
891
-
892
- // 3. 创建类保留现场,供在画布上观察端口样式
893
- console.log('primitiveId:', port.getState_PrimitiveId());
894
- console.log('net:', port.getState_Net());
895
- console.log('componentType:', port.getState_ComponentType());
896
- ```
897
-
898
- ### createshortcircuitflag
899
-
900
- # SCH\_PrimitiveComponent.createShortCircuitFlag() method
901
-
902
- > 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.
903
-
904
- Create a short circuit flag
905
-
906
- ## Signature
907
-
908
- ```typescript
909
- function createShortCircuitFlag(
910
- x: number,
911
- y: number,
912
- rotation?: number,
913
- mirror?: boolean,
914
- ): Promise<ISCH_PrimitiveComponent | undefined>;
915
- ```
916
-
917
- ## Parameters
918
-
919
- <table><thead><tr><th>
920
-
921
- Parameter
922
-
923
- </th><th>
924
-
925
- Type
926
-
927
- </th><th>
928
-
929
- Description
930
-
931
- </th></tr></thead>
932
- <tbody><tr><td>
933
-
934
- x
935
-
936
- </td><td>
937
-
938
- number
939
-
940
- </td><td>
941
-
942
- X coordinate
943
-
944
- </td></tr>
945
- <tr><td>
946
-
947
- y
948
-
949
- </td><td>
950
-
951
- number
952
-
953
- </td><td>
954
-
955
- Y coordinate
956
-
957
- </td></tr>
958
- <tr><td>
959
-
960
- rotation
961
-
962
- </td><td>
963
-
964
- number
965
-
966
- </td><td>
967
-
968
- _(Optional)_ Rotation angle
969
-
970
- </td></tr>
971
- <tr><td>
972
-
973
- mirror
974
-
975
- </td><td>
976
-
977
- boolean
978
-
979
- </td><td>
980
-
981
- _(Optional)_ Whether it is mirrored
982
-
983
- </td></tr>
984
- </tbody></table>
985
-
986
- ## Returns
987
-
988
- Promise&lt;[ISCH\_PrimitiveComponent](./ISCH_PrimitiveComponent.md) \| undefined&gt;
989
-
990
- Device primitive object
991
-
992
- ## Example
993
-
994
- ```javascript
995
- // 1. 随机坐标避免与画布已有图元重合(SCH 坐标单位 10mil)
996
- const x = 2000 + Math.floor(Math.random() * 8000);
997
- const y = 2000 + Math.floor(Math.random() * 8000);
998
-
999
- // 2. 创建短接标识(无网络名参数,仅位置与姿态)
1000
- const flag = await eda.sch_PrimitiveComponent.createShortCircuitFlag(
1001
- x, // 坐标 X
1002
- y, // 坐标 Y
1003
- 0, // 旋转角度
1004
- false // 是否镜像
1005
- );
1006
-
1007
- // 3. 创建类保留现场,供在画布上观察标识样式
1008
- console.log('primitiveId:', flag.getState_PrimitiveId());
1009
- console.log('componentType:', flag.getState_ComponentType());
1010
- console.log('position:', flag.getState_X(), ',', flag.getState_Y());
1011
- ```
1012
-
1013
- ### delete
1014
-
1015
- # SCH\_PrimitiveComponent.delete() method
1016
-
1017
- > This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
1018
-
1019
- Delete Device
1020
-
1021
- ## Signature
1022
-
1023
- ```typescript
1024
- function delete(primitiveIds: string | ISCH_PrimitiveComponent | Array<string> | Array<ISCH_PrimitiveComponent>): Promise<boolean>;
1025
- ```
1026
-
1027
- ## Parameters
1028
-
1029
- <table><thead><tr><th>
1030
-
1031
- Parameter
1032
-
1033
- </th><th>
1034
-
1035
- Type
1036
-
1037
- </th><th>
1038
-
1039
- Description
1040
-
1041
- </th></tr></thead>
1042
- <tbody><tr><td>
1043
-
1044
- primitiveIds
1045
-
1046
- </td><td>
1047
-
1048
- string \| [ISCH\_PrimitiveComponent](./ISCH_PrimitiveComponent.md) \| Array&lt;string&gt; \| Array&lt;[ISCH\_PrimitiveComponent](./ISCH_PrimitiveComponent.md)<!-- -->&gt;
1049
-
1050
- </td><td>
1051
-
1052
- Device primitive ID or Device primitive object
1053
-
1054
- </td></tr>
1055
- </tbody></table>
1056
-
1057
- ## Returns
1058
-
1059
- Promise&lt;boolean&gt;
1060
-
1061
- Delete Whether the operation is successful
1062
-
1063
- ## Example
1064
-
1065
- ```javascript
1066
- // 1. 创建两个待删除的测试器件(随机坐标避免重合,SCH 坐标单位 10mil)
1067
- const devices = await eda.lib_Device.search('');
1068
- const x = 2000 + Math.floor(Math.random() * 8000);
1069
- const y = 2000 + Math.floor(Math.random() * 8000);
1070
- const comp1 = await eda.sch_PrimitiveComponent.create(devices[0], x, y);
1071
- const comp2 = await eda.sch_PrimitiveComponent.create(devices[0], x + 400, y);
1072
-
1073
- // 2. 记录删除前的器件数量
1074
- const beforeCount = (await eda.sch_PrimitiveComponent.getAll()).length;
1075
-
1076
- // 3. 分别以 ID 字符串和图元对象两种形式删除两个器件
1077
- const deleted1 = await eda.sch_PrimitiveComponent.delete(comp1.getState_PrimitiveId());
1078
- const deleted2 = await eda.sch_PrimitiveComponent.delete(comp2);
1079
-
1080
- // 4. 删除类保留现场(图元已删除,不恢复)
1081
- const afterCount = (await eda.sch_PrimitiveComponent.getAll()).length;
1082
-
1083
- console.log('deleted by id:', deleted1);
1084
- console.log('deleted by object:', deleted2);
1085
- console.log('beforeCount:', beforeCount, '→ afterCount:', afterCount);
1086
- ```
1087
-
1088
- ### get
1089
-
1090
- # SCH\_PrimitiveComponent.get() method
1091
-
1092
- > 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.
1093
-
1094
- Get Device
1095
-
1096
- ## Signature
1097
-
1098
- ```typescript
1099
- function get(primitiveIds: string): Promise<ISCH_PrimitiveComponent | undefined>;
1100
- ```
1101
-
1102
- ## Parameters
1103
-
1104
- <table><thead><tr><th>
1105
-
1106
- Parameter
1107
-
1108
- </th><th>
1109
-
1110
- Type
1111
-
1112
- </th><th>
1113
-
1114
- Description
1115
-
1116
- </th></tr></thead>
1117
- <tbody><tr><td>
1118
-
1119
- primitiveIds
1120
-
1121
- </td><td>
1122
-
1123
- string
1124
-
1125
- </td><td>
1126
-
1127
- Device primitive ID, which can be a string or an array of strings. If it is an array, an array is also returned
1128
-
1129
- </td></tr>
1130
- </tbody></table>
1131
-
1132
- ## Returns
1133
-
1134
- Promise&lt;[ISCH\_PrimitiveComponent](./ISCH_PrimitiveComponent.md) \| undefined&gt;
1135
-
1136
- Device primitive object, `undefined` indicates that the retrieval failed
1137
-
1138
- ## Example
1139
-
1140
- ```javascript
1141
- // 1. 创建两个测试器件(随机坐标避免重合,SCH 坐标单位 10mil)
1142
- const devices = await eda.lib_Device.search('');
1143
- const x = 2000 + Math.floor(Math.random() * 8000);
1144
- const y = 2000 + Math.floor(Math.random() * 8000);
1145
- const comp1 = await eda.sch_PrimitiveComponent.create(devices[0], x, y);
1146
- const comp2 = await eda.sch_PrimitiveComponent.create(devices[0], x + 400, y);
1147
-
1148
- // 2. 传单个 ID 字符串,返回单个器件对象
1149
- const single = await eda.sch_PrimitiveComponent.get(comp1.getState_PrimitiveId());
1150
-
1151
- // 3. 传 ID 数组,返回器件对象数组(任一 ID 未匹配不影响其它图元的返回)
1152
- const arr = await eda.sch_PrimitiveComponent.get([
1153
- comp1.getState_PrimitiveId(),
1154
- comp2.getState_PrimitiveId()
1155
- ]);
1156
-
1157
- // 4. 清理测试图元(查询类需要清理)
1158
- await eda.sch_PrimitiveComponent.delete([comp1.getState_PrimitiveId(), comp2.getState_PrimitiveId()]);
1159
-
1160
- console.log('single designator:', single.getState_Designator());
1161
- console.log('array length:', arr.length);
1162
- console.log('comp2 designator:', arr[1].getState_Designator());
1163
- ```
1164
-
1165
- ### get_1
1166
-
1167
- # SCH\_PrimitiveComponent.get() method
1168
-
1169
- > 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.
1170
-
1171
- Get Device
1172
-
1173
- ## Signature
1174
-
1175
- ```typescript
1176
- function get(primitiveIds: Array<string>): Promise<Array<ISCH_PrimitiveComponent>>;
1177
- ```
1178
-
1179
- ## Parameters
1180
-
1181
- <table><thead><tr><th>
1182
-
1183
- Parameter
1184
-
1185
- </th><th>
1186
-
1187
- Type
1188
-
1189
- </th><th>
1190
-
1191
- Description
1192
-
1193
- </th></tr></thead>
1194
- <tbody><tr><td>
1195
-
1196
- primitiveIds
1197
-
1198
- </td><td>
1199
-
1200
- Array&lt;string&gt;
1201
-
1202
- </td><td>
1203
-
1204
- Device primitive ID, which can be a string or an array of strings. If it is an array, an array is also returned
1205
-
1206
- </td></tr>
1207
- </tbody></table>
1208
-
1209
- ## Returns
1210
-
1211
- Promise&lt;Array&lt;[ISCH\_PrimitiveComponent](./ISCH_PrimitiveComponent.md)<!-- -->&gt;&gt;
1212
-
1213
- Device primitive object; an empty array indicates that the retrieval failed
1214
-
1215
- ## Remarks
1216
-
1217
- If multiple primitive IDs are passed in, a primitive ID that is not matched will not affect the return of other primitives; that is, fewer primitive objects than the number of primitive IDs passed in may be returned.
1218
-
1219
- ### getall
1220
-
1221
- # SCH\_PrimitiveComponent.getAll() method
1222
-
1223
- > 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.
1224
-
1225
- Get all Device
1226
-
1227
- ## Signature
1228
-
1229
- ```typescript
1230
- function getAll(
1231
- componentType?: ESCH_PrimitiveComponentType,
1232
- allSchematicPages?: boolean,
1233
- ): Promise<Array<ISCH_PrimitiveComponent>>;
1234
- ```
1235
-
1236
- ## Parameters
1237
-
1238
- <table><thead><tr><th>
1239
-
1240
- Parameter
1241
-
1242
- </th><th>
1243
-
1244
- Type
1245
-
1246
- </th><th>
1247
-
1248
- Description
1249
-
1250
- </th></tr></thead>
1251
- <tbody><tr><td>
1252
-
1253
- componentType
1254
-
1255
- </td><td>
1256
-
1257
- [ESCH\_PrimitiveComponentType](../enums/ESCH_PrimitiveComponentType.md)
1258
-
1259
- </td><td>
1260
-
1261
- _(Optional)_ Device type
1262
-
1263
- </td></tr>
1264
- <tr><td>
1265
-
1266
- allSchematicPages
1267
-
1268
- </td><td>
1269
-
1270
- boolean
1271
-
1272
- </td><td>
1273
-
1274
- _(Optional)_ Whether to get the devices of all schematic sheets
1275
-
1276
- </td></tr>
1277
- </tbody></table>
1278
-
1279
- ## Returns
1280
-
1281
- Promise&lt;Array&lt;[ISCH\_PrimitiveComponent](./ISCH_PrimitiveComponent.md)<!-- -->&gt;&gt;
1282
-
1283
- Array of Device primitive objects
1284
-
1285
- ## Example
1286
-
1287
- ```javascript
1288
- // 1. 创建一个普通元件和一个网络标识作为查找目标(随机坐标避免重合)
1289
- const devices = await eda.lib_Device.search('');
1290
- const x = 2000 + Math.floor(Math.random() * 8000);
1291
- const y = 2000 + Math.floor(Math.random() * 8000);
1292
- const comp = await eda.sch_PrimitiveComponent.create(devices[0], x, y);
1293
- const flag = await eda.sch_PrimitiveComponent.createNetFlag('Power', '嘉立创示例_VCC', x + 600, y);
1294
- const compId = comp.getState_PrimitiveId();
1295
-
1296
- // 2. 不传参数,取当前图页全部器件
1297
- const all = await eda.sch_PrimitiveComponent.getAll();
1298
-
1299
- // 3. 传入类型 'netflag' 只取网络标识(ESCH_PrimitiveComponentType 值)
1300
- const flags = await eda.sch_PrimitiveComponent.getAll('netflag');
1301
-
1302
- // 4. 清理测试图元(查询类需要清理)
1303
- await eda.sch_PrimitiveComponent.delete([compId, flag.getState_PrimitiveId()]);
1304
-
1305
- console.log('total components:', all.length);
1306
- console.log('marker comp found:', all.some(c => c.getState_PrimitiveId() === compId));
1307
- console.log('netflag count:', flags.length);
1308
- ```
1309
-
1310
- ### getallpinsbyprimitiveid
1311
-
1312
- # SCH\_PrimitiveComponent.getAllPinsByPrimitiveId() method
1313
-
1314
- > 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.
1315
-
1316
- Get all pins associated with the device
1317
-
1318
- ## Signature
1319
-
1320
- ```typescript
1321
- function getAllPinsByPrimitiveId(
1322
- primitiveId: string,
1323
- ): Promise<Array<ISCH_PrimitiveComponentPin> | undefined>;
1324
- ```
1325
-
1326
- ## Parameters
1327
-
1328
- <table><thead><tr><th>
1329
-
1330
- Parameter
1331
-
1332
- </th><th>
1333
-
1334
- Type
1335
-
1336
- </th><th>
1337
-
1338
- Description
1339
-
1340
- </th></tr></thead>
1341
- <tbody><tr><td>
1342
-
1343
- primitiveId
1344
-
1345
- </td><td>
1346
-
1347
- string
1348
-
1349
- </td><td>
1350
-
1351
- Device primitive ID
1352
-
1353
- </td></tr>
1354
- </tbody></table>
1355
-
1356
- ## Returns
1357
-
1358
- Promise&lt;Array&lt;[ISCH\_PrimitiveComponentPin](./ISCH_PrimitiveComponentPin.md)<!-- -->&gt; \| undefined&gt;
1359
-
1360
- Device pin primitive array
1361
-
1362
- ## Example
1363
-
1364
- ```javascript
1365
- // 1. 创建一个带引脚的测试器件(随机坐标避免重合,SCH 坐标单位 10mil)
1366
- const devices = await eda.lib_Device.search('');
1367
- const x = 2000 + Math.floor(Math.random() * 8000);
1368
- const y = 2000 + Math.floor(Math.random() * 8000);
1369
- const comp = await eda.sch_PrimitiveComponent.create(devices[0], x, y);
1370
- const compId = comp.getState_PrimitiveId();
1371
-
1372
- // 2. 按图元 ID 取出该器件的全部引脚(返回纯数据对象,字段直接可读)
1373
- const pins = await eda.sch_PrimitiveComponent.getAllPinsByPrimitiveId(compId);
1374
-
1375
- // 3. 清理测试图元(查询类需要清理)
1376
- await eda.sch_PrimitiveComponent.delete([compId]);
1377
-
1378
- console.log('pin count:', pins.length);
1379
- console.log('first pin number:', pins[0].pinNumber);
1380
- console.log('first pin type:', pins[0].pinType);
1381
- ```
1382
-
1383
- ### getallprimitiveid
1384
-
1385
- # SCH\_PrimitiveComponent.getAllPrimitiveId() method
1386
-
1387
- > 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.
1388
-
1389
- Get all Device primitive IDs
1390
-
1391
- ## Signature
1392
-
1393
- ```typescript
1394
- function getAllPrimitiveId(
1395
- componentType?: ESCH_PrimitiveComponentType,
1396
- allSchematicPages?: boolean,
1397
- ): Promise<Array<string>>;
1398
- ```
1399
-
1400
- ## Parameters
1401
-
1402
- <table><thead><tr><th>
1403
-
1404
- Parameter
1405
-
1406
- </th><th>
1407
-
1408
- Type
1409
-
1410
- </th><th>
1411
-
1412
- Description
1413
-
1414
- </th></tr></thead>
1415
- <tbody><tr><td>
1416
-
1417
- componentType
1418
-
1419
- </td><td>
1420
-
1421
- [ESCH\_PrimitiveComponentType](../enums/ESCH_PrimitiveComponentType.md)
1422
-
1423
- </td><td>
1424
-
1425
- _(Optional)_ Device type
1426
-
1427
- </td></tr>
1428
- <tr><td>
1429
-
1430
- allSchematicPages
1431
-
1432
- </td><td>
1433
-
1434
- boolean
1435
-
1436
- </td><td>
1437
-
1438
- _(Optional)_ Whether to get the devices of all schematic sheets
1439
-
1440
- </td></tr>
1441
- </tbody></table>
1442
-
1443
- ## Returns
1444
-
1445
- Promise&lt;Array&lt;string&gt;&gt;
1446
-
1447
- Array of Device primitive IDs
1448
-
1449
- ## Example
1450
-
1451
- ```javascript
1452
- // 1. 创建一个网络标识作为查找目标(随机坐标避免重合,SCH 坐标单位 10mil)
1453
- const x = 2000 + Math.floor(Math.random() * 8000);
1454
- const y = 2000 + Math.floor(Math.random() * 8000);
1455
- const flag = await eda.sch_PrimitiveComponent.createNetFlag('Power', '嘉立创示例_VCC', x, y);
1456
- const flagId = flag.getState_PrimitiveId();
1457
-
1458
- // 2. 不传参数,取当前图页全部器件的图元 ID
1459
- const allIds = await eda.sch_PrimitiveComponent.getAllPrimitiveId();
1460
-
1461
- // 3. 传入类型 'netflag' 只取网络标识的图元 ID
1462
- const flagIds = await eda.sch_PrimitiveComponent.getAllPrimitiveId('netflag');
1463
-
1464
- // 4. 清理测试图元(查询类需要清理)
1465
- await eda.sch_PrimitiveComponent.delete([flagId]);
1466
-
1467
- console.log('total ids:', allIds.length);
1468
- console.log('netflag ids:', flagIds.length);
1469
- console.log('marker flag found:', flagIds.includes(flagId));
1470
- ```
1471
-
1472
- ### getallpropertynames
1473
-
1474
- # SCH\_PrimitiveComponent.getAllPropertyNames() method
1475
-
1476
- > 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.
1477
-
1478
- Get The set of all property names of all devices
1479
-
1480
- ## Signature
1481
-
1482
- ```typescript
1483
- function getAllPropertyNames(): Promise<Array<string>>;
1484
- ```
1485
-
1486
- ## Returns
1487
-
1488
- Promise&lt;Array&lt;string&gt;&gt;
1489
-
1490
- The set of all property names of all devices
1491
-
1492
- ## Example
1493
-
1494
- ```javascript
1495
- // 1. 创建一个测试器件,保证画布上有带属性的器件(随机坐标避免重合)
1496
- const devices = await eda.lib_Device.search('');
1497
- const x = 2000 + Math.floor(Math.random() * 8000);
1498
- const y = 2000 + Math.floor(Math.random() * 8000);
1499
- const comp = await eda.sch_PrimitiveComponent.create(devices[0], x, y);
1500
-
1501
- // 2. 取所有器件出现过的属性名称集合
1502
- const names = await eda.sch_PrimitiveComponent.getAllPropertyNames();
1503
-
1504
- // 3. 清理测试图元(查询类需要清理)
1505
- await eda.sch_PrimitiveComponent.delete([comp.getState_PrimitiveId()]);
1506
-
1507
- console.log('property name count:', names.length);
1508
- console.log('names:', names.join(', '));
1509
- ```
1510
-
1511
- ### modify
1512
-
1513
- # SCH\_PrimitiveComponent.modify() method
1514
-
1515
- > 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.
1516
-
1517
- Modify Device
1518
-
1519
- ## Signature
1520
-
1521
- ```typescript
1522
- function modify(
1523
- primitiveId: string | ISCH_PrimitiveComponent,
1524
- property: {
1525
- x?: undefined | number;
1526
- y?: undefined | number;
1527
- rotation?: undefined | number;
1528
- mirror?: undefined | false | true;
1529
- addIntoBom?: undefined | false | true;
1530
- addIntoPcb?: undefined | false | true;
1531
- designator?: undefined | null | string;
1532
- name?: undefined | null | string;
1533
- uniqueId?: undefined | null | string;
1534
- manufacturer?: undefined | null | string;
1535
- manufacturerId?: undefined | null | string;
1536
- supplier?: undefined | null | string;
1537
- supplierId?: undefined | null | string;
1538
- otherProperty?: undefined | Record<string, string | number | false | true>;
1539
- },
1540
- ): Promise<ISCH_PrimitiveComponent | undefined>;
1541
- ```
1542
-
1543
- ## Parameters
1544
-
1545
- <table><thead><tr><th>
1546
-
1547
- Parameter
1548
-
1549
- </th><th>
1550
-
1551
- Type
1552
-
1553
- </th><th>
1554
-
1555
- Description
1556
-
1557
- </th></tr></thead>
1558
- <tbody><tr><td>
1559
-
1560
- primitiveId
1561
-
1562
- </td><td>
1563
-
1564
- string \| [ISCH\_PrimitiveComponent](./ISCH_PrimitiveComponent.md)
1565
-
1566
- </td><td>
1567
-
1568
- Primitive ID
1569
-
1570
- </td></tr>
1571
- <tr><td>
1572
-
1573
- property
1574
-
1575
- </td><td>
1576
-
1577
- { x?: undefined \| number; y?: undefined \| number; rotation?: undefined \| number; mirror?: undefined \| false \| true; addIntoBom?: undefined \| false \| true; addIntoPcb?: undefined \| false \| true; designator?: undefined \| null \| string; name?: undefined \| null \| string; uniqueId?: undefined \| null \| string; manufacturer?: undefined \| null \| string; manufacturerId?: undefined \| null \| string; supplier?: undefined \| null \| string; supplierId?: undefined \| null \| string; otherProperty?: undefined \| Record&lt;string, string \| number \| false \| true&gt; }
1578
-
1579
- </td><td>
1580
-
1581
- </td></tr>
1582
- </tbody></table>
1583
-
1584
- ## Returns
1585
-
1586
- Promise&lt;[ISCH\_PrimitiveComponent](./ISCH_PrimitiveComponent.md) \| undefined&gt;
1587
-
1588
- Device primitive object
1589
-
1590
- ## Remarks
1591
-
1592
- This method can only be used for modification when the device type is [COMPONENT](../enums/ESCH_PrimitiveComponentType.md)
1593
-
1594
- ## Example
1595
-
1596
- ```javascript
1597
- // 1. 创建待修改的测试器件(随机坐标避免与画布已有器件重合)
1598
- const devices = await eda.lib_Device.search('');
1599
- const x = 2000 + Math.floor(Math.random() * 8000);
1600
- const y = 2000 + Math.floor(Math.random() * 8000);
1601
- const comp = await eda.sch_PrimitiveComponent.create(devices[0], x, y);
1602
- const compId = comp.getState_PrimitiveId();
1603
-
1604
- // 2. 读取修改前的位号、旋转与 X 坐标
1605
- const beforeDesignator = comp.getState_Designator();
1606
- const beforeRotation = comp.getState_Rotation();
1607
- const beforeX = comp.getState_X();
1608
-
1609
- // 3. 批量修改:右移 400(约 101.6mm)、旋转 90 度、位号改为 U100
1610
- await eda.sch_PrimitiveComponent.modify(compId, {
1611
- x: x + 400,
1612
- rotation: 90,
1613
- designator: '嘉立创示例_U100'
1614
- });
1615
-
1616
- // 4. modify 返回后需要重新 get() 才能读到画布上的最新值
1617
- const refreshed = await eda.sch_PrimitiveComponent.get(compId);
1618
-
1619
- // 5. 修改类保留现场,供观察修改结果
1620
- console.log('primitiveId:', compId);
1621
- console.log('designator:', beforeDesignator, '→', refreshed.getState_Designator());
1622
- console.log('rotation:', beforeRotation, '→', refreshed.getState_Rotation());
1623
- console.log('x:', beforeX, '→', refreshed.getState_X());
1624
- ```
1625
-
1626
- ### placecbbschematicpage
1627
-
1628
- # SCH\_PrimitiveComponent.placeCbbSchematicPage() method
1629
-
1630
- > This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
1631
-
1632
- Place reuse block schematic sheet
1633
-
1634
- ## Signature
1635
-
1636
- ```typescript
1637
- function placeCbbSchematicPage(
1638
- cbbSchematicPage: { libraryUuid: string; cbbUuid: string; uuid: string },
1639
- x: number,
1640
- y: number,
1641
- props?: { reimportWhenNameRepeated?: undefined | false | true },
1642
- ): Promise<boolean>;
1643
- ```
1644
-
1645
- ## Parameters
1646
-
1647
- <table><thead><tr><th>
1648
-
1649
- Parameter
1650
-
1651
- </th><th>
1652
-
1653
- Type
1654
-
1655
- </th><th>
1656
-
1657
- Description
1658
-
1659
- </th></tr></thead>
1660
- <tbody><tr><td>
1661
-
1662
- cbbSchematicPage
1663
-
1664
- </td><td>
1665
-
1666
- \{ libraryUuid: string; cbbUuid: string; uuid: string \}
1667
-
1668
- </td><td>
1669
-
1670
- Reuse block schematic sheet. `libraryUuid` is the UUID of the library where the CBB project is located, `cbbUuid` is the UUID of the CBB project, and `uuid` is the UUID of the schematic sheet in the CBB project
1671
-
1672
- </td></tr>
1673
- <tr><td>
1674
-
1675
- x
1676
-
1677
- </td><td>
1678
-
1679
- number
1680
-
1681
- </td><td>
1682
-
1683
- X coordinate
1684
-
1685
- </td></tr>
1686
- <tr><td>
1687
-
1688
- y
1689
-
1690
- </td><td>
1691
-
1692
- number
1693
-
1694
- </td><td>
1695
-
1696
- Y coordinate
1697
-
1698
- </td></tr>
1699
- <tr><td>
1700
-
1701
- props
1702
-
1703
- </td><td>
1704
-
1705
- \{ reimportWhenNameRepeated?: undefined \| false \| true \}
1706
-
1707
- </td><td>
1708
-
1709
- _(Optional)_ Placement parameters: `reimportWhenNameRepeated` - whether to re-import when a module with the same name exists, default `true`<!-- -->. ADD since EDA v4.2
1710
-
1711
- </td></tr>
1712
- </tbody></table>
1713
-
1714
- ## Returns
1715
-
1716
- Promise&lt;boolean&gt;
1717
-
1718
- Place whether the operation is successful
1719
-
1720
- ### placecomponentwithmouse
1721
-
1722
- # SCH\_PrimitiveComponent.placeComponentWithMouse() method
1723
-
1724
- > 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.
1725
-
1726
- Place with the mouse device
1727
-
1728
- ## Signature
1729
-
1730
- ```typescript
1731
- function placeComponentWithMouse(
1732
- component: { libraryUuid: string; uuid: string } | ILIB_DeviceItem | ILIB_DeviceSearchItem,
1733
- subPartName?: string,
1734
- ): Promise<boolean>;
1735
- ```
1736
-
1737
- ## Parameters
1738
-
1739
- <table><thead><tr><th>
1740
-
1741
- Parameter
1742
-
1743
- </th><th>
1744
-
1745
- Type
1746
-
1747
- </th><th>
1748
-
1749
- Description
1750
-
1751
- </th></tr></thead>
1752
- <tbody><tr><td>
1753
-
1754
- component
1755
-
1756
- </td><td>
1757
-
1758
- { libraryUuid: string; uuid: string } \| [ILIB\_DeviceItem](../interfaces/ILIB_DeviceItem.md) \| [ILIB\_DeviceSearchItem](../interfaces/ILIB_DeviceSearchItem.md)
1759
-
1760
- </td><td>
1761
-
1762
- Associate library device
1763
-
1764
- </td></tr>
1765
- <tr><td>
1766
-
1767
- subPartName
1768
-
1769
- </td><td>
1770
-
1771
- string
1772
-
1773
- </td><td>
1774
-
1775
- _(Optional)_ Sub-part name
1776
-
1777
- </td></tr>
1778
- </tbody></table>
1779
-
1780
- ## Returns
1781
-
1782
- Promise&lt;boolean&gt;
1783
-
1784
- Whether the device was found
1785
-
1786
- ## Remarks
1787
-
1788
- This API simulates clicking the placement button on the front end. The specified device will be bound to the current mouse and placed on the canvas when the user clicks subsequently
1789
-
1790
- The return timing of this API does not wait for the user's placement operation. Once the device is bound to the mouse, this API will immediately return `true`
1791
-
1792
- ### placesymbolwithmouse
1793
-
1794
- # SCH\_PrimitiveComponent.placeSymbolWithMouse() method
1795
-
1796
- > 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.
1797
-
1798
- Place with the mouse symbol
1799
-
1800
- ## Signature
1801
-
1802
- ```typescript
1803
- function placeSymbolWithMouse(
1804
- symbol: { libraryUuid: string; uuid: string } | ILIB_SymbolItem | ILIB_SymbolSearchItem,
1805
- subPartName?: string,
1806
- properties?: Record<string, boolean | number | string | undefined>,
1807
- ): Promise<boolean>;
1808
- ```
1809
-
1810
- ## Parameters
1811
-
1812
- <table><thead><tr><th>
1813
-
1814
- Parameter
1815
-
1816
- </th><th>
1817
-
1818
- Type
1819
-
1820
- </th><th>
1821
-
1822
- Description
1823
-
1824
- </th></tr></thead>
1825
- <tbody><tr><td>
1826
-
1827
- symbol
1828
-
1829
- </td><td>
1830
-
1831
- { libraryUuid: string; uuid: string } \| [ILIB\_SymbolItem](../interfaces/ILIB_SymbolItem.md) \| [ILIB\_SymbolSearchItem](../interfaces/ILIB_SymbolSearchItem.md)
1832
-
1833
- </td><td>
1834
-
1835
- Associate library symbol
1836
-
1837
- </td></tr>
1838
- <tr><td>
1839
-
1840
- subPartName
1841
-
1842
- </td><td>
1843
-
1844
- string
1845
-
1846
- </td><td>
1847
-
1848
- _(Optional)_ Sub-part name
1849
-
1850
- </td></tr>
1851
- <tr><td>
1852
-
1853
- properties
1854
-
1855
- </td><td>
1856
-
1857
- Record&lt;string, boolean \| number \| string \| undefined&gt;
1858
-
1859
- </td><td>
1860
-
1861
- _(Optional)_ Device property
1862
-
1863
- </td></tr>
1864
- </tbody></table>
1865
-
1866
- ## Returns
1867
-
1868
- Promise&lt;boolean&gt;
1869
-
1870
- Whether the symbol was found
1871
-
1872
- ## Remarks
1873
-
1874
- This API simulates clicking the placement button on the front end. The specified symbol will be bound to the current mouse and placed on the canvas when the user clicks subsequently
1875
-
1876
- The return timing of this API does not wait for the user's placement operation. Once the symbol is bound to the mouse, this API will immediately return `true` ADD since API v0.2.26
1877
-
1878
- ### setnetflagcomponentuuid_analogground
1879
-
1880
- # SCH\_PrimitiveComponent.setNetFlagComponentUuid\_AnalogGround() method
1881
-
1882
- > 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.
1883
-
1884
- Set the device UUID associated with the AnalogGround net flag in the extension API
1885
-
1886
- ## Signature
1887
-
1888
- ```typescript
1889
- function setNetFlagComponentUuid_AnalogGround(
1890
- component: { libraryUuid: string; uuid: string } | ILIB_DeviceItem | ILIB_DeviceSearchItem,
1891
- ): Promise<boolean>;
1892
- ```
1893
-
1894
- ## Parameters
1895
-
1896
- <table><thead><tr><th>
1897
-
1898
- Parameter
1899
-
1900
- </th><th>
1901
-
1902
- Type
1903
-
1904
- </th><th>
1905
-
1906
- Description
1907
-
1908
- </th></tr></thead>
1909
- <tbody><tr><td>
1910
-
1911
- component
1912
-
1913
- </td><td>
1914
-
1915
- { libraryUuid: string; uuid: string } \| [ILIB\_DeviceItem](../interfaces/ILIB_DeviceItem.md) \| [ILIB\_DeviceSearchItem](../interfaces/ILIB_DeviceSearchItem.md)
1916
-
1917
- </td><td>
1918
-
1919
- Associate library device
1920
-
1921
- </td></tr>
1922
- </tbody></table>
1923
-
1924
- ## Returns
1925
-
1926
- Promise&lt;boolean&gt;
1927
-
1928
- Whether the operation is successful
1929
-
1930
- ### setnetflagcomponentuuid_ground
1931
-
1932
- # SCH\_PrimitiveComponent.setNetFlagComponentUuid\_Ground() method
1933
-
1934
- > 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.
1935
-
1936
- Set the device UUID associated with the Ground net flag in the extension API
1937
-
1938
- ## Signature
1939
-
1940
- ```typescript
1941
- function setNetFlagComponentUuid_Ground(
1942
- component: { libraryUuid: string; uuid: string } | ILIB_DeviceItem | ILIB_DeviceSearchItem,
1943
- ): Promise<boolean>;
1944
- ```
1945
-
1946
- ## Parameters
1947
-
1948
- <table><thead><tr><th>
1949
-
1950
- Parameter
1951
-
1952
- </th><th>
1953
-
1954
- Type
1955
-
1956
- </th><th>
1957
-
1958
- Description
1959
-
1960
- </th></tr></thead>
1961
- <tbody><tr><td>
1962
-
1963
- component
1964
-
1965
- </td><td>
1966
-
1967
- { libraryUuid: string; uuid: string } \| [ILIB\_DeviceItem](../interfaces/ILIB_DeviceItem.md) \| [ILIB\_DeviceSearchItem](../interfaces/ILIB_DeviceSearchItem.md)
1968
-
1969
- </td><td>
1970
-
1971
- Associate library device
1972
-
1973
- </td></tr>
1974
- </tbody></table>
1975
-
1976
- ## Returns
1977
-
1978
- Promise&lt;boolean&gt;
1979
-
1980
- Whether the operation is successful
1981
-
1982
- ### setnetflagcomponentuuid_power
1983
-
1984
- # SCH\_PrimitiveComponent.setNetFlagComponentUuid\_Power() method
1985
-
1986
- > 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.
1987
-
1988
- Set the device UUID associated with the Power net flag in the extension API
1989
-
1990
- ## Signature
1991
-
1992
- ```typescript
1993
- function setNetFlagComponentUuid_Power(
1994
- component: { libraryUuid: string; uuid: string } | ILIB_DeviceItem | ILIB_DeviceSearchItem,
1995
- ): Promise<boolean>;
1996
- ```
1997
-
1998
- ## Parameters
1999
-
2000
- <table><thead><tr><th>
2001
-
2002
- Parameter
2003
-
2004
- </th><th>
2005
-
2006
- Type
2007
-
2008
- </th><th>
2009
-
2010
- Description
2011
-
2012
- </th></tr></thead>
2013
- <tbody><tr><td>
2014
-
2015
- component
2016
-
2017
- </td><td>
2018
-
2019
- { libraryUuid: string; uuid: string } \| [ILIB\_DeviceItem](../interfaces/ILIB_DeviceItem.md) \| [ILIB\_DeviceSearchItem](../interfaces/ILIB_DeviceSearchItem.md)
2020
-
2021
- </td><td>
2022
-
2023
- Associate library device
2024
-
2025
- </td></tr>
2026
- </tbody></table>
2027
-
2028
- ## Returns
2029
-
2030
- Promise&lt;boolean&gt;
2031
-
2032
- Whether the operation is successful
2033
-
2034
- ### setnetflagcomponentuuid_protectground
2035
-
2036
- # SCH\_PrimitiveComponent.setNetFlagComponentUuid\_ProtectGround() method
2037
-
2038
- > 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.
2039
-
2040
- Set the device UUID associated with the ProtectGround net flag in the extension API
2041
-
2042
- ## Signature
2043
-
2044
- ```typescript
2045
- function setNetFlagComponentUuid_ProtectGround(
2046
- component: { libraryUuid: string; uuid: string } | ILIB_DeviceItem | ILIB_DeviceSearchItem,
2047
- ): Promise<boolean>;
2048
- ```
2049
-
2050
- ## Parameters
2051
-
2052
- <table><thead><tr><th>
2053
-
2054
- Parameter
2055
-
2056
- </th><th>
2057
-
2058
- Type
2059
-
2060
- </th><th>
2061
-
2062
- Description
2063
-
2064
- </th></tr></thead>
2065
- <tbody><tr><td>
2066
-
2067
- component
2068
-
2069
- </td><td>
2070
-
2071
- { libraryUuid: string; uuid: string } \| [ILIB\_DeviceItem](../interfaces/ILIB_DeviceItem.md) \| [ILIB\_DeviceSearchItem](../interfaces/ILIB_DeviceSearchItem.md)
2072
-
2073
- </td><td>
2074
-
2075
- Associate library device
2076
-
2077
- </td></tr>
2078
- </tbody></table>
2079
-
2080
- ## Returns
2081
-
2082
- Promise&lt;boolean&gt;
2083
-
2084
- Whether the operation is successful
2085
-
2086
- ### setnetportcomponentuuid_bi
2087
-
2088
- # SCH\_PrimitiveComponent.setNetPortComponentUuid\_BI() method
2089
-
2090
- > 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.
2091
-
2092
- Set the device UUID associated with the BI net port in the extension API
2093
-
2094
- ## Signature
2095
-
2096
- ```typescript
2097
- function setNetPortComponentUuid_BI(
2098
- component: { libraryUuid: string; uuid: string } | ILIB_DeviceItem | ILIB_DeviceSearchItem,
2099
- ): Promise<boolean>;
2100
- ```
2101
-
2102
- ## Parameters
2103
-
2104
- <table><thead><tr><th>
2105
-
2106
- Parameter
2107
-
2108
- </th><th>
2109
-
2110
- Type
2111
-
2112
- </th><th>
2113
-
2114
- Description
2115
-
2116
- </th></tr></thead>
2117
- <tbody><tr><td>
2118
-
2119
- component
2120
-
2121
- </td><td>
2122
-
2123
- { libraryUuid: string; uuid: string } \| [ILIB\_DeviceItem](../interfaces/ILIB_DeviceItem.md) \| [ILIB\_DeviceSearchItem](../interfaces/ILIB_DeviceSearchItem.md)
2124
-
2125
- </td><td>
2126
-
2127
- Associate library device
2128
-
2129
- </td></tr>
2130
- </tbody></table>
2131
-
2132
- ## Returns
2133
-
2134
- Promise&lt;boolean&gt;
2135
-
2136
- Whether the operation is successful
2137
-
2138
- ### setnetportcomponentuuid_in
2139
-
2140
- # SCH\_PrimitiveComponent.setNetPortComponentUuid\_IN() method
2141
-
2142
- > 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.
2143
-
2144
- Set the device UUID associated with the IN net port in the extension API
2145
-
2146
- ## Signature
2147
-
2148
- ```typescript
2149
- function setNetPortComponentUuid_IN(
2150
- component: { libraryUuid: string; uuid: string } | ILIB_DeviceItem | ILIB_DeviceSearchItem,
2151
- ): Promise<boolean>;
2152
- ```
2153
-
2154
- ## Parameters
2155
-
2156
- <table><thead><tr><th>
2157
-
2158
- Parameter
2159
-
2160
- </th><th>
2161
-
2162
- Type
2163
-
2164
- </th><th>
2165
-
2166
- Description
2167
-
2168
- </th></tr></thead>
2169
- <tbody><tr><td>
2170
-
2171
- component
2172
-
2173
- </td><td>
2174
-
2175
- { libraryUuid: string; uuid: string } \| [ILIB\_DeviceItem](../interfaces/ILIB_DeviceItem.md) \| [ILIB\_DeviceSearchItem](../interfaces/ILIB_DeviceSearchItem.md)
2176
-
2177
- </td><td>
2178
-
2179
- Associate library device
2180
-
2181
- </td></tr>
2182
- </tbody></table>
2183
-
2184
- ## Returns
2185
-
2186
- Promise&lt;boolean&gt;
2187
-
2188
- Whether the operation is successful
2189
-
2190
- ### setnetportcomponentuuid_out
2191
-
2192
- # SCH\_PrimitiveComponent.setNetPortComponentUuid\_OUT() method
2193
-
2194
- > 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.
2195
-
2196
- Set the device UUID associated with the OUT net port in the extension API
2197
-
2198
- ## Signature
2199
-
2200
- ```typescript
2201
- function setNetPortComponentUuid_OUT(
2202
- component: { libraryUuid: string; uuid: string } | ILIB_DeviceItem | ILIB_DeviceSearchItem,
2203
- ): Promise<boolean>;
2204
- ```
2205
-
2206
- ## Parameters
2207
-
2208
- <table><thead><tr><th>
2209
-
2210
- Parameter
2211
-
2212
- </th><th>
2213
-
2214
- Type
2215
-
2216
- </th><th>
2217
-
2218
- Description
2219
-
2220
- </th></tr></thead>
2221
- <tbody><tr><td>
2222
-
2223
- component
2224
-
2225
- </td><td>
2226
-
2227
- { libraryUuid: string; uuid: string } \| [ILIB\_DeviceItem](../interfaces/ILIB_DeviceItem.md) \| [ILIB\_DeviceSearchItem](../interfaces/ILIB_DeviceSearchItem.md)
2228
-
2229
- </td><td>
2230
-
2231
- Associate library device
2232
-
2233
- </td></tr>
2234
- </tbody></table>
2235
-
2236
- ## Returns
2237
-
2238
- Promise&lt;boolean&gt;
2239
-
2240
- Whether the operation is successful
1
+ # SCH\_PrimitiveComponent class
2
+
3
+ Schematic &amp; symbol / device primitive class
4
+
5
+ ## Signature
6
+
7
+ ```typescript
8
+ class SCH_PrimitiveComponent implements ISCH_PrimitiveAPI
9
+ ```
10
+ **Implements:** [ISCH\_PrimitiveAPI](../interfaces/ISCH_PrimitiveAPI.md)
11
+
12
+ ## Remarks
13
+
14
+ ## Methods
15
+
16
+ <table><thead><tr><th>
17
+
18
+ Method
19
+
20
+ </th><th>
21
+
22
+ Modifiers
23
+
24
+ </th><th>
25
+
26
+ Description
27
+
28
+ </th></tr></thead>
29
+ <tbody><tr><td>
30
+
31
+ [create(component, x, y, subPartName, rotation, mirror, addIntoBom, addIntoPcb)](./SCH_PrimitiveComponent.md)
32
+
33
+ </td><td>
34
+
35
+ </td><td>
36
+
37
+ **_(BETA)_** Create Device
38
+
39
+ </td></tr>
40
+ <tr><td>
41
+
42
+ [createCbbSymbol(cbbSymbol, x, y, rotation, mirror)](./SCH_PrimitiveComponent.md)
43
+
44
+ </td><td>
45
+
46
+ </td><td>
47
+
48
+ **_(BETA)_** Create Reuse block symbol
49
+
50
+ </td></tr>
51
+ <tr><td>
52
+
53
+ [createNetFlag(identification, net, x, y, rotation, mirror)](./SCH_PrimitiveComponent.md)
54
+
55
+ </td><td>
56
+
57
+ </td><td>
58
+
59
+ **_(BETA)_** Create Net flag
60
+
61
+ </td></tr>
62
+ <tr><td>
63
+
64
+ [createNetPort(direction, net, x, y, rotation, mirror)](./SCH_PrimitiveComponent.md)
65
+
66
+ </td><td>
67
+
68
+ </td><td>
69
+
70
+ **_(BETA)_** Create Net port
71
+
72
+ </td></tr>
73
+ <tr><td>
74
+
75
+ [createShortCircuitFlag(x, y, rotation, mirror)](./SCH_PrimitiveComponent.md)
76
+
77
+ </td><td>
78
+
79
+ </td><td>
80
+
81
+ **_(BETA)_** Create a short circuit flag
82
+
83
+ </td></tr>
84
+ <tr><td>
85
+
86
+ [delete(primitiveIds)](./SCH_PrimitiveComponent.md)
87
+
88
+ </td><td>
89
+
90
+ </td><td>
91
+
92
+ **_(BETA)_** Delete Device
93
+
94
+ </td></tr>
95
+ <tr><td>
96
+
97
+ [get(primitiveIds)](./SCH_PrimitiveComponent.md)
98
+
99
+ </td><td>
100
+
101
+ </td><td>
102
+
103
+ **_(BETA)_** Get Device
104
+
105
+ </td></tr>
106
+ <tr><td>
107
+
108
+ [get(primitiveIds)](./SCH_PrimitiveComponent.md)
109
+
110
+ </td><td>
111
+
112
+ </td><td>
113
+
114
+ **_(BETA)_** Get Device
115
+
116
+ </td></tr>
117
+ <tr><td>
118
+
119
+ [getAll(componentType, allSchematicPages)](./SCH_PrimitiveComponent.md)
120
+
121
+ </td><td>
122
+
123
+ </td><td>
124
+
125
+ **_(BETA)_** Get all Device
126
+
127
+ </td></tr>
128
+ <tr><td>
129
+
130
+ [getAllPinsByPrimitiveId(primitiveId)](./SCH_PrimitiveComponent.md)
131
+
132
+ </td><td>
133
+
134
+ </td><td>
135
+
136
+ **_(BETA)_** Get all pins associated with the device
137
+
138
+ </td></tr>
139
+ <tr><td>
140
+
141
+ [getAllPrimitiveId(componentType, allSchematicPages)](./SCH_PrimitiveComponent.md)
142
+
143
+ </td><td>
144
+
145
+ </td><td>
146
+
147
+ **_(BETA)_** Get all Device primitive IDs
148
+
149
+ </td></tr>
150
+ <tr><td>
151
+
152
+ [getAllPropertyNames()](./SCH_PrimitiveComponent.md)
153
+
154
+ </td><td>
155
+
156
+ </td><td>
157
+
158
+ **_(BETA)_** Get The set of all property names of all devices
159
+
160
+ </td></tr>
161
+ <tr><td>
162
+
163
+ [modify(primitiveId, property)](./SCH_PrimitiveComponent.md)
164
+
165
+ </td><td>
166
+
167
+ </td><td>
168
+
169
+ **_(BETA)_** Modify Device
170
+
171
+ </td></tr>
172
+ <tr><td>
173
+
174
+ [placeCbbSchematicPage(cbbSchematicPage, x, y, props)](./SCH_PrimitiveComponent.md)
175
+
176
+ </td><td>
177
+
178
+ </td><td>
179
+
180
+ **_(BETA)_** Place reuse block schematic sheet
181
+
182
+ </td></tr>
183
+ <tr><td>
184
+
185
+ [placeComponentWithMouse(component, subPartName)](./SCH_PrimitiveComponent.md)
186
+
187
+ </td><td>
188
+
189
+ </td><td>
190
+
191
+ **_(BETA)_** Place with the mouse device
192
+
193
+ </td></tr>
194
+ <tr><td>
195
+
196
+ [placeSymbolWithMouse(symbol, subPartName, properties)](./SCH_PrimitiveComponent.md)
197
+
198
+ </td><td>
199
+
200
+ </td><td>
201
+
202
+ **_(BETA)_** Place with the mouse symbol
203
+
204
+ </td></tr>
205
+ <tr><td>
206
+
207
+ [setNetFlagComponentUuid\_AnalogGround(component)](./SCH_PrimitiveComponent.md)
208
+
209
+ </td><td>
210
+
211
+ </td><td>
212
+
213
+ **_(BETA)_** Set the device UUID associated with the AnalogGround net flag in the extension API
214
+
215
+ </td></tr>
216
+ <tr><td>
217
+
218
+ [setNetFlagComponentUuid\_Ground(component)](./SCH_PrimitiveComponent.md)
219
+
220
+ </td><td>
221
+
222
+ </td><td>
223
+
224
+ **_(BETA)_** Set the device UUID associated with the Ground net flag in the extension API
225
+
226
+ </td></tr>
227
+ <tr><td>
228
+
229
+ [setNetFlagComponentUuid\_Power(component)](./SCH_PrimitiveComponent.md)
230
+
231
+ </td><td>
232
+
233
+ </td><td>
234
+
235
+ **_(BETA)_** Set the device UUID associated with the Power net flag in the extension API
236
+
237
+ </td></tr>
238
+ <tr><td>
239
+
240
+ [setNetFlagComponentUuid\_ProtectGround(component)](./SCH_PrimitiveComponent.md)
241
+
242
+ </td><td>
243
+
244
+ </td><td>
245
+
246
+ **_(BETA)_** Set the device UUID associated with the ProtectGround net flag in the extension API
247
+
248
+ </td></tr>
249
+ <tr><td>
250
+
251
+ [setNetPortComponentUuid\_BI(component)](./SCH_PrimitiveComponent.md)
252
+
253
+ </td><td>
254
+
255
+ </td><td>
256
+
257
+ **_(BETA)_** Set the device UUID associated with the BI net port in the extension API
258
+
259
+ </td></tr>
260
+ <tr><td>
261
+
262
+ [setNetPortComponentUuid\_IN(component)](./SCH_PrimitiveComponent.md)
263
+
264
+ </td><td>
265
+
266
+ </td><td>
267
+
268
+ **_(BETA)_** Set the device UUID associated with the IN net port in the extension API
269
+
270
+ </td></tr>
271
+ <tr><td>
272
+
273
+ [setNetPortComponentUuid\_OUT(component)](./SCH_PrimitiveComponent.md)
274
+
275
+ </td><td>
276
+
277
+ </td><td>
278
+
279
+ **_(BETA)_** Set the device UUID associated with the OUT net port in the extension API
280
+
281
+ </td></tr>
282
+ </tbody></table>
283
+
284
+ ---
285
+
286
+ ## 方法详情
287
+
288
+ ### create
289
+
290
+ # SCH\_PrimitiveComponent.create() method
291
+
292
+ > 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.
293
+
294
+ Create Device
295
+
296
+ ## Signature
297
+
298
+ ```typescript
299
+ function create(
300
+ component:
301
+ | { libraryType?: ELIB_LibraryType.DEVICE; libraryUuid: string; uuid: string }
302
+ | ILIB_DeviceItem
303
+ | ILIB_DeviceSearchItem
304
+ | { libraryType: ELIB_LibraryType.SYMBOL; libraryUuid: string; uuid: string }
305
+ | ILIB_SymbolItem
306
+ | ILIB_SymbolSearchItem,
307
+ x: number,
308
+ y: number,
309
+ subPartName?: string,
310
+ rotation?: number,
311
+ mirror?: boolean,
312
+ addIntoBom?: boolean,
313
+ addIntoPcb?: boolean,
314
+ ): Promise<ISCH_PrimitiveComponent | undefined>;
315
+ ```
316
+
317
+ ## Parameters
318
+
319
+ <table><thead><tr><th>
320
+
321
+ Parameter
322
+
323
+ </th><th>
324
+
325
+ Type
326
+
327
+ </th><th>
328
+
329
+ Description
330
+
331
+ </th></tr></thead>
332
+ <tbody><tr><td>
333
+
334
+ component
335
+
336
+ </td><td>
337
+
338
+ { libraryType?: [ELIB\_LibraryType.DEVICE](../enums/ELIB_LibraryType.md)<!-- -->; libraryUuid: string; uuid: string } \| [ILIB\_DeviceItem](../interfaces/ILIB_DeviceItem.md) \| [ILIB\_DeviceSearchItem](../interfaces/ILIB_DeviceSearchItem.md) \| { libraryType: [ELIB\_LibraryType.SYMBOL](../enums/ELIB_LibraryType.md)<!-- -->; libraryUuid: string; uuid: string } \| [ILIB\_SymbolItem](../interfaces/ILIB_SymbolItem.md) \| [ILIB\_SymbolSearchItem](../interfaces/ILIB_SymbolSearchItem.md)
339
+
340
+ </td><td>
341
+
342
+ Associate library device
343
+
344
+ </td></tr>
345
+ <tr><td>
346
+
347
+ x
348
+
349
+ </td><td>
350
+
351
+ number
352
+
353
+ </td><td>
354
+
355
+ X coordinate
356
+
357
+ </td></tr>
358
+ <tr><td>
359
+
360
+ y
361
+
362
+ </td><td>
363
+
364
+ number
365
+
366
+ </td><td>
367
+
368
+ Y coordinate
369
+
370
+ </td></tr>
371
+ <tr><td>
372
+
373
+ subPartName
374
+
375
+ </td><td>
376
+
377
+ string
378
+
379
+ </td><td>
380
+
381
+ _(Optional)_ Sub-part name
382
+
383
+ </td></tr>
384
+ <tr><td>
385
+
386
+ rotation
387
+
388
+ </td><td>
389
+
390
+ number
391
+
392
+ </td><td>
393
+
394
+ _(Optional)_ Rotation angle
395
+
396
+ </td></tr>
397
+ <tr><td>
398
+
399
+ mirror
400
+
401
+ </td><td>
402
+
403
+ boolean
404
+
405
+ </td><td>
406
+
407
+ _(Optional)_ Whether it is mirrored
408
+
409
+ </td></tr>
410
+ <tr><td>
411
+
412
+ addIntoBom
413
+
414
+ </td><td>
415
+
416
+ boolean
417
+
418
+ </td><td>
419
+
420
+ _(Optional)_ Whether Add to BOM
421
+
422
+ </td></tr>
423
+ <tr><td>
424
+
425
+ addIntoPcb
426
+
427
+ </td><td>
428
+
429
+ boolean
430
+
431
+ </td><td>
432
+
433
+ _(Optional)_ Whether Transfer to PCB
434
+
435
+ </td></tr>
436
+ </tbody></table>
437
+
438
+ ## Returns
439
+
440
+ Promise&lt;[ISCH\_PrimitiveComponent](./ISCH_PrimitiveComponent.md) \| undefined&gt;
441
+
442
+ Device primitive object
443
+
444
+ ## Remarks
445
+
446
+ - 引脚坐标可能不在布线栅格上(如出现 `698.5` 半格值),连接导线时两端须使用\*\*原始坐标\*\*,四舍五入会使端点散落为大量 `$xNnn` 短线; - `rotation` / `mirror` 必须填写\*\*真实值\*\*,硬编码 0 会使 90° 器件的引脚整体错位
447
+
448
+ ## Example
449
+
450
+ ```javascript
451
+ // 1. 从系统库搜索器件,随机坐标避免与画布已有器件重合(SCH 坐标单位 10mil)
452
+ const devices = await eda.lib_Device.search('');
453
+ const x = 2000 + Math.floor(Math.random() * 8000);
454
+ const y = 2000 + Math.floor(Math.random() * 8000);
455
+
456
+ // 2. 创建器件:搜索结果直接作为关联库器件传入,加入 BOM 并转到 PCB
457
+ const comp = await eda.sch_PrimitiveComponent.create(
458
+ devices[0], // 关联库器件
459
+ x, // 坐标 X
460
+ y, // 坐标 Y
461
+ undefined, // 子部件名称(多子部件器件才需要指定)
462
+ 0, // 旋转角度
463
+ false, // 是否镜像
464
+ true, // 是否加入 BOM
465
+ true // 是否转到 PCB
466
+ );
467
+
468
+ // 3. 创建类保留现场,供在画布上观察摆放结果
469
+ console.log('primitiveId:', comp.getState_PrimitiveId());
470
+ console.log('designator:', comp.getState_Designator());
471
+ console.log('position:', comp.getState_X(), ',', comp.getState_Y());
472
+ console.log('addIntoBom:', comp.getState_AddIntoBom());
473
+ ```
474
+
475
+ ### createcbbsymbol
476
+
477
+ # SCH\_PrimitiveComponent.createCbbSymbol() method
478
+
479
+ > 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.
480
+
481
+ Create Reuse block symbol
482
+
483
+ ## Signature
484
+
485
+ ```typescript
486
+ function createCbbSymbol(
487
+ cbbSymbol: { libraryUuid: string; cbbUuid: string; uuid?: string },
488
+ x: number,
489
+ y: number,
490
+ rotation?: number,
491
+ mirror?: boolean,
492
+ ): Promise<ISCH_PrimitiveCbbSymbolComponent | undefined>;
493
+ ```
494
+
495
+ ## Parameters
496
+
497
+ <table><thead><tr><th>
498
+
499
+ Parameter
500
+
501
+ </th><th>
502
+
503
+ Type
504
+
505
+ </th><th>
506
+
507
+ Description
508
+
509
+ </th></tr></thead>
510
+ <tbody><tr><td>
511
+
512
+ cbbSymbol
513
+
514
+ </td><td>
515
+
516
+ \{ libraryUuid: string; cbbUuid: string; uuid?: string \}
517
+
518
+ </td><td>
519
+
520
+ Associated library reuse block symbol. `libraryUuid` is the UUID of the library where the CBB project is located, `cbbUuid` is the UUID of the CBB project, and `uuid` is the UUID of the symbol in the CBB project
521
+
522
+ </td></tr>
523
+ <tr><td>
524
+
525
+ x
526
+
527
+ </td><td>
528
+
529
+ number
530
+
531
+ </td><td>
532
+
533
+ X coordinate
534
+
535
+ </td></tr>
536
+ <tr><td>
537
+
538
+ y
539
+
540
+ </td><td>
541
+
542
+ number
543
+
544
+ </td><td>
545
+
546
+ Y coordinate
547
+
548
+ </td></tr>
549
+ <tr><td>
550
+
551
+ rotation
552
+
553
+ </td><td>
554
+
555
+ number
556
+
557
+ </td><td>
558
+
559
+ _(Optional)_ Rotation angle
560
+
561
+ </td></tr>
562
+ <tr><td>
563
+
564
+ mirror
565
+
566
+ </td><td>
567
+
568
+ boolean
569
+
570
+ </td><td>
571
+
572
+ _(Optional)_ Whether it is mirrored
573
+
574
+ </td></tr>
575
+ </tbody></table>
576
+
577
+ ## Returns
578
+
579
+ Promise&lt;[ISCH\_PrimitiveCbbSymbolComponent](./ISCH_PrimitiveCbbSymbolComponent.md) \| undefined&gt;
580
+
581
+ Reuse block symbol primitive object
582
+
583
+ ## Example
584
+
585
+ ```javascript
586
+ // 1. 从系统库搜索可用的复用模块
587
+ const cbbList = await eda.lib_Cbb.search('');
588
+ const cbb = cbbList[0];
589
+
590
+ // 2. 随机坐标避免与画布已有图元重合(SCH 坐标单位 10mil)
591
+ const x = 2000 + Math.floor(Math.random() * 8000);
592
+ const y = 2000 + Math.floor(Math.random() * 8000);
593
+
594
+ // 3. 创建复用模块符号(cbbUuid 传模块工程 UUID,符号 uuid 可省略由模块默认提供)
595
+ const symbol = await eda.sch_PrimitiveComponent.createCbbSymbol(
596
+ {
597
+ libraryUuid: cbb.libraryUuid, // CBB 工程所在库的 UUID
598
+ cbbUuid: cbb.uuid // CBB 工程的 UUID
599
+ },
600
+ x, // 坐标 X
601
+ y, // 坐标 Y
602
+ 0, // 旋转角度
603
+ false // 是否镜像
604
+ );
605
+
606
+ // 4. 创建类保留现场,供在画布上观察模块符号
607
+ console.log('primitiveId:', symbol.getState_PrimitiveId());
608
+ console.log('primitiveType:', symbol.getState_PrimitiveType());
609
+ console.log('position:', symbol.getState_X(), ',', symbol.getState_Y());
610
+ ```
611
+
612
+ ### createnetflag
613
+
614
+ # SCH\_PrimitiveComponent.createNetFlag() method
615
+
616
+ > 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.
617
+
618
+ Create Net flag
619
+
620
+ ## Signature
621
+
622
+ ```typescript
623
+ function createNetFlag(
624
+ identification: 'Power' | 'Ground' | 'AnalogGround' | 'ProtectGround',
625
+ net: string,
626
+ x: number,
627
+ y: number,
628
+ rotation?: number,
629
+ mirror?: boolean,
630
+ ): Promise<ISCH_PrimitiveComponent | undefined>;
631
+ ```
632
+
633
+ ## Parameters
634
+
635
+ <table><thead><tr><th>
636
+
637
+ Parameter
638
+
639
+ </th><th>
640
+
641
+ Type
642
+
643
+ </th><th>
644
+
645
+ Description
646
+
647
+ </th></tr></thead>
648
+ <tbody><tr><td>
649
+
650
+ identification
651
+
652
+ </td><td>
653
+
654
+ 'Power' \| 'Ground' \| 'AnalogGround' \| 'ProtectGround'
655
+
656
+ </td><td>
657
+
658
+ Identification type
659
+
660
+ </td></tr>
661
+ <tr><td>
662
+
663
+ net
664
+
665
+ </td><td>
666
+
667
+ string
668
+
669
+ </td><td>
670
+
671
+ Net name
672
+
673
+ </td></tr>
674
+ <tr><td>
675
+
676
+ x
677
+
678
+ </td><td>
679
+
680
+ number
681
+
682
+ </td><td>
683
+
684
+ X coordinate
685
+
686
+ </td></tr>
687
+ <tr><td>
688
+
689
+ y
690
+
691
+ </td><td>
692
+
693
+ number
694
+
695
+ </td><td>
696
+
697
+ Y coordinate
698
+
699
+ </td></tr>
700
+ <tr><td>
701
+
702
+ rotation
703
+
704
+ </td><td>
705
+
706
+ number
707
+
708
+ </td><td>
709
+
710
+ _(Optional)_ Rotation angle
711
+
712
+ </td></tr>
713
+ <tr><td>
714
+
715
+ mirror
716
+
717
+ </td><td>
718
+
719
+ boolean
720
+
721
+ </td><td>
722
+
723
+ _(Optional)_ Whether it is mirrored
724
+
725
+ </td></tr>
726
+ </tbody></table>
727
+
728
+ ## Returns
729
+
730
+ Promise&lt;[ISCH\_PrimitiveComponent](./ISCH_PrimitiveComponent.md) \| undefined&gt;
731
+
732
+ Device primitive object
733
+
734
+ ## Example
735
+
736
+ ```javascript
737
+ // 1. 随机坐标避免与画布已有图元重合(SCH 坐标单位 10mil)
738
+ const x = 2000 + Math.floor(Math.random() * 8000);
739
+ const y = 2000 + Math.floor(Math.random() * 8000);
740
+
741
+ // 2. 创建 Power 类型的网络标识,网络名为 VCC
742
+ const flag = await eda.sch_PrimitiveComponent.createNetFlag(
743
+ 'Power', // 标识类型:'Power' / 'Ground' / 'AnalogGround' / 'ProtectGround'
744
+ '嘉立创示例_VCC', // 网络名称
745
+ x, // 坐标 X
746
+ y, // 坐标 Y
747
+ 0, // 旋转角度
748
+ false // 是否镜像
749
+ );
750
+
751
+ // 3. 创建类保留现场,供在画布上观察标识样式
752
+ console.log('primitiveId:', flag.getState_PrimitiveId());
753
+ console.log('net:', flag.getState_Net());
754
+ console.log('componentType:', flag.getState_ComponentType());
755
+ ```
756
+
757
+ ### createnetport
758
+
759
+ # SCH\_PrimitiveComponent.createNetPort() method
760
+
761
+ > 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.
762
+
763
+ Create Net port
764
+
765
+ ## Signature
766
+
767
+ ```typescript
768
+ function createNetPort(
769
+ direction: 'IN' | 'OUT' | 'BI',
770
+ net: string,
771
+ x: number,
772
+ y: number,
773
+ rotation?: number,
774
+ mirror?: boolean,
775
+ ): Promise<ISCH_PrimitiveComponent | undefined>;
776
+ ```
777
+
778
+ ## Parameters
779
+
780
+ <table><thead><tr><th>
781
+
782
+ Parameter
783
+
784
+ </th><th>
785
+
786
+ Type
787
+
788
+ </th><th>
789
+
790
+ Description
791
+
792
+ </th></tr></thead>
793
+ <tbody><tr><td>
794
+
795
+ direction
796
+
797
+ </td><td>
798
+
799
+ 'IN' \| 'OUT' \| 'BI'
800
+
801
+ </td><td>
802
+
803
+ Port direction
804
+
805
+ </td></tr>
806
+ <tr><td>
807
+
808
+ net
809
+
810
+ </td><td>
811
+
812
+ string
813
+
814
+ </td><td>
815
+
816
+ Net name
817
+
818
+ </td></tr>
819
+ <tr><td>
820
+
821
+ x
822
+
823
+ </td><td>
824
+
825
+ number
826
+
827
+ </td><td>
828
+
829
+ X coordinate
830
+
831
+ </td></tr>
832
+ <tr><td>
833
+
834
+ y
835
+
836
+ </td><td>
837
+
838
+ number
839
+
840
+ </td><td>
841
+
842
+ Y coordinate
843
+
844
+ </td></tr>
845
+ <tr><td>
846
+
847
+ rotation
848
+
849
+ </td><td>
850
+
851
+ number
852
+
853
+ </td><td>
854
+
855
+ _(Optional)_ Rotation angle
856
+
857
+ </td></tr>
858
+ <tr><td>
859
+
860
+ mirror
861
+
862
+ </td><td>
863
+
864
+ boolean
865
+
866
+ </td><td>
867
+
868
+ _(Optional)_ Whether it is mirrored
869
+
870
+ </td></tr>
871
+ </tbody></table>
872
+
873
+ ## Returns
874
+
875
+ Promise&lt;[ISCH\_PrimitiveComponent](./ISCH_PrimitiveComponent.md) \| undefined&gt;
876
+
877
+ Device primitive object
878
+
879
+ ## Example
880
+
881
+ ```javascript
882
+ // 1. 随机坐标避免与画布已有图元重合(SCH 坐标单位 10mil)
883
+ const x = 2000 + Math.floor(Math.random() * 8000);
884
+ const y = 2000 + Math.floor(Math.random() * 8000);
885
+
886
+ // 2. 创建输入方向的端口,网络名为 SIG_IN
887
+ const port = await eda.sch_PrimitiveComponent.createNetPort(
888
+ 'IN', // 端口方向:'IN' / 'OUT' / 'BI'
889
+ '嘉立创示例_SIG', // 网络名称
890
+ x, // 坐标 X
891
+ y, // 坐标 Y
892
+ 0, // 旋转角度
893
+ false // 是否镜像
894
+ );
895
+
896
+ // 3. 创建类保留现场,供在画布上观察端口样式
897
+ console.log('primitiveId:', port.getState_PrimitiveId());
898
+ console.log('net:', port.getState_Net());
899
+ console.log('componentType:', port.getState_ComponentType());
900
+ ```
901
+
902
+ ### createshortcircuitflag
903
+
904
+ # SCH\_PrimitiveComponent.createShortCircuitFlag() method
905
+
906
+ > 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.
907
+
908
+ Create a short circuit flag
909
+
910
+ ## Signature
911
+
912
+ ```typescript
913
+ function createShortCircuitFlag(
914
+ x: number,
915
+ y: number,
916
+ rotation?: number,
917
+ mirror?: boolean,
918
+ ): Promise<ISCH_PrimitiveComponent | undefined>;
919
+ ```
920
+
921
+ ## Parameters
922
+
923
+ <table><thead><tr><th>
924
+
925
+ Parameter
926
+
927
+ </th><th>
928
+
929
+ Type
930
+
931
+ </th><th>
932
+
933
+ Description
934
+
935
+ </th></tr></thead>
936
+ <tbody><tr><td>
937
+
938
+ x
939
+
940
+ </td><td>
941
+
942
+ number
943
+
944
+ </td><td>
945
+
946
+ X coordinate
947
+
948
+ </td></tr>
949
+ <tr><td>
950
+
951
+ y
952
+
953
+ </td><td>
954
+
955
+ number
956
+
957
+ </td><td>
958
+
959
+ Y coordinate
960
+
961
+ </td></tr>
962
+ <tr><td>
963
+
964
+ rotation
965
+
966
+ </td><td>
967
+
968
+ number
969
+
970
+ </td><td>
971
+
972
+ _(Optional)_ Rotation angle
973
+
974
+ </td></tr>
975
+ <tr><td>
976
+
977
+ mirror
978
+
979
+ </td><td>
980
+
981
+ boolean
982
+
983
+ </td><td>
984
+
985
+ _(Optional)_ Whether it is mirrored
986
+
987
+ </td></tr>
988
+ </tbody></table>
989
+
990
+ ## Returns
991
+
992
+ Promise&lt;[ISCH\_PrimitiveComponent](./ISCH_PrimitiveComponent.md) \| undefined&gt;
993
+
994
+ Device primitive object
995
+
996
+ ## Example
997
+
998
+ ```javascript
999
+ // 1. 随机坐标避免与画布已有图元重合(SCH 坐标单位 10mil)
1000
+ const x = 2000 + Math.floor(Math.random() * 8000);
1001
+ const y = 2000 + Math.floor(Math.random() * 8000);
1002
+
1003
+ // 2. 创建短接标识(无网络名参数,仅位置与姿态)
1004
+ const flag = await eda.sch_PrimitiveComponent.createShortCircuitFlag(
1005
+ x, // 坐标 X
1006
+ y, // 坐标 Y
1007
+ 0, // 旋转角度
1008
+ false // 是否镜像
1009
+ );
1010
+
1011
+ // 3. 创建类保留现场,供在画布上观察标识样式
1012
+ console.log('primitiveId:', flag.getState_PrimitiveId());
1013
+ console.log('componentType:', flag.getState_ComponentType());
1014
+ console.log('position:', flag.getState_X(), ',', flag.getState_Y());
1015
+ ```
1016
+
1017
+ ### delete
1018
+
1019
+ # SCH\_PrimitiveComponent.delete() method
1020
+
1021
+ > 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.
1022
+
1023
+ Delete Device
1024
+
1025
+ ## Signature
1026
+
1027
+ ```typescript
1028
+ function delete(primitiveIds: string | ISCH_PrimitiveComponent | Array<string> | Array<ISCH_PrimitiveComponent>): Promise<boolean>;
1029
+ ```
1030
+
1031
+ ## Parameters
1032
+
1033
+ <table><thead><tr><th>
1034
+
1035
+ Parameter
1036
+
1037
+ </th><th>
1038
+
1039
+ Type
1040
+
1041
+ </th><th>
1042
+
1043
+ Description
1044
+
1045
+ </th></tr></thead>
1046
+ <tbody><tr><td>
1047
+
1048
+ primitiveIds
1049
+
1050
+ </td><td>
1051
+
1052
+ string \| [ISCH\_PrimitiveComponent](./ISCH_PrimitiveComponent.md) \| Array&lt;string&gt; \| Array&lt;[ISCH\_PrimitiveComponent](./ISCH_PrimitiveComponent.md)<!-- -->&gt;
1053
+
1054
+ </td><td>
1055
+
1056
+ Device primitive ID or Device primitive object
1057
+
1058
+ </td></tr>
1059
+ </tbody></table>
1060
+
1061
+ ## Returns
1062
+
1063
+ Promise&lt;boolean&gt;
1064
+
1065
+ Delete Whether the operation is successful
1066
+
1067
+ ## Example
1068
+
1069
+ ```javascript
1070
+ // 1. 创建两个待删除的测试器件(随机坐标避免重合,SCH 坐标单位 10mil)
1071
+ const devices = await eda.lib_Device.search('');
1072
+ const x = 2000 + Math.floor(Math.random() * 8000);
1073
+ const y = 2000 + Math.floor(Math.random() * 8000);
1074
+ const comp1 = await eda.sch_PrimitiveComponent.create(devices[0], x, y);
1075
+ const comp2 = await eda.sch_PrimitiveComponent.create(devices[0], x + 400, y);
1076
+
1077
+ // 2. 记录删除前的器件数量
1078
+ const beforeCount = (await eda.sch_PrimitiveComponent.getAll()).length;
1079
+
1080
+ // 3. 分别以 ID 字符串和图元对象两种形式删除两个器件
1081
+ const deleted1 = await eda.sch_PrimitiveComponent.delete(comp1.getState_PrimitiveId());
1082
+ const deleted2 = await eda.sch_PrimitiveComponent.delete(comp2);
1083
+
1084
+ // 4. 删除类保留现场(图元已删除,不恢复)
1085
+ const afterCount = (await eda.sch_PrimitiveComponent.getAll()).length;
1086
+
1087
+ console.log('deleted by id:', deleted1);
1088
+ console.log('deleted by object:', deleted2);
1089
+ console.log('beforeCount:', beforeCount, '→ afterCount:', afterCount);
1090
+ ```
1091
+
1092
+ ### get
1093
+
1094
+ # SCH\_PrimitiveComponent.get() method
1095
+
1096
+ > 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.
1097
+
1098
+ Get Device
1099
+
1100
+ ## Signature
1101
+
1102
+ ```typescript
1103
+ function get(primitiveIds: string): Promise<ISCH_PrimitiveComponent | undefined>;
1104
+ ```
1105
+
1106
+ ## Parameters
1107
+
1108
+ <table><thead><tr><th>
1109
+
1110
+ Parameter
1111
+
1112
+ </th><th>
1113
+
1114
+ Type
1115
+
1116
+ </th><th>
1117
+
1118
+ Description
1119
+
1120
+ </th></tr></thead>
1121
+ <tbody><tr><td>
1122
+
1123
+ primitiveIds
1124
+
1125
+ </td><td>
1126
+
1127
+ string
1128
+
1129
+ </td><td>
1130
+
1131
+ Device primitive ID, which can be a string or an array of strings. If it is an array, an array is also returned
1132
+
1133
+ </td></tr>
1134
+ </tbody></table>
1135
+
1136
+ ## Returns
1137
+
1138
+ Promise&lt;[ISCH\_PrimitiveComponent](./ISCH_PrimitiveComponent.md) \| undefined&gt;
1139
+
1140
+ Device primitive object, `undefined` indicates that the retrieval failed
1141
+
1142
+ ## Example
1143
+
1144
+ ```javascript
1145
+ // 1. 创建两个测试器件(随机坐标避免重合,SCH 坐标单位 10mil)
1146
+ const devices = await eda.lib_Device.search('');
1147
+ const x = 2000 + Math.floor(Math.random() * 8000);
1148
+ const y = 2000 + Math.floor(Math.random() * 8000);
1149
+ const comp1 = await eda.sch_PrimitiveComponent.create(devices[0], x, y);
1150
+ const comp2 = await eda.sch_PrimitiveComponent.create(devices[0], x + 400, y);
1151
+
1152
+ // 2. 传单个 ID 字符串,返回单个器件对象
1153
+ const single = await eda.sch_PrimitiveComponent.get(comp1.getState_PrimitiveId());
1154
+
1155
+ // 3. 传 ID 数组,返回器件对象数组(任一 ID 未匹配不影响其它图元的返回)
1156
+ const arr = await eda.sch_PrimitiveComponent.get([
1157
+ comp1.getState_PrimitiveId(),
1158
+ comp2.getState_PrimitiveId()
1159
+ ]);
1160
+
1161
+ // 4. 清理测试图元(查询类需要清理)
1162
+ await eda.sch_PrimitiveComponent.delete([comp1.getState_PrimitiveId(), comp2.getState_PrimitiveId()]);
1163
+
1164
+ console.log('single designator:', single.getState_Designator());
1165
+ console.log('array length:', arr.length);
1166
+ console.log('comp2 designator:', arr[1].getState_Designator());
1167
+ ```
1168
+
1169
+ ### get_1
1170
+
1171
+ # SCH\_PrimitiveComponent.get() method
1172
+
1173
+ > 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.
1174
+
1175
+ Get Device
1176
+
1177
+ ## Signature
1178
+
1179
+ ```typescript
1180
+ function get(primitiveIds: Array<string>): Promise<Array<ISCH_PrimitiveComponent>>;
1181
+ ```
1182
+
1183
+ ## Parameters
1184
+
1185
+ <table><thead><tr><th>
1186
+
1187
+ Parameter
1188
+
1189
+ </th><th>
1190
+
1191
+ Type
1192
+
1193
+ </th><th>
1194
+
1195
+ Description
1196
+
1197
+ </th></tr></thead>
1198
+ <tbody><tr><td>
1199
+
1200
+ primitiveIds
1201
+
1202
+ </td><td>
1203
+
1204
+ Array&lt;string&gt;
1205
+
1206
+ </td><td>
1207
+
1208
+ Device primitive ID, which can be a string or an array of strings. If it is an array, an array is also returned
1209
+
1210
+ </td></tr>
1211
+ </tbody></table>
1212
+
1213
+ ## Returns
1214
+
1215
+ Promise&lt;Array&lt;[ISCH\_PrimitiveComponent](./ISCH_PrimitiveComponent.md)<!-- -->&gt;&gt;
1216
+
1217
+ Device primitive object; an empty array indicates that the retrieval failed
1218
+
1219
+ ## Remarks
1220
+
1221
+ If multiple primitive IDs are passed in, a primitive ID that is not matched will not affect the return of other primitives; that is, fewer primitive objects than the number of primitive IDs passed in may be returned.
1222
+
1223
+ ### getall
1224
+
1225
+ # SCH\_PrimitiveComponent.getAll() method
1226
+
1227
+ > 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.
1228
+
1229
+ Get all Device
1230
+
1231
+ ## Signature
1232
+
1233
+ ```typescript
1234
+ function getAll(
1235
+ componentType?: ESCH_PrimitiveComponentType,
1236
+ allSchematicPages?: boolean,
1237
+ ): Promise<Array<ISCH_PrimitiveComponent>>;
1238
+ ```
1239
+
1240
+ ## Parameters
1241
+
1242
+ <table><thead><tr><th>
1243
+
1244
+ Parameter
1245
+
1246
+ </th><th>
1247
+
1248
+ Type
1249
+
1250
+ </th><th>
1251
+
1252
+ Description
1253
+
1254
+ </th></tr></thead>
1255
+ <tbody><tr><td>
1256
+
1257
+ componentType
1258
+
1259
+ </td><td>
1260
+
1261
+ [ESCH\_PrimitiveComponentType](../enums/ESCH_PrimitiveComponentType.md)
1262
+
1263
+ </td><td>
1264
+
1265
+ _(Optional)_ Device type
1266
+
1267
+ </td></tr>
1268
+ <tr><td>
1269
+
1270
+ allSchematicPages
1271
+
1272
+ </td><td>
1273
+
1274
+ boolean
1275
+
1276
+ </td><td>
1277
+
1278
+ _(Optional)_ Whether to get the devices of all schematic sheets
1279
+
1280
+ </td></tr>
1281
+ </tbody></table>
1282
+
1283
+ ## Returns
1284
+
1285
+ Promise&lt;Array&lt;[ISCH\_PrimitiveComponent](./ISCH_PrimitiveComponent.md)<!-- -->&gt;&gt;
1286
+
1287
+ Array of Device primitive objects
1288
+
1289
+ ## Remarks
1290
+
1291
+ `allSchematicPages=true` 时本接口\*\*不会主动加载未打开的图页\*\*,只返回已加载图页中的器件
1292
+
1293
+ 如需覆盖全部图页,请先打开所有图页(如逐页 `openDocument`<!-- -->)再调用
1294
+
1295
+ ## Example
1296
+
1297
+ ```javascript
1298
+ // 1. 创建一个普通元件和一个网络标识作为查找目标(随机坐标避免重合)
1299
+ const devices = await eda.lib_Device.search('');
1300
+ const x = 2000 + Math.floor(Math.random() * 8000);
1301
+ const y = 2000 + Math.floor(Math.random() * 8000);
1302
+ const comp = await eda.sch_PrimitiveComponent.create(devices[0], x, y);
1303
+ const flag = await eda.sch_PrimitiveComponent.createNetFlag('Power', '嘉立创示例_VCC', x + 600, y);
1304
+ const compId = comp.getState_PrimitiveId();
1305
+
1306
+ // 2. 不传参数,取当前图页全部器件
1307
+ const all = await eda.sch_PrimitiveComponent.getAll();
1308
+
1309
+ // 3. 传入类型 'netflag' 只取网络标识(ESCH_PrimitiveComponentType 值)
1310
+ const flags = await eda.sch_PrimitiveComponent.getAll('netflag');
1311
+
1312
+ // 4. 清理测试图元(查询类需要清理)
1313
+ await eda.sch_PrimitiveComponent.delete([compId, flag.getState_PrimitiveId()]);
1314
+
1315
+ console.log('total components:', all.length);
1316
+ console.log('marker comp found:', all.some(c => c.getState_PrimitiveId() === compId));
1317
+ console.log('netflag count:', flags.length);
1318
+ ```
1319
+
1320
+ ### getallpinsbyprimitiveid
1321
+
1322
+ # SCH\_PrimitiveComponent.getAllPinsByPrimitiveId() method
1323
+
1324
+ > 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.
1325
+
1326
+ Get all pins associated with the device
1327
+
1328
+ ## Signature
1329
+
1330
+ ```typescript
1331
+ function getAllPinsByPrimitiveId(
1332
+ primitiveId: string,
1333
+ ): Promise<Array<ISCH_PrimitiveComponentPin> | undefined>;
1334
+ ```
1335
+
1336
+ ## Parameters
1337
+
1338
+ <table><thead><tr><th>
1339
+
1340
+ Parameter
1341
+
1342
+ </th><th>
1343
+
1344
+ Type
1345
+
1346
+ </th><th>
1347
+
1348
+ Description
1349
+
1350
+ </th></tr></thead>
1351
+ <tbody><tr><td>
1352
+
1353
+ primitiveId
1354
+
1355
+ </td><td>
1356
+
1357
+ string
1358
+
1359
+ </td><td>
1360
+
1361
+ Device primitive ID
1362
+
1363
+ </td></tr>
1364
+ </tbody></table>
1365
+
1366
+ ## Returns
1367
+
1368
+ Promise&lt;Array&lt;[ISCH\_PrimitiveComponentPin](./ISCH_PrimitiveComponentPin.md)<!-- -->&gt; \| undefined&gt;
1369
+
1370
+ Device pin primitive array
1371
+
1372
+ ## Example
1373
+
1374
+ ```javascript
1375
+ // 1. 创建一个带引脚的测试器件(随机坐标避免重合,SCH 坐标单位 10mil)
1376
+ const devices = await eda.lib_Device.search('');
1377
+ const x = 2000 + Math.floor(Math.random() * 8000);
1378
+ const y = 2000 + Math.floor(Math.random() * 8000);
1379
+ const comp = await eda.sch_PrimitiveComponent.create(devices[0], x, y);
1380
+ const compId = comp.getState_PrimitiveId();
1381
+
1382
+ // 2. 按图元 ID 取出该器件的全部引脚(返回纯数据对象,字段直接可读)
1383
+ const pins = await eda.sch_PrimitiveComponent.getAllPinsByPrimitiveId(compId);
1384
+
1385
+ // 3. 清理测试图元(查询类需要清理)
1386
+ await eda.sch_PrimitiveComponent.delete([compId]);
1387
+
1388
+ console.log('pin count:', pins.length);
1389
+ console.log('first pin number:', pins[0].pinNumber);
1390
+ console.log('first pin type:', pins[0].pinType);
1391
+ ```
1392
+
1393
+ ### getallprimitiveid
1394
+
1395
+ # SCH\_PrimitiveComponent.getAllPrimitiveId() method
1396
+
1397
+ > 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.
1398
+
1399
+ Get all Device primitive IDs
1400
+
1401
+ ## Signature
1402
+
1403
+ ```typescript
1404
+ function getAllPrimitiveId(
1405
+ componentType?: ESCH_PrimitiveComponentType,
1406
+ allSchematicPages?: boolean,
1407
+ ): Promise<Array<string>>;
1408
+ ```
1409
+
1410
+ ## Parameters
1411
+
1412
+ <table><thead><tr><th>
1413
+
1414
+ Parameter
1415
+
1416
+ </th><th>
1417
+
1418
+ Type
1419
+
1420
+ </th><th>
1421
+
1422
+ Description
1423
+
1424
+ </th></tr></thead>
1425
+ <tbody><tr><td>
1426
+
1427
+ componentType
1428
+
1429
+ </td><td>
1430
+
1431
+ [ESCH\_PrimitiveComponentType](../enums/ESCH_PrimitiveComponentType.md)
1432
+
1433
+ </td><td>
1434
+
1435
+ _(Optional)_ Device type
1436
+
1437
+ </td></tr>
1438
+ <tr><td>
1439
+
1440
+ allSchematicPages
1441
+
1442
+ </td><td>
1443
+
1444
+ boolean
1445
+
1446
+ </td><td>
1447
+
1448
+ _(Optional)_ Whether to get the devices of all schematic sheets
1449
+
1450
+ </td></tr>
1451
+ </tbody></table>
1452
+
1453
+ ## Returns
1454
+
1455
+ Promise&lt;Array&lt;string&gt;&gt;
1456
+
1457
+ Array of Device primitive IDs
1458
+
1459
+ ## Remarks
1460
+
1461
+ `allSchematicPages=true` 时本接口 \*\*不会主动加载未打开的图页\*\*,只返回已加载图页中的器件
1462
+
1463
+ 如需覆盖全部图页,请先打开所有图页(如逐页 `openDocument`<!-- -->)再调用
1464
+
1465
+ ## Example
1466
+
1467
+ ```javascript
1468
+ // 1. 创建一个网络标识作为查找目标(随机坐标避免重合,SCH 坐标单位 10mil)
1469
+ const x = 2000 + Math.floor(Math.random() * 8000);
1470
+ const y = 2000 + Math.floor(Math.random() * 8000);
1471
+ const flag = await eda.sch_PrimitiveComponent.createNetFlag('Power', '嘉立创示例_VCC', x, y);
1472
+ const flagId = flag.getState_PrimitiveId();
1473
+
1474
+ // 2. 不传参数,取当前图页全部器件的图元 ID
1475
+ const allIds = await eda.sch_PrimitiveComponent.getAllPrimitiveId();
1476
+
1477
+ // 3. 传入类型 'netflag' 只取网络标识的图元 ID
1478
+ const flagIds = await eda.sch_PrimitiveComponent.getAllPrimitiveId('netflag');
1479
+
1480
+ // 4. 清理测试图元(查询类需要清理)
1481
+ await eda.sch_PrimitiveComponent.delete([flagId]);
1482
+
1483
+ console.log('total ids:', allIds.length);
1484
+ console.log('netflag ids:', flagIds.length);
1485
+ console.log('marker flag found:', flagIds.includes(flagId));
1486
+ ```
1487
+
1488
+ ### getallpropertynames
1489
+
1490
+ # SCH\_PrimitiveComponent.getAllPropertyNames() method
1491
+
1492
+ > 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.
1493
+
1494
+ Get The set of all property names of all devices
1495
+
1496
+ ## Signature
1497
+
1498
+ ```typescript
1499
+ function getAllPropertyNames(): Promise<Array<string>>;
1500
+ ```
1501
+
1502
+ ## Returns
1503
+
1504
+ Promise&lt;Array&lt;string&gt;&gt;
1505
+
1506
+ The set of all property names of all devices
1507
+
1508
+ ## Example
1509
+
1510
+ ```javascript
1511
+ // 1. 创建一个测试器件,保证画布上有带属性的器件(随机坐标避免重合)
1512
+ const devices = await eda.lib_Device.search('');
1513
+ const x = 2000 + Math.floor(Math.random() * 8000);
1514
+ const y = 2000 + Math.floor(Math.random() * 8000);
1515
+ const comp = await eda.sch_PrimitiveComponent.create(devices[0], x, y);
1516
+
1517
+ // 2. 取所有器件出现过的属性名称集合
1518
+ const names = await eda.sch_PrimitiveComponent.getAllPropertyNames();
1519
+
1520
+ // 3. 清理测试图元(查询类需要清理)
1521
+ await eda.sch_PrimitiveComponent.delete([comp.getState_PrimitiveId()]);
1522
+
1523
+ console.log('property name count:', names.length);
1524
+ console.log('names:', names.join(', '));
1525
+ ```
1526
+
1527
+ ### modify
1528
+
1529
+ # SCH\_PrimitiveComponent.modify() method
1530
+
1531
+ > 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.
1532
+
1533
+ Modify Device
1534
+
1535
+ ## Signature
1536
+
1537
+ ```typescript
1538
+ function modify(
1539
+ primitiveId: string | ISCH_PrimitiveComponent,
1540
+ property: {
1541
+ x?: number;
1542
+ y?: number;
1543
+ rotation?: number;
1544
+ mirror?: boolean;
1545
+ addIntoBom?: boolean;
1546
+ addIntoPcb?: boolean;
1547
+ designator?: string | null;
1548
+ name?: string | null;
1549
+ uniqueId?: string | null;
1550
+ manufacturer?: string | null;
1551
+ manufacturerId?: string | null;
1552
+ supplier?: string | null;
1553
+ supplierId?: string | null;
1554
+ otherProperty?: Record<string, string | number | boolean>;
1555
+ },
1556
+ ): Promise<ISCH_PrimitiveComponent | undefined>;
1557
+ ```
1558
+
1559
+ ## Parameters
1560
+
1561
+ <table><thead><tr><th>
1562
+
1563
+ Parameter
1564
+
1565
+ </th><th>
1566
+
1567
+ Type
1568
+
1569
+ </th><th>
1570
+
1571
+ Description
1572
+
1573
+ </th></tr></thead>
1574
+ <tbody><tr><td>
1575
+
1576
+ primitiveId
1577
+
1578
+ </td><td>
1579
+
1580
+ string \| [ISCH\_PrimitiveComponent](./ISCH_PrimitiveComponent.md)
1581
+
1582
+ </td><td>
1583
+
1584
+ Primitive ID
1585
+
1586
+ </td></tr>
1587
+ <tr><td>
1588
+
1589
+ property
1590
+
1591
+ </td><td>
1592
+
1593
+ { x?: number; y?: number; rotation?: number; mirror?: boolean; addIntoBom?: boolean; addIntoPcb?: boolean; designator?: string \| null; name?: string \| null; uniqueId?: string \| null; manufacturer?: string \| null; manufacturerId?: string \| null; supplier?: string \| null; supplierId?: string \| null; otherProperty?: Record&lt;string, string \| number \| boolean&gt; }
1594
+
1595
+ </td><td>
1596
+
1597
+ </td></tr>
1598
+ </tbody></table>
1599
+
1600
+ ## Returns
1601
+
1602
+ Promise&lt;[ISCH\_PrimitiveComponent](./ISCH_PrimitiveComponent.md) \| undefined&gt;
1603
+
1604
+ Device primitive object
1605
+
1606
+ ## Remarks
1607
+
1608
+ This method can only be used for modification when the device type is [COMPONENT](../enums/ESCH_PrimitiveComponentType.md)
1609
+
1610
+ ## Example
1611
+
1612
+ ```javascript
1613
+ // 1. 创建待修改的测试器件(随机坐标避免与画布已有器件重合)
1614
+ const devices = await eda.lib_Device.search('');
1615
+ const x = 2000 + Math.floor(Math.random() * 8000);
1616
+ const y = 2000 + Math.floor(Math.random() * 8000);
1617
+ const comp = await eda.sch_PrimitiveComponent.create(devices[0], x, y);
1618
+ const compId = comp.getState_PrimitiveId();
1619
+
1620
+ // 2. 读取修改前的位号、旋转与 X 坐标
1621
+ const beforeDesignator = comp.getState_Designator();
1622
+ const beforeRotation = comp.getState_Rotation();
1623
+ const beforeX = comp.getState_X();
1624
+
1625
+ // 3. 批量修改:右移 400(约 101.6mm)、旋转 90 度、位号改为 U100
1626
+ await eda.sch_PrimitiveComponent.modify(compId, {
1627
+ x: x + 400,
1628
+ rotation: 90,
1629
+ designator: '嘉立创示例_U100'
1630
+ });
1631
+
1632
+ // 4. modify 返回后需要重新 get() 才能读到画布上的最新值
1633
+ const refreshed = await eda.sch_PrimitiveComponent.get(compId);
1634
+
1635
+ // 5. 修改类保留现场,供观察修改结果
1636
+ console.log('primitiveId:', compId);
1637
+ console.log('designator:', beforeDesignator, '→', refreshed.getState_Designator());
1638
+ console.log('rotation:', beforeRotation, '→', refreshed.getState_Rotation());
1639
+ console.log('x:', beforeX, '→', refreshed.getState_X());
1640
+ ```
1641
+
1642
+ ### placecbbschematicpage
1643
+
1644
+ # SCH\_PrimitiveComponent.placeCbbSchematicPage() method
1645
+
1646
+ > 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.
1647
+
1648
+ Place reuse block schematic sheet
1649
+
1650
+ ## Signature
1651
+
1652
+ ```typescript
1653
+ function placeCbbSchematicPage(
1654
+ cbbSchematicPage: { libraryUuid: string; cbbUuid: string; uuid: string },
1655
+ x: number,
1656
+ y: number,
1657
+ props?: { reimportWhenNameRepeated?: boolean },
1658
+ ): Promise<boolean>;
1659
+ ```
1660
+
1661
+ ## Parameters
1662
+
1663
+ <table><thead><tr><th>
1664
+
1665
+ Parameter
1666
+
1667
+ </th><th>
1668
+
1669
+ Type
1670
+
1671
+ </th><th>
1672
+
1673
+ Description
1674
+
1675
+ </th></tr></thead>
1676
+ <tbody><tr><td>
1677
+
1678
+ cbbSchematicPage
1679
+
1680
+ </td><td>
1681
+
1682
+ \{ libraryUuid: string; cbbUuid: string; uuid: string \}
1683
+
1684
+ </td><td>
1685
+
1686
+ Reuse block schematic sheet. `libraryUuid` is the UUID of the library where the CBB project is located, `cbbUuid` is the UUID of the CBB project, and `uuid` is the UUID of the schematic sheet in the CBB project
1687
+
1688
+ </td></tr>
1689
+ <tr><td>
1690
+
1691
+ x
1692
+
1693
+ </td><td>
1694
+
1695
+ number
1696
+
1697
+ </td><td>
1698
+
1699
+ X coordinate
1700
+
1701
+ </td></tr>
1702
+ <tr><td>
1703
+
1704
+ y
1705
+
1706
+ </td><td>
1707
+
1708
+ number
1709
+
1710
+ </td><td>
1711
+
1712
+ Y coordinate
1713
+
1714
+ </td></tr>
1715
+ <tr><td>
1716
+
1717
+ props
1718
+
1719
+ </td><td>
1720
+
1721
+ \{ reimportWhenNameRepeated?: boolean \}
1722
+
1723
+ </td><td>
1724
+
1725
+ _(Optional)_ 放置参数:`reimportWhenNameRepeated` 当存在重名模块时是否重新引入,默认 `true` ADD since EDA v4.2
1726
+
1727
+ </td></tr>
1728
+ </tbody></table>
1729
+
1730
+ ## Returns
1731
+
1732
+ Promise&lt;boolean&gt;
1733
+
1734
+ Place whether the operation is successful
1735
+
1736
+ ### placecomponentwithmouse
1737
+
1738
+ # SCH\_PrimitiveComponent.placeComponentWithMouse() method
1739
+
1740
+ > 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.
1741
+
1742
+ Place with the mouse device
1743
+
1744
+ ## Signature
1745
+
1746
+ ```typescript
1747
+ function placeComponentWithMouse(
1748
+ component: { libraryUuid: string; uuid: string } | ILIB_DeviceItem | ILIB_DeviceSearchItem,
1749
+ subPartName?: string,
1750
+ ): Promise<boolean>;
1751
+ ```
1752
+
1753
+ ## Parameters
1754
+
1755
+ <table><thead><tr><th>
1756
+
1757
+ Parameter
1758
+
1759
+ </th><th>
1760
+
1761
+ Type
1762
+
1763
+ </th><th>
1764
+
1765
+ Description
1766
+
1767
+ </th></tr></thead>
1768
+ <tbody><tr><td>
1769
+
1770
+ component
1771
+
1772
+ </td><td>
1773
+
1774
+ { libraryUuid: string; uuid: string } \| [ILIB\_DeviceItem](../interfaces/ILIB_DeviceItem.md) \| [ILIB\_DeviceSearchItem](../interfaces/ILIB_DeviceSearchItem.md)
1775
+
1776
+ </td><td>
1777
+
1778
+ Associate library device
1779
+
1780
+ </td></tr>
1781
+ <tr><td>
1782
+
1783
+ subPartName
1784
+
1785
+ </td><td>
1786
+
1787
+ string
1788
+
1789
+ </td><td>
1790
+
1791
+ _(Optional)_ Sub-part name
1792
+
1793
+ </td></tr>
1794
+ </tbody></table>
1795
+
1796
+ ## Returns
1797
+
1798
+ Promise&lt;boolean&gt;
1799
+
1800
+ Whether the device was found
1801
+
1802
+ ## Remarks
1803
+
1804
+ This API simulates clicking the placement button on the front end. The specified device will be bound to the current mouse and placed on the canvas when the user clicks subsequently
1805
+
1806
+ The return timing of this API does not wait for the user's placement operation. Once the device is bound to the mouse, this API will immediately return `true`
1807
+
1808
+ ### placesymbolwithmouse
1809
+
1810
+ # SCH\_PrimitiveComponent.placeSymbolWithMouse() method
1811
+
1812
+ > 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.
1813
+
1814
+ Place with the mouse symbol
1815
+
1816
+ ## Signature
1817
+
1818
+ ```typescript
1819
+ function placeSymbolWithMouse(
1820
+ symbol: { libraryUuid: string; uuid: string } | ILIB_SymbolItem | ILIB_SymbolSearchItem,
1821
+ subPartName?: string,
1822
+ properties?: Record<string, boolean | number | string | undefined>,
1823
+ ): Promise<boolean>;
1824
+ ```
1825
+
1826
+ ## Parameters
1827
+
1828
+ <table><thead><tr><th>
1829
+
1830
+ Parameter
1831
+
1832
+ </th><th>
1833
+
1834
+ Type
1835
+
1836
+ </th><th>
1837
+
1838
+ Description
1839
+
1840
+ </th></tr></thead>
1841
+ <tbody><tr><td>
1842
+
1843
+ symbol
1844
+
1845
+ </td><td>
1846
+
1847
+ { libraryUuid: string; uuid: string } \| [ILIB\_SymbolItem](../interfaces/ILIB_SymbolItem.md) \| [ILIB\_SymbolSearchItem](../interfaces/ILIB_SymbolSearchItem.md)
1848
+
1849
+ </td><td>
1850
+
1851
+ Associate library symbol
1852
+
1853
+ </td></tr>
1854
+ <tr><td>
1855
+
1856
+ subPartName
1857
+
1858
+ </td><td>
1859
+
1860
+ string
1861
+
1862
+ </td><td>
1863
+
1864
+ _(Optional)_ Sub-part name
1865
+
1866
+ </td></tr>
1867
+ <tr><td>
1868
+
1869
+ properties
1870
+
1871
+ </td><td>
1872
+
1873
+ Record&lt;string, boolean \| number \| string \| undefined&gt;
1874
+
1875
+ </td><td>
1876
+
1877
+ _(Optional)_ Device property
1878
+
1879
+ </td></tr>
1880
+ </tbody></table>
1881
+
1882
+ ## Returns
1883
+
1884
+ Promise&lt;boolean&gt;
1885
+
1886
+ Whether the symbol was found
1887
+
1888
+ ## Remarks
1889
+
1890
+ This API simulates clicking the placement button on the front end. The specified symbol will be bound to the current mouse and placed on the canvas when the user clicks subsequently
1891
+
1892
+ The return timing of this API does not wait for the user's placement operation. Once the symbol is bound to the mouse, this API will immediately return `true` ADD since API v0.2.26
1893
+
1894
+ ### setnetflagcomponentuuid_analogground
1895
+
1896
+ # SCH\_PrimitiveComponent.setNetFlagComponentUuid\_AnalogGround() method
1897
+
1898
+ > 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.
1899
+
1900
+ Set the device UUID associated with the AnalogGround net flag in the extension API
1901
+
1902
+ ## Signature
1903
+
1904
+ ```typescript
1905
+ function setNetFlagComponentUuid_AnalogGround(
1906
+ component: { libraryUuid: string; uuid: string } | ILIB_DeviceItem | ILIB_DeviceSearchItem,
1907
+ ): Promise<boolean>;
1908
+ ```
1909
+
1910
+ ## Parameters
1911
+
1912
+ <table><thead><tr><th>
1913
+
1914
+ Parameter
1915
+
1916
+ </th><th>
1917
+
1918
+ Type
1919
+
1920
+ </th><th>
1921
+
1922
+ Description
1923
+
1924
+ </th></tr></thead>
1925
+ <tbody><tr><td>
1926
+
1927
+ component
1928
+
1929
+ </td><td>
1930
+
1931
+ { libraryUuid: string; uuid: string } \| [ILIB\_DeviceItem](../interfaces/ILIB_DeviceItem.md) \| [ILIB\_DeviceSearchItem](../interfaces/ILIB_DeviceSearchItem.md)
1932
+
1933
+ </td><td>
1934
+
1935
+ Associate library device
1936
+
1937
+ </td></tr>
1938
+ </tbody></table>
1939
+
1940
+ ## Returns
1941
+
1942
+ Promise&lt;boolean&gt;
1943
+
1944
+ Whether the operation is successful
1945
+
1946
+ ### setnetflagcomponentuuid_ground
1947
+
1948
+ # SCH\_PrimitiveComponent.setNetFlagComponentUuid\_Ground() method
1949
+
1950
+ > 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.
1951
+
1952
+ Set the device UUID associated with the Ground net flag in the extension API
1953
+
1954
+ ## Signature
1955
+
1956
+ ```typescript
1957
+ function setNetFlagComponentUuid_Ground(
1958
+ component: { libraryUuid: string; uuid: string } | ILIB_DeviceItem | ILIB_DeviceSearchItem,
1959
+ ): Promise<boolean>;
1960
+ ```
1961
+
1962
+ ## Parameters
1963
+
1964
+ <table><thead><tr><th>
1965
+
1966
+ Parameter
1967
+
1968
+ </th><th>
1969
+
1970
+ Type
1971
+
1972
+ </th><th>
1973
+
1974
+ Description
1975
+
1976
+ </th></tr></thead>
1977
+ <tbody><tr><td>
1978
+
1979
+ component
1980
+
1981
+ </td><td>
1982
+
1983
+ { libraryUuid: string; uuid: string } \| [ILIB\_DeviceItem](../interfaces/ILIB_DeviceItem.md) \| [ILIB\_DeviceSearchItem](../interfaces/ILIB_DeviceSearchItem.md)
1984
+
1985
+ </td><td>
1986
+
1987
+ Associate library device
1988
+
1989
+ </td></tr>
1990
+ </tbody></table>
1991
+
1992
+ ## Returns
1993
+
1994
+ Promise&lt;boolean&gt;
1995
+
1996
+ Whether the operation is successful
1997
+
1998
+ ### setnetflagcomponentuuid_power
1999
+
2000
+ # SCH\_PrimitiveComponent.setNetFlagComponentUuid\_Power() method
2001
+
2002
+ > 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.
2003
+
2004
+ Set the device UUID associated with the Power net flag in the extension API
2005
+
2006
+ ## Signature
2007
+
2008
+ ```typescript
2009
+ function setNetFlagComponentUuid_Power(
2010
+ component: { libraryUuid: string; uuid: string } | ILIB_DeviceItem | ILIB_DeviceSearchItem,
2011
+ ): Promise<boolean>;
2012
+ ```
2013
+
2014
+ ## Parameters
2015
+
2016
+ <table><thead><tr><th>
2017
+
2018
+ Parameter
2019
+
2020
+ </th><th>
2021
+
2022
+ Type
2023
+
2024
+ </th><th>
2025
+
2026
+ Description
2027
+
2028
+ </th></tr></thead>
2029
+ <tbody><tr><td>
2030
+
2031
+ component
2032
+
2033
+ </td><td>
2034
+
2035
+ { libraryUuid: string; uuid: string } \| [ILIB\_DeviceItem](../interfaces/ILIB_DeviceItem.md) \| [ILIB\_DeviceSearchItem](../interfaces/ILIB_DeviceSearchItem.md)
2036
+
2037
+ </td><td>
2038
+
2039
+ Associate library device
2040
+
2041
+ </td></tr>
2042
+ </tbody></table>
2043
+
2044
+ ## Returns
2045
+
2046
+ Promise&lt;boolean&gt;
2047
+
2048
+ Whether the operation is successful
2049
+
2050
+ ### setnetflagcomponentuuid_protectground
2051
+
2052
+ # SCH\_PrimitiveComponent.setNetFlagComponentUuid\_ProtectGround() method
2053
+
2054
+ > 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.
2055
+
2056
+ Set the device UUID associated with the ProtectGround net flag in the extension API
2057
+
2058
+ ## Signature
2059
+
2060
+ ```typescript
2061
+ function setNetFlagComponentUuid_ProtectGround(
2062
+ component: { libraryUuid: string; uuid: string } | ILIB_DeviceItem | ILIB_DeviceSearchItem,
2063
+ ): Promise<boolean>;
2064
+ ```
2065
+
2066
+ ## Parameters
2067
+
2068
+ <table><thead><tr><th>
2069
+
2070
+ Parameter
2071
+
2072
+ </th><th>
2073
+
2074
+ Type
2075
+
2076
+ </th><th>
2077
+
2078
+ Description
2079
+
2080
+ </th></tr></thead>
2081
+ <tbody><tr><td>
2082
+
2083
+ component
2084
+
2085
+ </td><td>
2086
+
2087
+ { libraryUuid: string; uuid: string } \| [ILIB\_DeviceItem](../interfaces/ILIB_DeviceItem.md) \| [ILIB\_DeviceSearchItem](../interfaces/ILIB_DeviceSearchItem.md)
2088
+
2089
+ </td><td>
2090
+
2091
+ Associate library device
2092
+
2093
+ </td></tr>
2094
+ </tbody></table>
2095
+
2096
+ ## Returns
2097
+
2098
+ Promise&lt;boolean&gt;
2099
+
2100
+ Whether the operation is successful
2101
+
2102
+ ### setnetportcomponentuuid_bi
2103
+
2104
+ # SCH\_PrimitiveComponent.setNetPortComponentUuid\_BI() method
2105
+
2106
+ > 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.
2107
+
2108
+ Set the device UUID associated with the BI net port in the extension API
2109
+
2110
+ ## Signature
2111
+
2112
+ ```typescript
2113
+ function setNetPortComponentUuid_BI(
2114
+ component: { libraryUuid: string; uuid: string } | ILIB_DeviceItem | ILIB_DeviceSearchItem,
2115
+ ): Promise<boolean>;
2116
+ ```
2117
+
2118
+ ## Parameters
2119
+
2120
+ <table><thead><tr><th>
2121
+
2122
+ Parameter
2123
+
2124
+ </th><th>
2125
+
2126
+ Type
2127
+
2128
+ </th><th>
2129
+
2130
+ Description
2131
+
2132
+ </th></tr></thead>
2133
+ <tbody><tr><td>
2134
+
2135
+ component
2136
+
2137
+ </td><td>
2138
+
2139
+ { libraryUuid: string; uuid: string } \| [ILIB\_DeviceItem](../interfaces/ILIB_DeviceItem.md) \| [ILIB\_DeviceSearchItem](../interfaces/ILIB_DeviceSearchItem.md)
2140
+
2141
+ </td><td>
2142
+
2143
+ Associate library device
2144
+
2145
+ </td></tr>
2146
+ </tbody></table>
2147
+
2148
+ ## Returns
2149
+
2150
+ Promise&lt;boolean&gt;
2151
+
2152
+ Whether the operation is successful
2153
+
2154
+ ### setnetportcomponentuuid_in
2155
+
2156
+ # SCH\_PrimitiveComponent.setNetPortComponentUuid\_IN() method
2157
+
2158
+ > 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.
2159
+
2160
+ Set the device UUID associated with the IN net port in the extension API
2161
+
2162
+ ## Signature
2163
+
2164
+ ```typescript
2165
+ function setNetPortComponentUuid_IN(
2166
+ component: { libraryUuid: string; uuid: string } | ILIB_DeviceItem | ILIB_DeviceSearchItem,
2167
+ ): Promise<boolean>;
2168
+ ```
2169
+
2170
+ ## Parameters
2171
+
2172
+ <table><thead><tr><th>
2173
+
2174
+ Parameter
2175
+
2176
+ </th><th>
2177
+
2178
+ Type
2179
+
2180
+ </th><th>
2181
+
2182
+ Description
2183
+
2184
+ </th></tr></thead>
2185
+ <tbody><tr><td>
2186
+
2187
+ component
2188
+
2189
+ </td><td>
2190
+
2191
+ { libraryUuid: string; uuid: string } \| [ILIB\_DeviceItem](../interfaces/ILIB_DeviceItem.md) \| [ILIB\_DeviceSearchItem](../interfaces/ILIB_DeviceSearchItem.md)
2192
+
2193
+ </td><td>
2194
+
2195
+ Associate library device
2196
+
2197
+ </td></tr>
2198
+ </tbody></table>
2199
+
2200
+ ## Returns
2201
+
2202
+ Promise&lt;boolean&gt;
2203
+
2204
+ Whether the operation is successful
2205
+
2206
+ ### setnetportcomponentuuid_out
2207
+
2208
+ # SCH\_PrimitiveComponent.setNetPortComponentUuid\_OUT() method
2209
+
2210
+ > 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.
2211
+
2212
+ Set the device UUID associated with the OUT net port in the extension API
2213
+
2214
+ ## Signature
2215
+
2216
+ ```typescript
2217
+ function setNetPortComponentUuid_OUT(
2218
+ component: { libraryUuid: string; uuid: string } | ILIB_DeviceItem | ILIB_DeviceSearchItem,
2219
+ ): Promise<boolean>;
2220
+ ```
2221
+
2222
+ ## Parameters
2223
+
2224
+ <table><thead><tr><th>
2225
+
2226
+ Parameter
2227
+
2228
+ </th><th>
2229
+
2230
+ Type
2231
+
2232
+ </th><th>
2233
+
2234
+ Description
2235
+
2236
+ </th></tr></thead>
2237
+ <tbody><tr><td>
2238
+
2239
+ component
2240
+
2241
+ </td><td>
2242
+
2243
+ { libraryUuid: string; uuid: string } \| [ILIB\_DeviceItem](../interfaces/ILIB_DeviceItem.md) \| [ILIB\_DeviceSearchItem](../interfaces/ILIB_DeviceSearchItem.md)
2244
+
2245
+ </td><td>
2246
+
2247
+ Associate library device
2248
+
2249
+ </td></tr>
2250
+ </tbody></table>
2251
+
2252
+ ## Returns
2253
+
2254
+ Promise&lt;boolean&gt;
2255
+
2256
+ Whether the operation is successful