@windypro-rourou/dsh-eda 0.1.4 → 0.1.5

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