@windypro-rourou/dsh-eda 0.1.3 → 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 +3 -1
  2. package/lib/capabilities.js +3 -2
  3. package/lib/client.js +576 -452
  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,1419 +1,1419 @@
1
- # IPCB\_PrimitiveDimension class
2
-
3
- Dimension primitive
4
-
5
- ## Signature
6
-
7
- ```typescript
8
- class IPCB_PrimitiveDimension 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_PrimitiveDimension.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\_CoordinateSet()](./IPCB_PrimitiveDimension.md)
43
-
44
- </td><td>
45
-
46
- </td><td>
47
-
48
- Get the property state: coordinate set
49
-
50
- </td></tr>
51
- <tr><td>
52
-
53
- [getState\_DimensionType()](./IPCB_PrimitiveDimension.md)
54
-
55
- </td><td>
56
-
57
- </td><td>
58
-
59
- Get the property state: dimension type
60
-
61
- </td></tr>
62
- <tr><td>
63
-
64
- [getState\_Layer()](./IPCB_PrimitiveDimension.md)
65
-
66
- </td><td>
67
-
68
- </td><td>
69
-
70
- Get the property state: Layer
71
-
72
- </td></tr>
73
- <tr><td>
74
-
75
- [getState\_LineWidth()](./IPCB_PrimitiveDimension.md)
76
-
77
- </td><td>
78
-
79
- </td><td>
80
-
81
- Get the property state: Line width
82
-
83
- </td></tr>
84
- <tr><td>
85
-
86
- [getState\_Precision()](./IPCB_PrimitiveDimension.md)
87
-
88
- </td><td>
89
-
90
- </td><td>
91
-
92
- Get the property state: precision
93
-
94
- </td></tr>
95
- <tr><td>
96
-
97
- [getState\_PrimitiveId()](./IPCB_PrimitiveDimension.md)
98
-
99
- </td><td>
100
-
101
- </td><td>
102
-
103
- Get the property state: primitive ID
104
-
105
- </td></tr>
106
- <tr><td>
107
-
108
- [getState\_PrimitiveLock()](./IPCB_PrimitiveDimension.md)
109
-
110
- </td><td>
111
-
112
- </td><td>
113
-
114
- Get the property state: whether it is locked
115
-
116
- </td></tr>
117
- <tr><td>
118
-
119
- [getState\_PrimitiveType()](./IPCB_PrimitiveDimension.md)
120
-
121
- </td><td>
122
-
123
- </td><td>
124
-
125
- Get the property state: primitive type
126
-
127
- </td></tr>
128
- <tr><td>
129
-
130
- [getState\_TextFollow()](./IPCB_PrimitiveDimension.md)
131
-
132
- </td><td>
133
-
134
- </td><td>
135
-
136
- Get the property state: text follows
137
-
138
- </td></tr>
139
- <tr><td>
140
-
141
- [getState\_Unit()](./IPCB_PrimitiveDimension.md)
142
-
143
- </td><td>
144
-
145
- </td><td>
146
-
147
- Get the property state: unit
148
-
149
- </td></tr>
150
- <tr><td>
151
-
152
- [isAsync()](./IPCB_PrimitiveDimension.md)
153
-
154
- </td><td>
155
-
156
- </td><td>
157
-
158
- Query whether the primitive is an async primitive
159
-
160
- </td></tr>
161
- <tr><td>
162
-
163
- [reset()](./IPCB_PrimitiveDimension.md)
164
-
165
- </td><td>
166
-
167
- </td><td>
168
-
169
- **_(BETA)_** Reset the async primitive to the current canvas state
170
-
171
- </td></tr>
172
- <tr><td>
173
-
174
- [setState\_CoordinateSet(coordinateSet)](./IPCB_PrimitiveDimension.md)
175
-
176
- </td><td>
177
-
178
- </td><td>
179
-
180
- **_(BETA)_** Set the property state: coordinate set
181
-
182
- </td></tr>
183
- <tr><td>
184
-
185
- [setState\_DimensionType(dimensionType)](./IPCB_PrimitiveDimension.md)
186
-
187
- </td><td>
188
-
189
- </td><td>
190
-
191
- **_(BETA)_** Set the property state: dimension type
192
-
193
- </td></tr>
194
- <tr><td>
195
-
196
- [setState\_Layer(layer)](./IPCB_PrimitiveDimension.md)
197
-
198
- </td><td>
199
-
200
- </td><td>
201
-
202
- **_(BETA)_** Set the property state: Layer
203
-
204
- </td></tr>
205
- <tr><td>
206
-
207
- [setState\_LineWidth(lineWidth)](./IPCB_PrimitiveDimension.md)
208
-
209
- </td><td>
210
-
211
- </td><td>
212
-
213
- **_(BETA)_** Set the property state: Line width
214
-
215
- </td></tr>
216
- <tr><td>
217
-
218
- [setState\_Precision(precision)](./IPCB_PrimitiveDimension.md)
219
-
220
- </td><td>
221
-
222
- </td><td>
223
-
224
- **_(BETA)_** Set the property state: precision
225
-
226
- </td></tr>
227
- <tr><td>
228
-
229
- [setState\_PrimitiveLock(primitiveLock)](./IPCB_PrimitiveDimension.md)
230
-
231
- </td><td>
232
-
233
- </td><td>
234
-
235
- **_(BETA)_** Set the property state: whether it is locked
236
-
237
- </td></tr>
238
- <tr><td>
239
-
240
- [setState\_Unit(unit)](./IPCB_PrimitiveDimension.md)
241
-
242
- </td><td>
243
-
244
- </td><td>
245
-
246
- **_(BETA)_** Set the property state: unit
247
-
248
- </td></tr>
249
- <tr><td>
250
-
251
- [toAsync()](./IPCB_PrimitiveDimension.md)
252
-
253
- </td><td>
254
-
255
- </td><td>
256
-
257
- Convert Primitive to Async primitive
258
-
259
- </td></tr>
260
- <tr><td>
261
-
262
- [toSync()](./IPCB_PrimitiveDimension.md)
263
-
264
- </td><td>
265
-
266
- </td><td>
267
-
268
- Convert Primitive to Sync primitive
269
-
270
- </td></tr>
271
- </tbody></table>
272
-
273
- ---
274
-
275
- ## 方法详情
276
-
277
- ### done
278
-
279
- # IPCB\_PrimitiveDimension.done() method
280
-
281
- > This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
282
-
283
- Apply the changes to the primitives to the canvas
284
-
285
- ## Signature
286
-
287
- ```typescript
288
- function done(): Promise<IPCB_PrimitiveDimension>;
289
- ```
290
-
291
- ## Returns
292
-
293
- Promise&lt;[IPCB\_PrimitiveDimension](./IPCB_PrimitiveDimension.md)<!-- -->&gt;
294
-
295
- Dimension primitive object
296
-
297
- ## Example
298
-
299
- ```javascript
300
- // 1. 生成本次运行专用的坐标,避免与之前保留的测试标注重合
301
- const x = 2000 + Math.floor(Math.random() * 100000);
302
-
303
- // 2. 创建一个长度标注
304
- const dim = await eda.pcb_PrimitiveDimension.create(
305
- 'Length Dimension',
306
- [x, 2000, x, 1800, x + 2000, 1800, x + 2000, 2000],
307
- 3,
308
- undefined,
309
- 10
310
- );
311
-
312
- // 3. 切换异步模式,连续累计两处修改(线宽 + 换层)
313
- const asyncDim = dim.toAsync();
314
- asyncDim.setState_LineWidth(20);
315
- asyncDim.setState_Layer(4);
316
-
317
- // 4. 一次性提交到画布
318
- await asyncDim.done();
319
-
320
- // 5. 从画布重新读取,确认两处修改都已生效(保留现场供观察)
321
- const refetched = await eda.pcb_PrimitiveDimension.get(dim.getState_PrimitiveId());
322
-
323
- console.log('lineWidth:', 10, '→', refetched.getState_LineWidth());
324
- console.log('layer:', 3, '→', refetched.getState_Layer());
325
- ```
326
-
327
- ### getstate_coordinateset
328
-
329
- # IPCB\_PrimitiveDimension.getState\_CoordinateSet() method
330
-
331
- Get the property state: coordinate set
332
-
333
- ## Signature
334
-
335
- ```typescript
336
- function getState_CoordinateSet(): TPCB_PrimitiveDimensionCoordinateSet;
337
- ```
338
-
339
- ## Returns
340
-
341
- [TPCB\_PrimitiveDimensionCoordinateSet](../types/TPCB_PrimitiveDimensionCoordinateSet.md)
342
-
343
- Coordinate set
344
-
345
- ## Example
346
-
347
- ```javascript
348
- // 1. 创建一个长度标注(8 元素坐标集:测量端点、箭头端点各两组)
349
- const dim = await eda.pcb_PrimitiveDimension.create(
350
- 'Length Dimension',
351
- [1000, 1000, 1000, 800, 3000, 800, 3000, 1000],
352
- 3
353
- );
354
-
355
- // 2. 读取坐标集
356
- const coordinateSet = dim.getState_CoordinateSet();
357
-
358
- // 3. 清理测试图元(查询类案例不留测试对象)
359
- await eda.pcb_PrimitiveDimension.delete([dim.getState_PrimitiveId()]);
360
-
361
- console.log('coordinateSet:', JSON.stringify(coordinateSet));
362
- ```
363
-
364
- ### getstate_dimensiontype
365
-
366
- # IPCB\_PrimitiveDimension.getState\_DimensionType() method
367
-
368
- Get the property state: dimension type
369
-
370
- ## Signature
371
-
372
- ```typescript
373
- function getState_DimensionType(): EPCB_PrimitiveDimensionType;
374
- ```
375
-
376
- ## Returns
377
-
378
- [EPCB\_PrimitiveDimensionType](../enums/EPCB_PrimitiveDimensionType.md)
379
-
380
- Dimension type
381
-
382
- ## Example
383
-
384
- ```javascript
385
- // 1. 创建一个长度标注("Length Dimension")
386
- const dim = await eda.pcb_PrimitiveDimension.create(
387
- 'Length Dimension',
388
- [1000, 1000, 1000, 800, 3000, 800, 3000, 1000],
389
- 3
390
- );
391
-
392
- // 2. 读取标注类型
393
- const dimensionType = dim.getState_DimensionType();
394
-
395
- // 3. 清理测试图元(查询类案例不留测试对象)
396
- await eda.pcb_PrimitiveDimension.delete([dim.getState_PrimitiveId()]);
397
-
398
- console.log('dimensionType:', dimensionType);
399
- ```
400
-
401
- ### getstate_layer
402
-
403
- # IPCB\_PrimitiveDimension.getState\_Layer() method
404
-
405
- Get the property state: Layer
406
-
407
- ## Signature
408
-
409
- ```typescript
410
- function getState_Layer(): TPCB_LayersOfDimension;
411
- ```
412
-
413
- ## Returns
414
-
415
- [TPCB\_LayersOfDimension](../types/TPCB_LayersOfDimension.md)
416
-
417
- Layer
418
-
419
- ## Example
420
-
421
- ```javascript
422
- // 1. 创建一个顶层丝印层(3)的长度标注
423
- const dim = await eda.pcb_PrimitiveDimension.create(
424
- 'Length Dimension',
425
- [1000, 1000, 1000, 800, 3000, 800, 3000, 1000],
426
- 3
427
- );
428
-
429
- // 2. 读取所在层
430
- const layer = dim.getState_Layer();
431
-
432
- // 3. 清理测试图元(查询类案例不留测试对象)
433
- await eda.pcb_PrimitiveDimension.delete([dim.getState_PrimitiveId()]);
434
-
435
- console.log('layer:', layer);
436
- ```
437
-
438
- ### getstate_linewidth
439
-
440
- # IPCB\_PrimitiveDimension.getState\_LineWidth() method
441
-
442
- Get the property state: Line width
443
-
444
- ## Signature
445
-
446
- ```typescript
447
- function getState_LineWidth(): number;
448
- ```
449
-
450
- ## Returns
451
-
452
- number
453
-
454
- Line width
455
-
456
- ## Example
457
-
458
- ```javascript
459
- // 1. 创建一个 10mil 线宽的长度标注
460
- const dim = await eda.pcb_PrimitiveDimension.create(
461
- 'Length Dimension',
462
- [1000, 1000, 1000, 800, 3000, 800, 3000, 1000],
463
- 3,
464
- undefined,
465
- 10
466
- );
467
-
468
- // 2. 读取线宽
469
- const lineWidth = dim.getState_LineWidth();
470
-
471
- // 3. 清理测试图元(查询类案例不留测试对象)
472
- await eda.pcb_PrimitiveDimension.delete([dim.getState_PrimitiveId()]);
473
-
474
- console.log('lineWidth:', lineWidth);
475
- ```
476
-
477
- ### getstate_precision
478
-
479
- # IPCB\_PrimitiveDimension.getState\_Precision() method
480
-
481
- Get the property state: precision
482
-
483
- ## Signature
484
-
485
- ```typescript
486
- function getState_Precision(): number;
487
- ```
488
-
489
- ## Returns
490
-
491
- number
492
-
493
- Precision
494
-
495
- ## Example
496
-
497
- ```javascript
498
- // 1. 创建一个精度为 2 位的长度标注
499
- const dim = await eda.pcb_PrimitiveDimension.create(
500
- 'Length Dimension',
501
- [1000, 1000, 1000, 800, 3000, 800, 3000, 1000],
502
- 3,
503
- undefined,
504
- undefined,
505
- 2
506
- );
507
-
508
- // 2. 读取精度
509
- const precision = dim.getState_Precision();
510
-
511
- // 3. 清理测试图元(查询类案例不留测试对象)
512
- await eda.pcb_PrimitiveDimension.delete([dim.getState_PrimitiveId()]);
513
-
514
- console.log('precision:', precision);
515
- ```
516
-
517
- ### getstate_primitiveid
518
-
519
- # IPCB\_PrimitiveDimension.getState\_PrimitiveId() method
520
-
521
- Get the property state: primitive ID
522
-
523
- ## Signature
524
-
525
- ```typescript
526
- function getState_PrimitiveId(): string;
527
- ```
528
-
529
- ## Returns
530
-
531
- string
532
-
533
- Primitive ID
534
-
535
- ## Example
536
-
537
- ```javascript
538
- // 1. 创建一个长度标注
539
- const dim = await eda.pcb_PrimitiveDimension.create(
540
- 'Length Dimension',
541
- [1000, 1000, 1000, 800, 3000, 800, 3000, 1000],
542
- 3
543
- );
544
-
545
- // 2. 读取图元 ID
546
- const primitiveId = dim.getState_PrimitiveId();
547
-
548
- // 3. 清理测试图元(查询类案例不留测试对象)
549
- await eda.pcb_PrimitiveDimension.delete([primitiveId]);
550
-
551
- console.log('primitiveId:', primitiveId);
552
- ```
553
-
554
- ### getstate_primitivelock
555
-
556
- # IPCB\_PrimitiveDimension.getState\_PrimitiveLock() method
557
-
558
- Get the property state: whether it is locked
559
-
560
- ## Signature
561
-
562
- ```typescript
563
- function getState_PrimitiveLock(): boolean;
564
- ```
565
-
566
- ## Returns
567
-
568
- boolean
569
-
570
- Whether it is locked
571
-
572
- ## Example
573
-
574
- ```javascript
575
- // 1. 创建一个未锁定的长度标注
576
- const dim = await eda.pcb_PrimitiveDimension.create(
577
- 'Length Dimension',
578
- [1000, 1000, 1000, 800, 3000, 800, 3000, 1000],
579
- 3
580
- );
581
-
582
- // 2. 读取锁定状态
583
- const primitiveLock = dim.getState_PrimitiveLock();
584
-
585
- // 3. 清理测试图元(查询类案例不留测试对象)
586
- await eda.pcb_PrimitiveDimension.delete([dim.getState_PrimitiveId()]);
587
-
588
- console.log('primitiveLock:', primitiveLock);
589
- ```
590
-
591
- ### getstate_primitivetype
592
-
593
- # IPCB\_PrimitiveDimension.getState\_PrimitiveType() method
594
-
595
- Get the property state: primitive type
596
-
597
- ## Signature
598
-
599
- ```typescript
600
- function getState_PrimitiveType(): EPCB_PrimitiveType;
601
- ```
602
-
603
- ## Returns
604
-
605
- [EPCB\_PrimitiveType](../enums/EPCB_PrimitiveType.md)
606
-
607
- Primitive type
608
-
609
- ## Example
610
-
611
- ```javascript
612
- // 1. 创建一个长度标注
613
- const dim = await eda.pcb_PrimitiveDimension.create(
614
- 'Length Dimension',
615
- [1000, 1000, 1000, 800, 3000, 800, 3000, 1000],
616
- 3
617
- );
618
-
619
- // 2. 读取图元类型
620
- const primitiveType = dim.getState_PrimitiveType();
621
-
622
- // 3. 清理测试图元(查询类案例不留测试对象)
623
- await eda.pcb_PrimitiveDimension.delete([dim.getState_PrimitiveId()]);
624
-
625
- console.log('primitiveType:', primitiveType);
626
- ```
627
-
628
- ### getstate_textfollow
629
-
630
- # IPCB\_PrimitiveDimension.getState\_TextFollow() method
631
-
632
- Get the property state: text follows
633
-
634
- ## Signature
635
-
636
- ```typescript
637
- function getState_TextFollow(): 0 | 1;
638
- ```
639
-
640
- ## Returns
641
-
642
- 0 \| 1
643
-
644
- Text follows
645
-
646
- ## Example
647
-
648
- ```javascript
649
- // 1. 创建一个长度标注
650
- const dim = await eda.pcb_PrimitiveDimension.create(
651
- 'Length Dimension',
652
- [1000, 1000, 1000, 800, 3000, 800, 3000, 1000],
653
- 3
654
- );
655
-
656
- // 2. 读取文字跟随状态(0 或 1)
657
- const textFollow = dim.getState_TextFollow();
658
-
659
- // 3. 清理测试图元(查询类案例不留测试对象)
660
- await eda.pcb_PrimitiveDimension.delete([dim.getState_PrimitiveId()]);
661
-
662
- console.log('textFollow:', textFollow);
663
- ```
664
-
665
- ### getstate_unit
666
-
667
- # IPCB\_PrimitiveDimension.getState\_Unit() method
668
-
669
- Get the property state: unit
670
-
671
- ## Signature
672
-
673
- ```typescript
674
- function getState_Unit():
675
- ESYS_Unit.MILLIMETER | ESYS_Unit.CENTIMETER | ESYS_Unit.INCH | ESYS_Unit.MIL;
676
- ```
677
-
678
- ## Returns
679
-
680
- [ESYS\_Unit.MILLIMETER](../enums/ESYS_Unit.md) \| [ESYS\_Unit.CENTIMETER](../enums/ESYS_Unit.md) \| [ESYS\_Unit.INCH](../enums/ESYS_Unit.md) \| [ESYS\_Unit.MIL](../enums/ESYS_Unit.md)
681
-
682
- Unit
683
-
684
- ## Example
685
-
686
- ```javascript
687
- // 1. 创建一个默认单位(毫米)的长度标注
688
- const dim = await eda.pcb_PrimitiveDimension.create(
689
- 'Length Dimension',
690
- [1000, 1000, 1000, 800, 3000, 800, 3000, 1000],
691
- 3
692
- );
693
-
694
- // 2. 读取显示单位('mm' / 'cm' / 'inch' / 'mil')
695
- const unit = dim.getState_Unit();
696
-
697
- // 3. 清理测试图元(查询类案例不留测试对象)
698
- await eda.pcb_PrimitiveDimension.delete([dim.getState_PrimitiveId()]);
699
-
700
- console.log('unit:', unit);
701
- ```
702
-
703
- ### isasync
704
-
705
- # IPCB\_PrimitiveDimension.isAsync() method
706
-
707
- Query whether the primitive is an async primitive
708
-
709
- ## Signature
710
-
711
- ```typescript
712
- function isAsync(): boolean;
713
- ```
714
-
715
- ## Returns
716
-
717
- boolean
718
-
719
- Whether Is async primitive
720
-
721
- ## Example
722
-
723
- ```javascript
724
- // 1. 创建一个长度标注,创建后默认处于异步模式
725
- const dim = await eda.pcb_PrimitiveDimension.create(
726
- 'Length Dimension',
727
- [1000, 1000, 1000, 800, 3000, 800, 3000, 1000],
728
- 3
729
- );
730
- const asyncOnCreate = dim.isAsync();
731
-
732
- // 2. 切换到同步模式再查询一次,对比两种模式
733
- dim.toSync();
734
- const asyncAfterToSync = dim.isAsync();
735
-
736
- // 3. 清理测试图元(查询类案例不留测试对象)
737
- await eda.pcb_PrimitiveDimension.delete([dim.getState_PrimitiveId()]);
738
-
739
- console.log('isAsync on create:', asyncOnCreate);
740
- console.log('isAsync after toSync:', asyncAfterToSync);
741
- ```
742
-
743
- ### reset
744
-
745
- # IPCB\_PrimitiveDimension.reset() method
746
-
747
- > 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.
748
-
749
- Reset the async primitive to the current canvas state
750
-
751
- ## Signature
752
-
753
- ```typescript
754
- function reset(): Promise<IPCB_PrimitiveDimension>;
755
- ```
756
-
757
- ## Returns
758
-
759
- Promise&lt;[IPCB\_PrimitiveDimension](./IPCB_PrimitiveDimension.md)<!-- -->&gt;
760
-
761
- Dimension primitive object
762
-
763
- ## Example
764
-
765
- ```javascript
766
- // 1. 生成本次运行专用的坐标,避免与之前保留的测试标注重合
767
- const x = 2000 + Math.floor(Math.random() * 100000);
768
-
769
- // 2. 创建一个 10mil 线宽的长度标注
770
- const dim = await eda.pcb_PrimitiveDimension.create(
771
- 'Length Dimension',
772
- [x, 2000, x, 1800, x + 2000, 1800, x + 2000, 2000],
773
- 3,
774
- undefined,
775
- 10
776
- );
777
-
778
- // 3. 切换异步模式,累计一处未提交的线宽修改(10 → 99)
779
- const asyncDim = dim.toAsync();
780
- asyncDim.setState_LineWidth(99);
781
-
782
- // 4. 重置:丢弃未提交的修改,回到画布当前状态
783
- await asyncDim.reset();
784
-
785
- // 5. 从画布重新读取,线宽仍是 10(保留现场供观察)
786
- const refetched = await eda.pcb_PrimitiveDimension.get(dim.getState_PrimitiveId());
787
-
788
- console.log('lineWidth after reset:', refetched.getState_LineWidth());
789
- ```
790
-
791
- ### setstate_coordinateset
792
-
793
- # IPCB\_PrimitiveDimension.setState\_CoordinateSet() method
794
-
795
- > 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.
796
-
797
- Set the property state: coordinate set
798
-
799
- ## Signature
800
-
801
- ```typescript
802
- function setState_CoordinateSet(
803
- coordinateSet: TPCB_PrimitiveDimensionCoordinateSet,
804
- ): IPCB_PrimitiveDimension;
805
- ```
806
-
807
- ## Parameters
808
-
809
- <table><thead><tr><th>
810
-
811
- Parameter
812
-
813
- </th><th>
814
-
815
- Type
816
-
817
- </th><th>
818
-
819
- Description
820
-
821
- </th></tr></thead>
822
- <tbody><tr><td>
823
-
824
- coordinateSet
825
-
826
- </td><td>
827
-
828
- [TPCB\_PrimitiveDimensionCoordinateSet](../types/TPCB_PrimitiveDimensionCoordinateSet.md)
829
-
830
- </td><td>
831
-
832
- Coordinate set
833
-
834
- </td></tr>
835
- </tbody></table>
836
-
837
- ## Returns
838
-
839
- [IPCB\_PrimitiveDimension](./IPCB_PrimitiveDimension.md)
840
-
841
- Dimension primitive object
842
-
843
- ## Example
844
-
845
- ```javascript
846
- // 1. 生成本次运行专用的坐标,避免与之前保留的测试标注重合
847
- const x = 2000 + Math.floor(Math.random() * 100000);
848
-
849
- // 2. 创建一个长度标注(测量 x 到 x+2000 的水平距离)
850
- const dim = await eda.pcb_PrimitiveDimension.create(
851
- 'Length Dimension',
852
- [x, 2000, x, 1800, x + 2000, 1800, x + 2000, 2000],
853
- 3
854
- );
855
- const before = dim.getState_CoordinateSet();
856
-
857
- // 3. 切换异步模式并替换坐标集:测量度改为 3000
858
- const asyncDim = dim.toAsync();
859
- asyncDim.setState_CoordinateSet([x, 2000, x, 1800, x + 3000, 1800, x + 3000, 2000]);
860
- await asyncDim.done();
861
-
862
- // 4. 从画布重新读取,确认修改已生效(保留现场供观察)
863
- const refetched = await eda.pcb_PrimitiveDimension.get(dim.getState_PrimitiveId());
864
-
865
- console.log('coordinateSet:', JSON.stringify(before), '→', JSON.stringify(refetched.getState_CoordinateSet()));
866
- ```
867
-
868
- ### setstate_dimensiontype
869
-
870
- # IPCB\_PrimitiveDimension.setState\_DimensionType() method
871
-
872
- > 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.
873
-
874
- Set the property state: dimension type
875
-
876
- ## Signature
877
-
878
- ```typescript
879
- function setState_DimensionType(
880
- dimensionType: EPCB_PrimitiveDimensionType,
881
- ): IPCB_PrimitiveDimension;
882
- ```
883
-
884
- ## Parameters
885
-
886
- <table><thead><tr><th>
887
-
888
- Parameter
889
-
890
- </th><th>
891
-
892
- Type
893
-
894
- </th><th>
895
-
896
- Description
897
-
898
- </th></tr></thead>
899
- <tbody><tr><td>
900
-
901
- dimensionType
902
-
903
- </td><td>
904
-
905
- [EPCB\_PrimitiveDimensionType](../enums/EPCB_PrimitiveDimensionType.md)
906
-
907
- </td><td>
908
-
909
- Dimension type
910
-
911
- </td></tr>
912
- </tbody></table>
913
-
914
- ## Returns
915
-
916
- [IPCB\_PrimitiveDimension](./IPCB_PrimitiveDimension.md)
917
-
918
- Dimension primitive object
919
-
920
- ## Example
921
-
922
- ```javascript
923
- // 1. 生成本次运行专用的坐标,避免与之前保留的测试标注重合
924
- const x = 2000 + Math.floor(Math.random() * 100000);
925
-
926
- // 2. 创建一个长度标注(8 元素坐标集)
927
- const dim = await eda.pcb_PrimitiveDimension.create(
928
- 'Length Dimension',
929
- [x, 2000, x, 1800, x + 2000, 1800, x + 2000, 2000],
930
- 3
931
- );
932
- const before = dim.getState_DimensionType();
933
-
934
- // 3. 切换异步模式:换成半径标注,坐标集同步换成 6 元素格式(圆上端点、标注线尾、文字位置)
935
- const asyncDim = dim.toAsync();
936
- asyncDim.setState_DimensionType('Radius Dimension');
937
- asyncDim.setState_CoordinateSet([x + 1500, 3500, x + 3500, 3500, x + 2500, 4200]);
938
- await asyncDim.done();
939
-
940
- // 4. 从画布重新读取,确认修改已生效(保留现场供观察)
941
- const refetched = await eda.pcb_PrimitiveDimension.get(dim.getState_PrimitiveId());
942
-
943
- console.log('dimensionType:', before, '→', refetched.getState_DimensionType());
944
- ```
945
-
946
- ### setstate_layer
947
-
948
- # IPCB\_PrimitiveDimension.setState\_Layer() method
949
-
950
- > 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.
951
-
952
- Set the property state: Layer
953
-
954
- ## Signature
955
-
956
- ```typescript
957
- function setState_Layer(layer: TPCB_LayersOfDimension): IPCB_PrimitiveDimension;
958
- ```
959
-
960
- ## Parameters
961
-
962
- <table><thead><tr><th>
963
-
964
- Parameter
965
-
966
- </th><th>
967
-
968
- Type
969
-
970
- </th><th>
971
-
972
- Description
973
-
974
- </th></tr></thead>
975
- <tbody><tr><td>
976
-
977
- layer
978
-
979
- </td><td>
980
-
981
- [TPCB\_LayersOfDimension](../types/TPCB_LayersOfDimension.md)
982
-
983
- </td><td>
984
-
985
- Layer
986
-
987
- </td></tr>
988
- </tbody></table>
989
-
990
- ## Returns
991
-
992
- [IPCB\_PrimitiveDimension](./IPCB_PrimitiveDimension.md)
993
-
994
- Dimension primitive object
995
-
996
- ## Example
997
-
998
- ```javascript
999
- // 1. 生成本次运行专用的坐标,避免与之前保留的测试标注重合
1000
- const x = 2000 + Math.floor(Math.random() * 100000);
1001
-
1002
- // 2. 创建一个顶层丝印层(3)的长度标注
1003
- const dim = await eda.pcb_PrimitiveDimension.create(
1004
- 'Length Dimension',
1005
- [x, 2000, x, 1800, x + 2000, 1800, x + 2000, 2000],
1006
- 3
1007
- );
1008
- const before = dim.getState_Layer();
1009
-
1010
- // 3. 切换异步模式并换到底层丝印层(4)
1011
- const asyncDim = dim.toAsync();
1012
- asyncDim.setState_Layer(4);
1013
- await asyncDim.done();
1014
-
1015
- // 4. 从画布重新读取,确认修改已生效(保留现场供观察)
1016
- const refetched = await eda.pcb_PrimitiveDimension.get(dim.getState_PrimitiveId());
1017
-
1018
- console.log('layer:', before, '→', refetched.getState_Layer());
1019
- ```
1020
-
1021
- ### setstate_linewidth
1022
-
1023
- # IPCB\_PrimitiveDimension.setState\_LineWidth() method
1024
-
1025
- > 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.
1026
-
1027
- Set the property state: Line width
1028
-
1029
- ## Signature
1030
-
1031
- ```typescript
1032
- function setState_LineWidth(lineWidth: number): IPCB_PrimitiveDimension;
1033
- ```
1034
-
1035
- ## Parameters
1036
-
1037
- <table><thead><tr><th>
1038
-
1039
- Parameter
1040
-
1041
- </th><th>
1042
-
1043
- Type
1044
-
1045
- </th><th>
1046
-
1047
- Description
1048
-
1049
- </th></tr></thead>
1050
- <tbody><tr><td>
1051
-
1052
- lineWidth
1053
-
1054
- </td><td>
1055
-
1056
- number
1057
-
1058
- </td><td>
1059
-
1060
- Line width
1061
-
1062
- </td></tr>
1063
- </tbody></table>
1064
-
1065
- ## Returns
1066
-
1067
- [IPCB\_PrimitiveDimension](./IPCB_PrimitiveDimension.md)
1068
-
1069
- Dimension primitive object
1070
-
1071
- ## Example
1072
-
1073
- ```javascript
1074
- // 1. 生成本次运行专用的坐标,避免之前保留的测试标注重合
1075
- const x = 2000 + Math.floor(Math.random() * 100000);
1076
-
1077
- // 2. 创建一个 10mil 线宽的长度标注
1078
- const dim = await eda.pcb_PrimitiveDimension.create(
1079
- 'Length Dimension',
1080
- [x, 2000, x, 1800, x + 2000, 1800, x + 2000, 2000],
1081
- 3,
1082
- undefined,
1083
- 10
1084
- );
1085
- const before = dim.getState_LineWidth();
1086
-
1087
- // 3. 切换异步模式,线宽加粗到 20mil
1088
- const asyncDim = dim.toAsync();
1089
- asyncDim.setState_LineWidth(20);
1090
- await asyncDim.done();
1091
-
1092
- // 4. 从画布重新读取,确认修改已生效(保留现场供观察)
1093
- const refetched = await eda.pcb_PrimitiveDimension.get(dim.getState_PrimitiveId());
1094
-
1095
- console.log('lineWidth:', before, '→', refetched.getState_LineWidth());
1096
- ```
1097
-
1098
- ### setstate_precision
1099
-
1100
- # IPCB\_PrimitiveDimension.setState\_Precision() method
1101
-
1102
- > 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.
1103
-
1104
- Set the property state: precision
1105
-
1106
- ## Signature
1107
-
1108
- ```typescript
1109
- function setState_Precision(precision: number): IPCB_PrimitiveDimension;
1110
- ```
1111
-
1112
- ## Parameters
1113
-
1114
- <table><thead><tr><th>
1115
-
1116
- Parameter
1117
-
1118
- </th><th>
1119
-
1120
- Type
1121
-
1122
- </th><th>
1123
-
1124
- Description
1125
-
1126
- </th></tr></thead>
1127
- <tbody><tr><td>
1128
-
1129
- precision
1130
-
1131
- </td><td>
1132
-
1133
- number
1134
-
1135
- </td><td>
1136
-
1137
- Precision
1138
-
1139
- </td></tr>
1140
- </tbody></table>
1141
-
1142
- ## Returns
1143
-
1144
- [IPCB\_PrimitiveDimension](./IPCB_PrimitiveDimension.md)
1145
-
1146
- Dimension primitive object
1147
-
1148
- ## Example
1149
-
1150
- ```javascript
1151
- // 1. 生成本次运行专用的坐标,避免与之前保留的测试标注重合
1152
- const x = 2000 + Math.floor(Math.random() * 100000);
1153
-
1154
- // 2. 创建一个精度为 2 位的长度标注
1155
- const dim = await eda.pcb_PrimitiveDimension.create(
1156
- 'Length Dimension',
1157
- [x, 2000, x, 1800, x + 2000, 1800, x + 2000, 2000],
1158
- 3,
1159
- undefined,
1160
- undefined,
1161
- 2
1162
- );
1163
- const before = dim.getState_Precision();
1164
-
1165
- // 3. 切换异步模式,精度提高到 3 位
1166
- const asyncDim = dim.toAsync();
1167
- asyncDim.setState_Precision(3);
1168
- await asyncDim.done();
1169
-
1170
- // 4. 从画布重新读取,确认修改已生效(保留现场供观察)
1171
- const refetched = await eda.pcb_PrimitiveDimension.get(dim.getState_PrimitiveId());
1172
-
1173
- console.log('precision:', before, '→', refetched.getState_Precision());
1174
- ```
1175
-
1176
- ### setstate_primitivelock
1177
-
1178
- # IPCB\_PrimitiveDimension.setState\_PrimitiveLock() method
1179
-
1180
- > 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.
1181
-
1182
- Set the property state: whether it is locked
1183
-
1184
- ## Signature
1185
-
1186
- ```typescript
1187
- function setState_PrimitiveLock(primitiveLock: boolean): IPCB_PrimitiveDimension;
1188
- ```
1189
-
1190
- ## Parameters
1191
-
1192
- <table><thead><tr><th>
1193
-
1194
- Parameter
1195
-
1196
- </th><th>
1197
-
1198
- Type
1199
-
1200
- </th><th>
1201
-
1202
- Description
1203
-
1204
- </th></tr></thead>
1205
- <tbody><tr><td>
1206
-
1207
- primitiveLock
1208
-
1209
- </td><td>
1210
-
1211
- boolean
1212
-
1213
- </td><td>
1214
-
1215
- Whether it is locked
1216
-
1217
- </td></tr>
1218
- </tbody></table>
1219
-
1220
- ## Returns
1221
-
1222
- [IPCB\_PrimitiveDimension](./IPCB_PrimitiveDimension.md)
1223
-
1224
- Dimension primitive object
1225
-
1226
- ## Example
1227
-
1228
- ```javascript
1229
- // 1. 生成本次运行专用的坐标,避免与之前保留的测试标注重合
1230
- const x = 2000 + Math.floor(Math.random() * 100000);
1231
-
1232
- // 2. 创建一个未锁定的长度标注
1233
- const dim = await eda.pcb_PrimitiveDimension.create(
1234
- 'Length Dimension',
1235
- [x, 2000, x, 1800, x + 2000, 1800, x + 2000, 2000],
1236
- 3
1237
- );
1238
- const before = dim.getState_PrimitiveLock();
1239
-
1240
- // 3. 切换异步模式并锁定标注
1241
- const asyncDim = dim.toAsync();
1242
- asyncDim.setState_PrimitiveLock(true);
1243
- await asyncDim.done();
1244
-
1245
- // 4. 从画布重新读取,确认修改已生效(保留现场供观察)
1246
- const refetched = await eda.pcb_PrimitiveDimension.get(dim.getState_PrimitiveId());
1247
-
1248
- console.log('primitiveLock:', before, '→', refetched.getState_PrimitiveLock());
1249
- ```
1250
-
1251
- ### setstate_unit
1252
-
1253
- # IPCB\_PrimitiveDimension.setState\_Unit() method
1254
-
1255
- > 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.
1256
-
1257
- Set the property state: unit
1258
-
1259
- ## Signature
1260
-
1261
- ```typescript
1262
- function setState_Unit(
1263
- unit: ESYS_Unit.MILLIMETER | ESYS_Unit.CENTIMETER | ESYS_Unit.INCH | ESYS_Unit.MIL,
1264
- ): IPCB_PrimitiveDimension;
1265
- ```
1266
-
1267
- ## Parameters
1268
-
1269
- <table><thead><tr><th>
1270
-
1271
- Parameter
1272
-
1273
- </th><th>
1274
-
1275
- Type
1276
-
1277
- </th><th>
1278
-
1279
- Description
1280
-
1281
- </th></tr></thead>
1282
- <tbody><tr><td>
1283
-
1284
- unit
1285
-
1286
- </td><td>
1287
-
1288
- [ESYS\_Unit.MILLIMETER](../enums/ESYS_Unit.md) \| [ESYS\_Unit.CENTIMETER](../enums/ESYS_Unit.md) \| [ESYS\_Unit.INCH](../enums/ESYS_Unit.md) \| [ESYS\_Unit.MIL](../enums/ESYS_Unit.md)
1289
-
1290
- </td><td>
1291
-
1292
- Unit
1293
-
1294
- </td></tr>
1295
- </tbody></table>
1296
-
1297
- ## Returns
1298
-
1299
- [IPCB\_PrimitiveDimension](./IPCB_PrimitiveDimension.md)
1300
-
1301
- Dimension primitive object
1302
-
1303
- ## Example
1304
-
1305
- ```javascript
1306
- // 1. 生成本次运行专用的坐标,避免与之前保留的测试标注重合
1307
- const x = 2000 + Math.floor(Math.random() * 100000);
1308
-
1309
- // 2. 创建一个默认毫米单位的长度标注
1310
- const dim = await eda.pcb_PrimitiveDimension.create(
1311
- 'Length Dimension',
1312
- [x, 2000, x, 1800, x + 2000, 1800, x + 2000, 2000],
1313
- 3
1314
- );
1315
- const before = dim.getState_Unit();
1316
-
1317
- // 3. 切换异步模式,单位换成密尔
1318
- const asyncDim = dim.toAsync();
1319
- asyncDim.setState_Unit('mil');
1320
- await asyncDim.done();
1321
-
1322
- // 4. 从画布重新读取,确认修改已生效(保留现场供观察)
1323
- const refetched = await eda.pcb_PrimitiveDimension.get(dim.getState_PrimitiveId());
1324
-
1325
- console.log('unit:', before, '→', refetched.getState_Unit());
1326
- ```
1327
-
1328
- ### toasync
1329
-
1330
- # IPCB\_PrimitiveDimension.toAsync() method
1331
-
1332
- Convert Primitive to Async primitive
1333
-
1334
- ## Signature
1335
-
1336
- ```typescript
1337
- function toAsync(): IPCB_PrimitiveDimension;
1338
- ```
1339
-
1340
- ## Returns
1341
-
1342
- [IPCB\_PrimitiveDimension](./IPCB_PrimitiveDimension.md)
1343
-
1344
- Dimension primitive object
1345
-
1346
- ## Example
1347
-
1348
- ```javascript
1349
- // 1. 生成本次运行专用的坐标,避免与之前保留的测试标注重合
1350
- const x = 2000 + Math.floor(Math.random() * 100000);
1351
-
1352
- // 2. 创建一个长度标注(创建后处于同步模式)
1353
- const dim = await eda.pcb_PrimitiveDimension.create(
1354
- 'Length Dimension',
1355
- [x, 2000, x, 1800, x + 2000, 1800, x + 2000, 2000],
1356
- 3,
1357
- undefined,
1358
- 10
1359
- );
1360
-
1361
- // 3. 转换为异步图元
1362
- const asyncDim = dim.toAsync();
1363
-
1364
- // 4. 异步模式下累计修改并提交
1365
- asyncDim.setState_LineWidth(20);
1366
- await asyncDim.done();
1367
-
1368
- // 5. 从画布重新读取,确认提交生效(保留现场供观察)
1369
- const refetched = await eda.pcb_PrimitiveDimension.get(dim.getState_PrimitiveId());
1370
-
1371
- console.log('isAsync after toAsync:', dim.isAsync());
1372
- console.log('lineWidth:', 10, '→', refetched.getState_LineWidth());
1373
- ```
1374
-
1375
- ### tosync
1376
-
1377
- # IPCB\_PrimitiveDimension.toSync() method
1378
-
1379
- Convert Primitive to Sync primitive
1380
-
1381
- ## Signature
1382
-
1383
- ```typescript
1384
- function toSync(): IPCB_PrimitiveDimension;
1385
- ```
1386
-
1387
- ## Returns
1388
-
1389
- [IPCB\_PrimitiveDimension](./IPCB_PrimitiveDimension.md)
1390
-
1391
- Dimension primitive object
1392
-
1393
- ## Example
1394
-
1395
- ```javascript
1396
- // 1. 生成本次运行专用的坐标,避免与之前保留的测试标注重合
1397
- const x = 2000 + Math.floor(Math.random() * 100000);
1398
-
1399
- // 2. 创建一个 10mil 线宽的长度标注
1400
- const dim = await eda.pcb_PrimitiveDimension.create(
1401
- 'Length Dimension',
1402
- [x, 2000, x, 1800, x + 2000, 1800, x + 2000, 2000],
1403
- 3,
1404
- undefined,
1405
- 10
1406
- );
1407
-
1408
- // 3. 转换为同步图元
1409
- const syncDim = dim.toSync();
1410
-
1411
- // 4. 同步模式下修改线宽,立即生效(无需 done())
1412
- syncDim.setState_LineWidth(20);
1413
-
1414
- // 5. 从画布重新读取,确认修改已生效(保留现场供观察)
1415
- const refetched = await eda.pcb_PrimitiveDimension.get(dim.getState_PrimitiveId());
1416
-
1417
- console.log('isSync after toSync:', !syncDim.isAsync());
1418
- console.log('lineWidth:', 10, '→', refetched.getState_LineWidth());
1419
- ```
1
+ # IPCB\_PrimitiveDimension class
2
+
3
+ Dimension primitive
4
+
5
+ ## Signature
6
+
7
+ ```typescript
8
+ class IPCB_PrimitiveDimension 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_PrimitiveDimension.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\_CoordinateSet()](./IPCB_PrimitiveDimension.md)
43
+
44
+ </td><td>
45
+
46
+ </td><td>
47
+
48
+ Get the property state: coordinate set
49
+
50
+ </td></tr>
51
+ <tr><td>
52
+
53
+ [getState\_DimensionType()](./IPCB_PrimitiveDimension.md)
54
+
55
+ </td><td>
56
+
57
+ </td><td>
58
+
59
+ Get the property state: dimension type
60
+
61
+ </td></tr>
62
+ <tr><td>
63
+
64
+ [getState\_Layer()](./IPCB_PrimitiveDimension.md)
65
+
66
+ </td><td>
67
+
68
+ </td><td>
69
+
70
+ Get the property state: Layer
71
+
72
+ </td></tr>
73
+ <tr><td>
74
+
75
+ [getState\_LineWidth()](./IPCB_PrimitiveDimension.md)
76
+
77
+ </td><td>
78
+
79
+ </td><td>
80
+
81
+ Get the property state: Line width
82
+
83
+ </td></tr>
84
+ <tr><td>
85
+
86
+ [getState\_Precision()](./IPCB_PrimitiveDimension.md)
87
+
88
+ </td><td>
89
+
90
+ </td><td>
91
+
92
+ Get the property state: precision
93
+
94
+ </td></tr>
95
+ <tr><td>
96
+
97
+ [getState\_PrimitiveId()](./IPCB_PrimitiveDimension.md)
98
+
99
+ </td><td>
100
+
101
+ </td><td>
102
+
103
+ Get the property state: primitive ID
104
+
105
+ </td></tr>
106
+ <tr><td>
107
+
108
+ [getState\_PrimitiveLock()](./IPCB_PrimitiveDimension.md)
109
+
110
+ </td><td>
111
+
112
+ </td><td>
113
+
114
+ Get the property state: whether it is locked
115
+
116
+ </td></tr>
117
+ <tr><td>
118
+
119
+ [getState\_PrimitiveType()](./IPCB_PrimitiveDimension.md)
120
+
121
+ </td><td>
122
+
123
+ </td><td>
124
+
125
+ Get the property state: primitive type
126
+
127
+ </td></tr>
128
+ <tr><td>
129
+
130
+ [getState\_TextFollow()](./IPCB_PrimitiveDimension.md)
131
+
132
+ </td><td>
133
+
134
+ </td><td>
135
+
136
+ Get the property state: text follows
137
+
138
+ </td></tr>
139
+ <tr><td>
140
+
141
+ [getState\_Unit()](./IPCB_PrimitiveDimension.md)
142
+
143
+ </td><td>
144
+
145
+ </td><td>
146
+
147
+ Get the property state: unit
148
+
149
+ </td></tr>
150
+ <tr><td>
151
+
152
+ [isAsync()](./IPCB_PrimitiveDimension.md)
153
+
154
+ </td><td>
155
+
156
+ </td><td>
157
+
158
+ Query whether the primitive is an async primitive
159
+
160
+ </td></tr>
161
+ <tr><td>
162
+
163
+ [reset()](./IPCB_PrimitiveDimension.md)
164
+
165
+ </td><td>
166
+
167
+ </td><td>
168
+
169
+ **_(BETA)_** Reset the async primitive to the current canvas state
170
+
171
+ </td></tr>
172
+ <tr><td>
173
+
174
+ [setState\_CoordinateSet(coordinateSet)](./IPCB_PrimitiveDimension.md)
175
+
176
+ </td><td>
177
+
178
+ </td><td>
179
+
180
+ **_(BETA)_** Set the property state: coordinate set
181
+
182
+ </td></tr>
183
+ <tr><td>
184
+
185
+ [setState\_DimensionType(dimensionType)](./IPCB_PrimitiveDimension.md)
186
+
187
+ </td><td>
188
+
189
+ </td><td>
190
+
191
+ **_(BETA)_** Set the property state: dimension type
192
+
193
+ </td></tr>
194
+ <tr><td>
195
+
196
+ [setState\_Layer(layer)](./IPCB_PrimitiveDimension.md)
197
+
198
+ </td><td>
199
+
200
+ </td><td>
201
+
202
+ **_(BETA)_** Set the property state: Layer
203
+
204
+ </td></tr>
205
+ <tr><td>
206
+
207
+ [setState\_LineWidth(lineWidth)](./IPCB_PrimitiveDimension.md)
208
+
209
+ </td><td>
210
+
211
+ </td><td>
212
+
213
+ **_(BETA)_** Set the property state: Line width
214
+
215
+ </td></tr>
216
+ <tr><td>
217
+
218
+ [setState\_Precision(precision)](./IPCB_PrimitiveDimension.md)
219
+
220
+ </td><td>
221
+
222
+ </td><td>
223
+
224
+ **_(BETA)_** Set the property state: precision
225
+
226
+ </td></tr>
227
+ <tr><td>
228
+
229
+ [setState\_PrimitiveLock(primitiveLock)](./IPCB_PrimitiveDimension.md)
230
+
231
+ </td><td>
232
+
233
+ </td><td>
234
+
235
+ **_(BETA)_** Set the property state: whether it is locked
236
+
237
+ </td></tr>
238
+ <tr><td>
239
+
240
+ [setState\_Unit(unit)](./IPCB_PrimitiveDimension.md)
241
+
242
+ </td><td>
243
+
244
+ </td><td>
245
+
246
+ **_(BETA)_** Set the property state: unit
247
+
248
+ </td></tr>
249
+ <tr><td>
250
+
251
+ [toAsync()](./IPCB_PrimitiveDimension.md)
252
+
253
+ </td><td>
254
+
255
+ </td><td>
256
+
257
+ Convert Primitive to Async primitive
258
+
259
+ </td></tr>
260
+ <tr><td>
261
+
262
+ [toSync()](./IPCB_PrimitiveDimension.md)
263
+
264
+ </td><td>
265
+
266
+ </td><td>
267
+
268
+ Convert Primitive to Sync primitive
269
+
270
+ </td></tr>
271
+ </tbody></table>
272
+
273
+ ---
274
+
275
+ ## 方法详情
276
+
277
+ ### done
278
+
279
+ # IPCB\_PrimitiveDimension.done() method
280
+
281
+ > This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
282
+
283
+ Apply the changes to the primitives to the canvas
284
+
285
+ ## Signature
286
+
287
+ ```typescript
288
+ function done(): Promise<IPCB_PrimitiveDimension>;
289
+ ```
290
+
291
+ ## Returns
292
+
293
+ Promise&lt;[IPCB\_PrimitiveDimension](./IPCB_PrimitiveDimension.md)<!-- -->&gt;
294
+
295
+ Dimension primitive object
296
+
297
+ ## Example
298
+
299
+ ```javascript
300
+ // 1. 生成本次运行专用的坐标,避免与之前保留的测试标注重合
301
+ const x = 2000 + Math.floor(Math.random() * 100000);
302
+
303
+ // 2. 创建一个长度标注
304
+ const dim = await eda.pcb_PrimitiveDimension.create(
305
+ 'Length Dimension',
306
+ [x, 2000, x, 1800, x + 2000, 1800, x + 2000, 2000],
307
+ 3,
308
+ undefined,
309
+ 10
310
+ );
311
+
312
+ // 3. 切换异步模式,连续累计两处修改(线宽 + 换层)
313
+ const asyncDim = dim.toAsync();
314
+ asyncDim.setState_LineWidth(20);
315
+ asyncDim.setState_Layer(4);
316
+
317
+ // 4. 一次性提交到画布
318
+ await asyncDim.done();
319
+
320
+ // 5. 从画布重新读取,确认两处修改都已生效(保留现场供观察)
321
+ const refetched = await eda.pcb_PrimitiveDimension.get(dim.getState_PrimitiveId());
322
+
323
+ console.log('lineWidth:', 10, '→', refetched.getState_LineWidth());
324
+ console.log('layer:', 3, '→', refetched.getState_Layer());
325
+ ```
326
+
327
+ ### getstate_coordinateset
328
+
329
+ # IPCB\_PrimitiveDimension.getState\_CoordinateSet() method
330
+
331
+ Get the property state: coordinate set
332
+
333
+ ## Signature
334
+
335
+ ```typescript
336
+ function getState_CoordinateSet(): TPCB_PrimitiveDimensionCoordinateSet;
337
+ ```
338
+
339
+ ## Returns
340
+
341
+ [TPCB\_PrimitiveDimensionCoordinateSet](../types/TPCB_PrimitiveDimensionCoordinateSet.md)
342
+
343
+ Coordinate set
344
+
345
+ ## Example
346
+
347
+ ```javascript
348
+ // 1. 创建一个长度标注(8 元素坐标集:测量端点、箭头端点各两组)
349
+ const dim = await eda.pcb_PrimitiveDimension.create(
350
+ 'Length Dimension',
351
+ [1000, 1000, 1000, 800, 3000, 800, 3000, 1000],
352
+ 3
353
+ );
354
+
355
+ // 2. 读取坐标集
356
+ const coordinateSet = dim.getState_CoordinateSet();
357
+
358
+ // 3. 清理测试图元(查询类案例不留测试对象)
359
+ await eda.pcb_PrimitiveDimension.delete([dim.getState_PrimitiveId()]);
360
+
361
+ console.log('coordinateSet:', JSON.stringify(coordinateSet));
362
+ ```
363
+
364
+ ### getstate_dimensiontype
365
+
366
+ # IPCB\_PrimitiveDimension.getState\_DimensionType() method
367
+
368
+ Get the property state: dimension type
369
+
370
+ ## Signature
371
+
372
+ ```typescript
373
+ function getState_DimensionType(): EPCB_PrimitiveDimensionType;
374
+ ```
375
+
376
+ ## Returns
377
+
378
+ [EPCB\_PrimitiveDimensionType](../enums/EPCB_PrimitiveDimensionType.md)
379
+
380
+ Dimension type
381
+
382
+ ## Example
383
+
384
+ ```javascript
385
+ // 1. 创建一个长度标注("Length Dimension")
386
+ const dim = await eda.pcb_PrimitiveDimension.create(
387
+ 'Length Dimension',
388
+ [1000, 1000, 1000, 800, 3000, 800, 3000, 1000],
389
+ 3
390
+ );
391
+
392
+ // 2. 读取标注类型
393
+ const dimensionType = dim.getState_DimensionType();
394
+
395
+ // 3. 清理测试图元(查询类案例不留测试对象)
396
+ await eda.pcb_PrimitiveDimension.delete([dim.getState_PrimitiveId()]);
397
+
398
+ console.log('dimensionType:', dimensionType);
399
+ ```
400
+
401
+ ### getstate_layer
402
+
403
+ # IPCB\_PrimitiveDimension.getState\_Layer() method
404
+
405
+ Get the property state: Layer
406
+
407
+ ## Signature
408
+
409
+ ```typescript
410
+ function getState_Layer(): TPCB_LayersOfDimension;
411
+ ```
412
+
413
+ ## Returns
414
+
415
+ [TPCB\_LayersOfDimension](../types/TPCB_LayersOfDimension.md)
416
+
417
+ Layer
418
+
419
+ ## Example
420
+
421
+ ```javascript
422
+ // 1. 创建一个顶层丝印层(3)的长度标注
423
+ const dim = await eda.pcb_PrimitiveDimension.create(
424
+ 'Length Dimension',
425
+ [1000, 1000, 1000, 800, 3000, 800, 3000, 1000],
426
+ 3
427
+ );
428
+
429
+ // 2. 读取所在层
430
+ const layer = dim.getState_Layer();
431
+
432
+ // 3. 清理测试图元(查询类案例不留测试对象)
433
+ await eda.pcb_PrimitiveDimension.delete([dim.getState_PrimitiveId()]);
434
+
435
+ console.log('layer:', layer);
436
+ ```
437
+
438
+ ### getstate_linewidth
439
+
440
+ # IPCB\_PrimitiveDimension.getState\_LineWidth() method
441
+
442
+ Get the property state: Line width
443
+
444
+ ## Signature
445
+
446
+ ```typescript
447
+ function getState_LineWidth(): number;
448
+ ```
449
+
450
+ ## Returns
451
+
452
+ number
453
+
454
+ Line width
455
+
456
+ ## Example
457
+
458
+ ```javascript
459
+ // 1. 创建一个 10mil 线宽的长度标注
460
+ const dim = await eda.pcb_PrimitiveDimension.create(
461
+ 'Length Dimension',
462
+ [1000, 1000, 1000, 800, 3000, 800, 3000, 1000],
463
+ 3,
464
+ undefined,
465
+ 10
466
+ );
467
+
468
+ // 2. 读取线宽
469
+ const lineWidth = dim.getState_LineWidth();
470
+
471
+ // 3. 清理测试图元(查询类案例不留测试对象)
472
+ await eda.pcb_PrimitiveDimension.delete([dim.getState_PrimitiveId()]);
473
+
474
+ console.log('lineWidth:', lineWidth);
475
+ ```
476
+
477
+ ### getstate_precision
478
+
479
+ # IPCB\_PrimitiveDimension.getState\_Precision() method
480
+
481
+ Get the property state: precision
482
+
483
+ ## Signature
484
+
485
+ ```typescript
486
+ function getState_Precision(): number;
487
+ ```
488
+
489
+ ## Returns
490
+
491
+ number
492
+
493
+ Precision
494
+
495
+ ## Example
496
+
497
+ ```javascript
498
+ // 1. 创建一个精度为 2 位的长度标注
499
+ const dim = await eda.pcb_PrimitiveDimension.create(
500
+ 'Length Dimension',
501
+ [1000, 1000, 1000, 800, 3000, 800, 3000, 1000],
502
+ 3,
503
+ undefined,
504
+ undefined,
505
+ 2
506
+ );
507
+
508
+ // 2. 读取精度
509
+ const precision = dim.getState_Precision();
510
+
511
+ // 3. 清理测试图元(查询类案例不留测试对象)
512
+ await eda.pcb_PrimitiveDimension.delete([dim.getState_PrimitiveId()]);
513
+
514
+ console.log('precision:', precision);
515
+ ```
516
+
517
+ ### getstate_primitiveid
518
+
519
+ # IPCB\_PrimitiveDimension.getState\_PrimitiveId() method
520
+
521
+ Get the property state: primitive ID
522
+
523
+ ## Signature
524
+
525
+ ```typescript
526
+ function getState_PrimitiveId(): string;
527
+ ```
528
+
529
+ ## Returns
530
+
531
+ string
532
+
533
+ Primitive ID
534
+
535
+ ## Example
536
+
537
+ ```javascript
538
+ // 1. 创建一个长度标注
539
+ const dim = await eda.pcb_PrimitiveDimension.create(
540
+ 'Length Dimension',
541
+ [1000, 1000, 1000, 800, 3000, 800, 3000, 1000],
542
+ 3
543
+ );
544
+
545
+ // 2. 读取图元 ID
546
+ const primitiveId = dim.getState_PrimitiveId();
547
+
548
+ // 3. 清理测试图元(查询类案例不留测试对象)
549
+ await eda.pcb_PrimitiveDimension.delete([primitiveId]);
550
+
551
+ console.log('primitiveId:', primitiveId);
552
+ ```
553
+
554
+ ### getstate_primitivelock
555
+
556
+ # IPCB\_PrimitiveDimension.getState\_PrimitiveLock() method
557
+
558
+ Get the property state: whether it is locked
559
+
560
+ ## Signature
561
+
562
+ ```typescript
563
+ function getState_PrimitiveLock(): boolean;
564
+ ```
565
+
566
+ ## Returns
567
+
568
+ boolean
569
+
570
+ Whether it is locked
571
+
572
+ ## Example
573
+
574
+ ```javascript
575
+ // 1. 创建一个未锁定的长度标注
576
+ const dim = await eda.pcb_PrimitiveDimension.create(
577
+ 'Length Dimension',
578
+ [1000, 1000, 1000, 800, 3000, 800, 3000, 1000],
579
+ 3
580
+ );
581
+
582
+ // 2. 读取锁定状态
583
+ const primitiveLock = dim.getState_PrimitiveLock();
584
+
585
+ // 3. 清理测试图元(查询类案例不留测试对象)
586
+ await eda.pcb_PrimitiveDimension.delete([dim.getState_PrimitiveId()]);
587
+
588
+ console.log('primitiveLock:', primitiveLock);
589
+ ```
590
+
591
+ ### getstate_primitivetype
592
+
593
+ # IPCB\_PrimitiveDimension.getState\_PrimitiveType() method
594
+
595
+ Get the property state: primitive type
596
+
597
+ ## Signature
598
+
599
+ ```typescript
600
+ function getState_PrimitiveType(): EPCB_PrimitiveType;
601
+ ```
602
+
603
+ ## Returns
604
+
605
+ [EPCB\_PrimitiveType](../enums/EPCB_PrimitiveType.md)
606
+
607
+ Primitive type
608
+
609
+ ## Example
610
+
611
+ ```javascript
612
+ // 1. 创建一个长度标注
613
+ const dim = await eda.pcb_PrimitiveDimension.create(
614
+ 'Length Dimension',
615
+ [1000, 1000, 1000, 800, 3000, 800, 3000, 1000],
616
+ 3
617
+ );
618
+
619
+ // 2. 读取图元类型
620
+ const primitiveType = dim.getState_PrimitiveType();
621
+
622
+ // 3. 清理测试图元(查询类案例不留测试对象)
623
+ await eda.pcb_PrimitiveDimension.delete([dim.getState_PrimitiveId()]);
624
+
625
+ console.log('primitiveType:', primitiveType);
626
+ ```
627
+
628
+ ### getstate_textfollow
629
+
630
+ # IPCB\_PrimitiveDimension.getState\_TextFollow() method
631
+
632
+ Get the property state: text follows
633
+
634
+ ## Signature
635
+
636
+ ```typescript
637
+ function getState_TextFollow(): 0 | 1;
638
+ ```
639
+
640
+ ## Returns
641
+
642
+ 0 \| 1
643
+
644
+ Text follows
645
+
646
+ ## Example
647
+
648
+ ```javascript
649
+ // 1. 创建一个长度标注
650
+ const dim = await eda.pcb_PrimitiveDimension.create(
651
+ 'Length Dimension',
652
+ [1000, 1000, 1000, 800, 3000, 800, 3000, 1000],
653
+ 3
654
+ );
655
+
656
+ // 2. 读取文字跟随状态(0 或 1)
657
+ const textFollow = dim.getState_TextFollow();
658
+
659
+ // 3. 清理测试图元(查询类案例不留测试对象)
660
+ await eda.pcb_PrimitiveDimension.delete([dim.getState_PrimitiveId()]);
661
+
662
+ console.log('textFollow:', textFollow);
663
+ ```
664
+
665
+ ### getstate_unit
666
+
667
+ # IPCB\_PrimitiveDimension.getState\_Unit() method
668
+
669
+ Get the property state: unit
670
+
671
+ ## Signature
672
+
673
+ ```typescript
674
+ function getState_Unit():
675
+ ESYS_Unit.MILLIMETER | ESYS_Unit.CENTIMETER | ESYS_Unit.INCH | ESYS_Unit.MIL;
676
+ ```
677
+
678
+ ## Returns
679
+
680
+ [ESYS\_Unit.MILLIMETER](../enums/ESYS_Unit.md) \| [ESYS\_Unit.CENTIMETER](../enums/ESYS_Unit.md) \| [ESYS\_Unit.INCH](../enums/ESYS_Unit.md) \| [ESYS\_Unit.MIL](../enums/ESYS_Unit.md)
681
+
682
+ Unit
683
+
684
+ ## Example
685
+
686
+ ```javascript
687
+ // 1. 创建一个默认单位(毫米)的长度标注
688
+ const dim = await eda.pcb_PrimitiveDimension.create(
689
+ 'Length Dimension',
690
+ [1000, 1000, 1000, 800, 3000, 800, 3000, 1000],
691
+ 3
692
+ );
693
+
694
+ // 2. 读取显示单位('mm' / 'cm' / 'inch' / 'mil')
695
+ const unit = dim.getState_Unit();
696
+
697
+ // 3. 清理测试图元(查询类案例不留测试对象)
698
+ await eda.pcb_PrimitiveDimension.delete([dim.getState_PrimitiveId()]);
699
+
700
+ console.log('unit:', unit);
701
+ ```
702
+
703
+ ### isasync
704
+
705
+ # IPCB\_PrimitiveDimension.isAsync() method
706
+
707
+ Query whether the primitive is an async primitive
708
+
709
+ ## Signature
710
+
711
+ ```typescript
712
+ function isAsync(): boolean;
713
+ ```
714
+
715
+ ## Returns
716
+
717
+ boolean
718
+
719
+ Whether Is async primitive
720
+
721
+ ## Example
722
+
723
+ ```javascript
724
+ // 1. 创建一个长度标注,创建后默认处于异步模式
725
+ const dim = await eda.pcb_PrimitiveDimension.create(
726
+ 'Length Dimension',
727
+ [1000, 1000, 1000, 800, 3000, 800, 3000, 1000],
728
+ 3
729
+ );
730
+ const asyncOnCreate = dim.isAsync();
731
+
732
+ // 2. 切换到同步模式再查询一次,对比两种模式
733
+ dim.toSync();
734
+ const asyncAfterToSync = dim.isAsync();
735
+
736
+ // 3. 清理测试图元(查询类案例不留测试对象)
737
+ await eda.pcb_PrimitiveDimension.delete([dim.getState_PrimitiveId()]);
738
+
739
+ console.log('isAsync on create:', asyncOnCreate);
740
+ console.log('isAsync after toSync:', asyncAfterToSync);
741
+ ```
742
+
743
+ ### reset
744
+
745
+ # IPCB\_PrimitiveDimension.reset() method
746
+
747
+ > 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.
748
+
749
+ Reset the async primitive to the current canvas state
750
+
751
+ ## Signature
752
+
753
+ ```typescript
754
+ function reset(): Promise<IPCB_PrimitiveDimension>;
755
+ ```
756
+
757
+ ## Returns
758
+
759
+ Promise&lt;[IPCB\_PrimitiveDimension](./IPCB_PrimitiveDimension.md)<!-- -->&gt;
760
+
761
+ Dimension primitive object
762
+
763
+ ## Example
764
+
765
+ ```javascript
766
+ // 1. 生成本次运行专用的坐标,避免与之前保留的测试标注重合
767
+ const x = 2000 + Math.floor(Math.random() * 100000);
768
+
769
+ // 2. 创建一个 10mil 线宽的长度标注
770
+ const dim = await eda.pcb_PrimitiveDimension.create(
771
+ 'Length Dimension',
772
+ [x, 2000, x, 1800, x + 2000, 1800, x + 2000, 2000],
773
+ 3,
774
+ undefined,
775
+ 10
776
+ );
777
+
778
+ // 3. 切换异步模式,累计一处未提交的线宽修改(10 → 99)
779
+ const asyncDim = dim.toAsync();
780
+ asyncDim.setState_LineWidth(99);
781
+
782
+ // 4. 重置:丢弃未提交的修改,回到画布当前状态
783
+ await asyncDim.reset();
784
+
785
+ // 5. 从画布重新读取,线宽仍是 10(保留现场供观察)
786
+ const refetched = await eda.pcb_PrimitiveDimension.get(dim.getState_PrimitiveId());
787
+
788
+ console.log('lineWidth after reset:', refetched.getState_LineWidth());
789
+ ```
790
+
791
+ ### setstate_coordinateset
792
+
793
+ # IPCB\_PrimitiveDimension.setState\_CoordinateSet() method
794
+
795
+ > 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.
796
+
797
+ Set the property state: coordinate set
798
+
799
+ ## Signature
800
+
801
+ ```typescript
802
+ function setState_CoordinateSet(
803
+ coordinateSet: TPCB_PrimitiveDimensionCoordinateSet,
804
+ ): IPCB_PrimitiveDimension;
805
+ ```
806
+
807
+ ## Parameters
808
+
809
+ <table><thead><tr><th>
810
+
811
+ Parameter
812
+
813
+ </th><th>
814
+
815
+ Type
816
+
817
+ </th><th>
818
+
819
+ Description
820
+
821
+ </th></tr></thead>
822
+ <tbody><tr><td>
823
+
824
+ coordinateSet
825
+
826
+ </td><td>
827
+
828
+ [TPCB\_PrimitiveDimensionCoordinateSet](../types/TPCB_PrimitiveDimensionCoordinateSet.md)
829
+
830
+ </td><td>
831
+
832
+ Coordinate set
833
+
834
+ </td></tr>
835
+ </tbody></table>
836
+
837
+ ## Returns
838
+
839
+ [IPCB\_PrimitiveDimension](./IPCB_PrimitiveDimension.md)
840
+
841
+ Dimension primitive object
842
+
843
+ ## Example
844
+
845
+ ```javascript
846
+ // 1. 生成本次运行专用的坐标,避免与之前保留的测试标注重合
847
+ const x = 2000 + Math.floor(Math.random() * 100000);
848
+
849
+ // 2. 创建一个长度标注(测量 x 到 x+2000 的水平距离)
850
+ const dim = await eda.pcb_PrimitiveDimension.create(
851
+ 'Length Dimension',
852
+ [x, 2000, x, 1800, x + 2000, 1800, x + 2000, 2000],
853
+ 3
854
+ );
855
+ const before = dim.getState_CoordinateSet();
856
+
857
+ // 3. 切换异步模式并替换坐标集:测量度改为 3000
858
+ const asyncDim = dim.toAsync();
859
+ asyncDim.setState_CoordinateSet([x, 2000, x, 1800, x + 3000, 1800, x + 3000, 2000]);
860
+ await asyncDim.done();
861
+
862
+ // 4. 从画布重新读取,确认修改已生效(保留现场供观察)
863
+ const refetched = await eda.pcb_PrimitiveDimension.get(dim.getState_PrimitiveId());
864
+
865
+ console.log('coordinateSet:', JSON.stringify(before), '→', JSON.stringify(refetched.getState_CoordinateSet()));
866
+ ```
867
+
868
+ ### setstate_dimensiontype
869
+
870
+ # IPCB\_PrimitiveDimension.setState\_DimensionType() method
871
+
872
+ > 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.
873
+
874
+ Set the property state: dimension type
875
+
876
+ ## Signature
877
+
878
+ ```typescript
879
+ function setState_DimensionType(
880
+ dimensionType: EPCB_PrimitiveDimensionType,
881
+ ): IPCB_PrimitiveDimension;
882
+ ```
883
+
884
+ ## Parameters
885
+
886
+ <table><thead><tr><th>
887
+
888
+ Parameter
889
+
890
+ </th><th>
891
+
892
+ Type
893
+
894
+ </th><th>
895
+
896
+ Description
897
+
898
+ </th></tr></thead>
899
+ <tbody><tr><td>
900
+
901
+ dimensionType
902
+
903
+ </td><td>
904
+
905
+ [EPCB\_PrimitiveDimensionType](../enums/EPCB_PrimitiveDimensionType.md)
906
+
907
+ </td><td>
908
+
909
+ Dimension type
910
+
911
+ </td></tr>
912
+ </tbody></table>
913
+
914
+ ## Returns
915
+
916
+ [IPCB\_PrimitiveDimension](./IPCB_PrimitiveDimension.md)
917
+
918
+ Dimension primitive object
919
+
920
+ ## Example
921
+
922
+ ```javascript
923
+ // 1. 生成本次运行专用的坐标,避免与之前保留的测试标注重合
924
+ const x = 2000 + Math.floor(Math.random() * 100000);
925
+
926
+ // 2. 创建一个长度标注(8 元素坐标集)
927
+ const dim = await eda.pcb_PrimitiveDimension.create(
928
+ 'Length Dimension',
929
+ [x, 2000, x, 1800, x + 2000, 1800, x + 2000, 2000],
930
+ 3
931
+ );
932
+ const before = dim.getState_DimensionType();
933
+
934
+ // 3. 切换异步模式:换成半径标注,坐标集同步换成 6 元素格式(圆上端点、标注线尾、文字位置)
935
+ const asyncDim = dim.toAsync();
936
+ asyncDim.setState_DimensionType('Radius Dimension');
937
+ asyncDim.setState_CoordinateSet([x + 1500, 3500, x + 3500, 3500, x + 2500, 4200]);
938
+ await asyncDim.done();
939
+
940
+ // 4. 从画布重新读取,确认修改已生效(保留现场供观察)
941
+ const refetched = await eda.pcb_PrimitiveDimension.get(dim.getState_PrimitiveId());
942
+
943
+ console.log('dimensionType:', before, '→', refetched.getState_DimensionType());
944
+ ```
945
+
946
+ ### setstate_layer
947
+
948
+ # IPCB\_PrimitiveDimension.setState\_Layer() method
949
+
950
+ > 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.
951
+
952
+ Set the property state: Layer
953
+
954
+ ## Signature
955
+
956
+ ```typescript
957
+ function setState_Layer(layer: TPCB_LayersOfDimension): IPCB_PrimitiveDimension;
958
+ ```
959
+
960
+ ## Parameters
961
+
962
+ <table><thead><tr><th>
963
+
964
+ Parameter
965
+
966
+ </th><th>
967
+
968
+ Type
969
+
970
+ </th><th>
971
+
972
+ Description
973
+
974
+ </th></tr></thead>
975
+ <tbody><tr><td>
976
+
977
+ layer
978
+
979
+ </td><td>
980
+
981
+ [TPCB\_LayersOfDimension](../types/TPCB_LayersOfDimension.md)
982
+
983
+ </td><td>
984
+
985
+ Layer
986
+
987
+ </td></tr>
988
+ </tbody></table>
989
+
990
+ ## Returns
991
+
992
+ [IPCB\_PrimitiveDimension](./IPCB_PrimitiveDimension.md)
993
+
994
+ Dimension primitive object
995
+
996
+ ## Example
997
+
998
+ ```javascript
999
+ // 1. 生成本次运行专用的坐标,避免与之前保留的测试标注重合
1000
+ const x = 2000 + Math.floor(Math.random() * 100000);
1001
+
1002
+ // 2. 创建一个顶层丝印层(3)的长度标注
1003
+ const dim = await eda.pcb_PrimitiveDimension.create(
1004
+ 'Length Dimension',
1005
+ [x, 2000, x, 1800, x + 2000, 1800, x + 2000, 2000],
1006
+ 3
1007
+ );
1008
+ const before = dim.getState_Layer();
1009
+
1010
+ // 3. 切换异步模式并换到底层丝印层(4)
1011
+ const asyncDim = dim.toAsync();
1012
+ asyncDim.setState_Layer(4);
1013
+ await asyncDim.done();
1014
+
1015
+ // 4. 从画布重新读取,确认修改已生效(保留现场供观察)
1016
+ const refetched = await eda.pcb_PrimitiveDimension.get(dim.getState_PrimitiveId());
1017
+
1018
+ console.log('layer:', before, '→', refetched.getState_Layer());
1019
+ ```
1020
+
1021
+ ### setstate_linewidth
1022
+
1023
+ # IPCB\_PrimitiveDimension.setState\_LineWidth() method
1024
+
1025
+ > 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.
1026
+
1027
+ Set the property state: Line width
1028
+
1029
+ ## Signature
1030
+
1031
+ ```typescript
1032
+ function setState_LineWidth(lineWidth: number): IPCB_PrimitiveDimension;
1033
+ ```
1034
+
1035
+ ## Parameters
1036
+
1037
+ <table><thead><tr><th>
1038
+
1039
+ Parameter
1040
+
1041
+ </th><th>
1042
+
1043
+ Type
1044
+
1045
+ </th><th>
1046
+
1047
+ Description
1048
+
1049
+ </th></tr></thead>
1050
+ <tbody><tr><td>
1051
+
1052
+ lineWidth
1053
+
1054
+ </td><td>
1055
+
1056
+ number
1057
+
1058
+ </td><td>
1059
+
1060
+ Line width
1061
+
1062
+ </td></tr>
1063
+ </tbody></table>
1064
+
1065
+ ## Returns
1066
+
1067
+ [IPCB\_PrimitiveDimension](./IPCB_PrimitiveDimension.md)
1068
+
1069
+ Dimension primitive object
1070
+
1071
+ ## Example
1072
+
1073
+ ```javascript
1074
+ // 1. 生成本次运行专用的坐标,避免之前保留的测试标注重合
1075
+ const x = 2000 + Math.floor(Math.random() * 100000);
1076
+
1077
+ // 2. 创建一个 10mil 线宽的长度标注
1078
+ const dim = await eda.pcb_PrimitiveDimension.create(
1079
+ 'Length Dimension',
1080
+ [x, 2000, x, 1800, x + 2000, 1800, x + 2000, 2000],
1081
+ 3,
1082
+ undefined,
1083
+ 10
1084
+ );
1085
+ const before = dim.getState_LineWidth();
1086
+
1087
+ // 3. 切换异步模式,线宽加粗到 20mil
1088
+ const asyncDim = dim.toAsync();
1089
+ asyncDim.setState_LineWidth(20);
1090
+ await asyncDim.done();
1091
+
1092
+ // 4. 从画布重新读取,确认修改已生效(保留现场供观察)
1093
+ const refetched = await eda.pcb_PrimitiveDimension.get(dim.getState_PrimitiveId());
1094
+
1095
+ console.log('lineWidth:', before, '→', refetched.getState_LineWidth());
1096
+ ```
1097
+
1098
+ ### setstate_precision
1099
+
1100
+ # IPCB\_PrimitiveDimension.setState\_Precision() method
1101
+
1102
+ > 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.
1103
+
1104
+ Set the property state: precision
1105
+
1106
+ ## Signature
1107
+
1108
+ ```typescript
1109
+ function setState_Precision(precision: number): IPCB_PrimitiveDimension;
1110
+ ```
1111
+
1112
+ ## Parameters
1113
+
1114
+ <table><thead><tr><th>
1115
+
1116
+ Parameter
1117
+
1118
+ </th><th>
1119
+
1120
+ Type
1121
+
1122
+ </th><th>
1123
+
1124
+ Description
1125
+
1126
+ </th></tr></thead>
1127
+ <tbody><tr><td>
1128
+
1129
+ precision
1130
+
1131
+ </td><td>
1132
+
1133
+ number
1134
+
1135
+ </td><td>
1136
+
1137
+ Precision
1138
+
1139
+ </td></tr>
1140
+ </tbody></table>
1141
+
1142
+ ## Returns
1143
+
1144
+ [IPCB\_PrimitiveDimension](./IPCB_PrimitiveDimension.md)
1145
+
1146
+ Dimension primitive object
1147
+
1148
+ ## Example
1149
+
1150
+ ```javascript
1151
+ // 1. 生成本次运行专用的坐标,避免与之前保留的测试标注重合
1152
+ const x = 2000 + Math.floor(Math.random() * 100000);
1153
+
1154
+ // 2. 创建一个精度为 2 位的长度标注
1155
+ const dim = await eda.pcb_PrimitiveDimension.create(
1156
+ 'Length Dimension',
1157
+ [x, 2000, x, 1800, x + 2000, 1800, x + 2000, 2000],
1158
+ 3,
1159
+ undefined,
1160
+ undefined,
1161
+ 2
1162
+ );
1163
+ const before = dim.getState_Precision();
1164
+
1165
+ // 3. 切换异步模式,精度提高到 3 位
1166
+ const asyncDim = dim.toAsync();
1167
+ asyncDim.setState_Precision(3);
1168
+ await asyncDim.done();
1169
+
1170
+ // 4. 从画布重新读取,确认修改已生效(保留现场供观察)
1171
+ const refetched = await eda.pcb_PrimitiveDimension.get(dim.getState_PrimitiveId());
1172
+
1173
+ console.log('precision:', before, '→', refetched.getState_Precision());
1174
+ ```
1175
+
1176
+ ### setstate_primitivelock
1177
+
1178
+ # IPCB\_PrimitiveDimension.setState\_PrimitiveLock() method
1179
+
1180
+ > 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.
1181
+
1182
+ Set the property state: whether it is locked
1183
+
1184
+ ## Signature
1185
+
1186
+ ```typescript
1187
+ function setState_PrimitiveLock(primitiveLock: boolean): IPCB_PrimitiveDimension;
1188
+ ```
1189
+
1190
+ ## Parameters
1191
+
1192
+ <table><thead><tr><th>
1193
+
1194
+ Parameter
1195
+
1196
+ </th><th>
1197
+
1198
+ Type
1199
+
1200
+ </th><th>
1201
+
1202
+ Description
1203
+
1204
+ </th></tr></thead>
1205
+ <tbody><tr><td>
1206
+
1207
+ primitiveLock
1208
+
1209
+ </td><td>
1210
+
1211
+ boolean
1212
+
1213
+ </td><td>
1214
+
1215
+ Whether it is locked
1216
+
1217
+ </td></tr>
1218
+ </tbody></table>
1219
+
1220
+ ## Returns
1221
+
1222
+ [IPCB\_PrimitiveDimension](./IPCB_PrimitiveDimension.md)
1223
+
1224
+ Dimension primitive object
1225
+
1226
+ ## Example
1227
+
1228
+ ```javascript
1229
+ // 1. 生成本次运行专用的坐标,避免与之前保留的测试标注重合
1230
+ const x = 2000 + Math.floor(Math.random() * 100000);
1231
+
1232
+ // 2. 创建一个未锁定的长度标注
1233
+ const dim = await eda.pcb_PrimitiveDimension.create(
1234
+ 'Length Dimension',
1235
+ [x, 2000, x, 1800, x + 2000, 1800, x + 2000, 2000],
1236
+ 3
1237
+ );
1238
+ const before = dim.getState_PrimitiveLock();
1239
+
1240
+ // 3. 切换异步模式并锁定标注
1241
+ const asyncDim = dim.toAsync();
1242
+ asyncDim.setState_PrimitiveLock(true);
1243
+ await asyncDim.done();
1244
+
1245
+ // 4. 从画布重新读取,确认修改已生效(保留现场供观察)
1246
+ const refetched = await eda.pcb_PrimitiveDimension.get(dim.getState_PrimitiveId());
1247
+
1248
+ console.log('primitiveLock:', before, '→', refetched.getState_PrimitiveLock());
1249
+ ```
1250
+
1251
+ ### setstate_unit
1252
+
1253
+ # IPCB\_PrimitiveDimension.setState\_Unit() method
1254
+
1255
+ > 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.
1256
+
1257
+ Set the property state: unit
1258
+
1259
+ ## Signature
1260
+
1261
+ ```typescript
1262
+ function setState_Unit(
1263
+ unit: ESYS_Unit.MILLIMETER | ESYS_Unit.CENTIMETER | ESYS_Unit.INCH | ESYS_Unit.MIL,
1264
+ ): IPCB_PrimitiveDimension;
1265
+ ```
1266
+
1267
+ ## Parameters
1268
+
1269
+ <table><thead><tr><th>
1270
+
1271
+ Parameter
1272
+
1273
+ </th><th>
1274
+
1275
+ Type
1276
+
1277
+ </th><th>
1278
+
1279
+ Description
1280
+
1281
+ </th></tr></thead>
1282
+ <tbody><tr><td>
1283
+
1284
+ unit
1285
+
1286
+ </td><td>
1287
+
1288
+ [ESYS\_Unit.MILLIMETER](../enums/ESYS_Unit.md) \| [ESYS\_Unit.CENTIMETER](../enums/ESYS_Unit.md) \| [ESYS\_Unit.INCH](../enums/ESYS_Unit.md) \| [ESYS\_Unit.MIL](../enums/ESYS_Unit.md)
1289
+
1290
+ </td><td>
1291
+
1292
+ Unit
1293
+
1294
+ </td></tr>
1295
+ </tbody></table>
1296
+
1297
+ ## Returns
1298
+
1299
+ [IPCB\_PrimitiveDimension](./IPCB_PrimitiveDimension.md)
1300
+
1301
+ Dimension primitive object
1302
+
1303
+ ## Example
1304
+
1305
+ ```javascript
1306
+ // 1. 生成本次运行专用的坐标,避免与之前保留的测试标注重合
1307
+ const x = 2000 + Math.floor(Math.random() * 100000);
1308
+
1309
+ // 2. 创建一个默认毫米单位的长度标注
1310
+ const dim = await eda.pcb_PrimitiveDimension.create(
1311
+ 'Length Dimension',
1312
+ [x, 2000, x, 1800, x + 2000, 1800, x + 2000, 2000],
1313
+ 3
1314
+ );
1315
+ const before = dim.getState_Unit();
1316
+
1317
+ // 3. 切换异步模式,单位换成密尔
1318
+ const asyncDim = dim.toAsync();
1319
+ asyncDim.setState_Unit('mil');
1320
+ await asyncDim.done();
1321
+
1322
+ // 4. 从画布重新读取,确认修改已生效(保留现场供观察)
1323
+ const refetched = await eda.pcb_PrimitiveDimension.get(dim.getState_PrimitiveId());
1324
+
1325
+ console.log('unit:', before, '→', refetched.getState_Unit());
1326
+ ```
1327
+
1328
+ ### toasync
1329
+
1330
+ # IPCB\_PrimitiveDimension.toAsync() method
1331
+
1332
+ Convert Primitive to Async primitive
1333
+
1334
+ ## Signature
1335
+
1336
+ ```typescript
1337
+ function toAsync(): IPCB_PrimitiveDimension;
1338
+ ```
1339
+
1340
+ ## Returns
1341
+
1342
+ [IPCB\_PrimitiveDimension](./IPCB_PrimitiveDimension.md)
1343
+
1344
+ Dimension primitive object
1345
+
1346
+ ## Example
1347
+
1348
+ ```javascript
1349
+ // 1. 生成本次运行专用的坐标,避免与之前保留的测试标注重合
1350
+ const x = 2000 + Math.floor(Math.random() * 100000);
1351
+
1352
+ // 2. 创建一个长度标注(创建后处于同步模式)
1353
+ const dim = await eda.pcb_PrimitiveDimension.create(
1354
+ 'Length Dimension',
1355
+ [x, 2000, x, 1800, x + 2000, 1800, x + 2000, 2000],
1356
+ 3,
1357
+ undefined,
1358
+ 10
1359
+ );
1360
+
1361
+ // 3. 转换为异步图元
1362
+ const asyncDim = dim.toAsync();
1363
+
1364
+ // 4. 异步模式下累计修改并提交
1365
+ asyncDim.setState_LineWidth(20);
1366
+ await asyncDim.done();
1367
+
1368
+ // 5. 从画布重新读取,确认提交生效(保留现场供观察)
1369
+ const refetched = await eda.pcb_PrimitiveDimension.get(dim.getState_PrimitiveId());
1370
+
1371
+ console.log('isAsync after toAsync:', dim.isAsync());
1372
+ console.log('lineWidth:', 10, '→', refetched.getState_LineWidth());
1373
+ ```
1374
+
1375
+ ### tosync
1376
+
1377
+ # IPCB\_PrimitiveDimension.toSync() method
1378
+
1379
+ Convert Primitive to Sync primitive
1380
+
1381
+ ## Signature
1382
+
1383
+ ```typescript
1384
+ function toSync(): IPCB_PrimitiveDimension;
1385
+ ```
1386
+
1387
+ ## Returns
1388
+
1389
+ [IPCB\_PrimitiveDimension](./IPCB_PrimitiveDimension.md)
1390
+
1391
+ Dimension primitive object
1392
+
1393
+ ## Example
1394
+
1395
+ ```javascript
1396
+ // 1. 生成本次运行专用的坐标,避免与之前保留的测试标注重合
1397
+ const x = 2000 + Math.floor(Math.random() * 100000);
1398
+
1399
+ // 2. 创建一个 10mil 线宽的长度标注
1400
+ const dim = await eda.pcb_PrimitiveDimension.create(
1401
+ 'Length Dimension',
1402
+ [x, 2000, x, 1800, x + 2000, 1800, x + 2000, 2000],
1403
+ 3,
1404
+ undefined,
1405
+ 10
1406
+ );
1407
+
1408
+ // 3. 转换为同步图元
1409
+ const syncDim = dim.toSync();
1410
+
1411
+ // 4. 同步模式下修改线宽,立即生效(无需 done())
1412
+ syncDim.setState_LineWidth(20);
1413
+
1414
+ // 5. 从画布重新读取,确认修改已生效(保留现场供观察)
1415
+ const refetched = await eda.pcb_PrimitiveDimension.get(dim.getState_PrimitiveId());
1416
+
1417
+ console.log('isSync after toSync:', !syncDim.isAsync());
1418
+ console.log('lineWidth:', 10, '→', refetched.getState_LineWidth());
1419
+ ```