@windypro-rourou/dsh-eda 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/capabilities.js +3 -2
- package/lib/client.js +33 -0
- package/lib/index.js +89 -2
- package/package.json +10 -1
- package/skill/INDEX.md +10 -8
- package/skill/README.md +125 -0
- package/skill/README.zh-Hans.md +125 -0
- package/skill/SKILL.md +746 -746
- package/skill/format/index.md +152 -152
- package/skill/format/pcb/3d.md +166 -166
- package/skill/format/pcb/attr.md +63 -63
- package/skill/format/pcb/common.md +306 -306
- package/skill/format/pcb/component.md +132 -132
- package/skill/format/pcb/dimension.md +58 -58
- package/skill/format/pcb/index.md +17 -17
- package/skill/format/pcb/obj.md +43 -43
- package/skill/format/pcb/pad_via.md +151 -151
- package/skill/format/pcb/panel.md +64 -64
- package/skill/format/pcb/partition.md +43 -43
- package/skill/format/pcb/primitive.md +196 -196
- package/skill/format/pcb/rule.md +71 -71
- package/skill/format/pcb/shape.md +441 -441
- package/skill/format/pcb/text.md +62 -62
- package/skill/format/project/blob.md +30 -30
- package/skill/format/project/common.md +42 -42
- package/skill/format/project/group.md +62 -62
- package/skill/format/project/index.md +12 -12
- package/skill/format/project/instance.md +32 -32
- package/skill/format/project/meta.md +189 -189
- package/skill/format/project/variant.md +30 -30
- package/skill/format/schematic/attr.md +41 -41
- package/skill/format/schematic/common.md +47 -47
- package/skill/format/schematic/component.md +91 -91
- package/skill/format/schematic/index.md +14 -14
- package/skill/format/schematic/obj.md +41 -41
- package/skill/format/schematic/pin.md +59 -59
- package/skill/format/schematic/shape.md +231 -231
- package/skill/format/schematic/structure.md +53 -53
- package/skill/format/schematic/table.md +109 -109
- package/skill/format/schematic/text.md +47 -47
- package/skill/format/schematic/wire.md +132 -132
- package/skill/guide/ancillary-projects/easyeda-api-sdk.md +1 -0
- package/skill/guide/ancillary-projects/pro-api-types.md +5 -5
- package/skill/guide/ancillary-projects.md +10 -10
- package/skill/guide/cli.md +1510 -0
- package/skill/guide/error-handling.md +38 -38
- package/skill/guide/extension-json.md +135 -135
- package/skill/guide/extensions-marketplace.md +61 -61
- package/skill/guide/how-to-start.md +316 -301
- package/skill/guide/i18n.md +57 -57
- package/skill/guide/index.md +7 -7
- package/skill/guide/inline-frame.md +20 -20
- package/skill/guide/invoke-apis.md +81 -81
- package/skill/guide/stability.md +37 -37
- package/skill/references/_index.md +471 -398
- package/skill/references/_quick-reference.md +3103 -3028
- package/skill/references/classes/DMT_Board.md +537 -533
- package/skill/references/classes/DMT_EditorControl.md +1736 -1736
- package/skill/references/classes/DMT_Event.md +356 -356
- package/skill/references/classes/DMT_Folder.md +775 -775
- package/skill/references/classes/DMT_Panel.md +531 -531
- package/skill/references/classes/DMT_Pcb.md +579 -575
- package/skill/references/classes/DMT_Project.md +734 -573
- package/skill/references/classes/DMT_Schematic.md +1482 -1477
- package/skill/references/classes/DMT_SelectControl.md +96 -96
- package/skill/references/classes/DMT_Team.md +172 -172
- package/skill/references/classes/DMT_Workspace.md +198 -198
- package/skill/references/classes/EDA.md +1001 -961
- package/skill/references/classes/IPCB_ComplexPolygon.md +299 -299
- package/skill/references/classes/IPCB_Polygon.md +175 -175
- package/skill/references/classes/IPCB_PrimitiveArc.md +1901 -1901
- package/skill/references/classes/IPCB_PrimitiveAttribute.md +2993 -2993
- package/skill/references/classes/IPCB_PrimitiveComponent.md +2624 -2627
- package/skill/references/classes/IPCB_PrimitiveComponentPad.md +410 -410
- package/skill/references/classes/IPCB_PrimitiveDimension.md +1419 -1419
- package/skill/references/classes/IPCB_PrimitiveFill.md +1325 -1325
- package/skill/references/classes/IPCB_PrimitiveImage.md +1461 -1461
- package/skill/references/classes/IPCB_PrimitiveLine.md +1639 -1639
- package/skill/references/classes/IPCB_PrimitiveObject.md +1700 -1700
- package/skill/references/classes/IPCB_PrimitivePad.md +3155 -3155
- package/skill/references/classes/IPCB_PrimitivePolyline.md +1193 -1193
- package/skill/references/classes/IPCB_PrimitivePour.md +1858 -1858
- package/skill/references/classes/IPCB_PrimitivePoured.md +556 -556
- package/skill/references/classes/IPCB_PrimitiveRegion.md +1332 -1332
- package/skill/references/classes/IPCB_PrimitiveString.md +2315 -2315
- package/skill/references/classes/IPCB_PrimitiveVia.md +1588 -1588
- package/skill/references/classes/ISCH_PrimitiveArc.md +1676 -1676
- package/skill/references/classes/ISCH_PrimitiveAttribute.md +2541 -2541
- package/skill/references/classes/ISCH_PrimitiveBus.md +973 -973
- package/skill/references/classes/ISCH_PrimitiveCbbSymbolComponent.md +260 -260
- package/skill/references/classes/ISCH_PrimitiveCircle.md +1392 -1392
- package/skill/references/classes/ISCH_PrimitiveComponent.md +2910 -2913
- package/skill/references/classes/ISCH_PrimitiveComponentPin.md +155 -155
- package/skill/references/classes/ISCH_PrimitiveObject.md +960 -960
- package/skill/references/classes/ISCH_PrimitivePin.md +2402 -2402
- package/skill/references/classes/ISCH_PrimitivePolygon.md +1028 -1028
- package/skill/references/classes/ISCH_PrimitiveRectangle.md +1777 -1777
- package/skill/references/classes/ISCH_PrimitiveText.md +1771 -1771
- package/skill/references/classes/ISCH_PrimitiveWire.md +973 -973
- package/skill/references/classes/LIB_3DModel.md +782 -780
- package/skill/references/classes/LIB_Cbb.md +957 -957
- package/skill/references/classes/LIB_Classification.md +969 -965
- package/skill/references/classes/LIB_Device.md +1222 -1221
- package/skill/references/classes/LIB_Footprint.md +1298 -1153
- package/skill/references/classes/LIB_LibrariesList.md +361 -329
- package/skill/references/classes/LIB_PanelLibrary.md +855 -855
- package/skill/references/classes/LIB_SelectControl.md +89 -89
- package/skill/references/classes/LIB_SimulationModel.md +807 -821
- package/skill/references/classes/LIB_Symbol.md +1341 -1195
- package/skill/references/classes/PCB_Document.md +1770 -1754
- package/skill/references/classes/PCB_Drc.md +3379 -3375
- package/skill/references/classes/PCB_Event.md +1166 -1081
- package/skill/references/classes/PCB_ImageTool.md +363 -0
- package/skill/references/classes/PCB_Layer.md +1915 -1911
- package/skill/references/classes/PCB_ManufactureData.md +2968 -2968
- package/skill/references/classes/PCB_MathPolygon.md +916 -785
- package/skill/references/classes/PCB_Net.md +1128 -1128
- package/skill/references/classes/PCB_Primitive.md +217 -217
- package/skill/references/classes/PCB_PrimitiveArc.md +820 -894
- package/skill/references/classes/PCB_PrimitiveAttribute.md +635 -717
- package/skill/references/classes/PCB_PrimitiveComponent.md +1050 -1050
- package/skill/references/classes/PCB_PrimitiveDimension.md +789 -833
- package/skill/references/classes/PCB_PrimitiveFill.md +783 -861
- package/skill/references/classes/PCB_PrimitiveImage.md +803 -875
- package/skill/references/classes/PCB_PrimitiveLine.md +787 -858
- package/skill/references/classes/PCB_PrimitiveObject.md +796 -800
- package/skill/references/classes/PCB_PrimitivePad.md +947 -944
- package/skill/references/classes/PCB_PrimitivePolyline.md +744 -819
- package/skill/references/classes/PCB_PrimitivePour.md +808 -845
- package/skill/references/classes/PCB_PrimitivePoured.md +363 -363
- package/skill/references/classes/PCB_PrimitiveRegion.md +765 -799
- package/skill/references/classes/PCB_PrimitiveString.md +828 -910
- package/skill/references/classes/PCB_PrimitiveVia.md +761 -765
- package/skill/references/classes/PCB_RayTracerEngine.md +603 -263
- package/skill/references/classes/PCB_SelectControl.md +495 -495
- package/skill/references/classes/PCB_Tool.md +9 -0
- package/skill/references/classes/PNL_Document.md +83 -83
- package/skill/references/classes/SCH_Document.md +797 -809
- package/skill/references/classes/SCH_Drc.md +246 -242
- package/skill/references/classes/SCH_Event.md +583 -583
- package/skill/references/classes/SCH_ManufactureData.md +1209 -1205
- package/skill/references/classes/SCH_Net.md +200 -200
- package/skill/references/classes/SCH_Netlist.md +191 -191
- package/skill/references/classes/SCH_Primitive.md +337 -337
- package/skill/references/classes/SCH_PrimitiveArc.md +686 -692
- package/skill/references/classes/SCH_PrimitiveAttribute.md +579 -590
- package/skill/references/classes/SCH_PrimitiveBus.md +618 -624
- package/skill/references/classes/SCH_PrimitiveCircle.md +667 -683
- package/skill/references/classes/SCH_PrimitiveComponent.md +2256 -2240
- package/skill/references/classes/SCH_PrimitiveObject.md +666 -666
- package/skill/references/classes/SCH_PrimitivePin.md +737 -754
- package/skill/references/classes/SCH_PrimitivePolygon.md +621 -627
- package/skill/references/classes/SCH_PrimitiveRectangle.md +715 -731
- package/skill/references/classes/SCH_PrimitiveText.md +736 -746
- package/skill/references/classes/SCH_PrimitiveWire.md +701 -703
- package/skill/references/classes/SCH_SelectControl.md +520 -520
- package/skill/references/classes/SCH_SimulationEngine.md +133 -133
- package/skill/references/classes/SCH_Utils.md +121 -121
- package/skill/references/classes/SYS_ClientUrl.md +173 -173
- package/skill/references/classes/SYS_Dialog.md +825 -825
- package/skill/references/classes/SYS_Environment.md +640 -502
- package/skill/references/classes/SYS_ExternalApi.md +246 -0
- package/skill/references/classes/SYS_FileManager.md +1664 -1686
- package/skill/references/classes/SYS_FileSystem.md +1366 -1171
- package/skill/references/classes/SYS_FontManager.md +224 -224
- package/skill/references/classes/SYS_FormatConversion.md +349 -349
- package/skill/references/classes/SYS_HeaderMenu.md +480 -479
- package/skill/references/classes/SYS_Help.md +141 -0
- package/skill/references/classes/SYS_I18n.md +861 -861
- package/skill/references/classes/SYS_IFrame.md +541 -535
- package/skill/references/classes/SYS_LoadingAndProgressBar.md +246 -246
- package/skill/references/classes/SYS_Log.md +422 -424
- package/skill/references/classes/SYS_Math.md +1565 -1565
- package/skill/references/classes/SYS_Message.md +363 -363
- package/skill/references/classes/SYS_MessageBox.md +285 -285
- package/skill/references/classes/SYS_MessageBus.md +1618 -1618
- package/skill/references/classes/SYS_PanelControl.md +696 -696
- package/skill/references/classes/SYS_RightClickMenu.md +175 -175
- package/skill/references/classes/SYS_Setting.md +134 -85
- package/skill/references/classes/SYS_ShortcutKey.md +623 -623
- package/skill/references/classes/SYS_Storage.md +484 -484
- package/skill/references/classes/SYS_Timer.md +447 -447
- package/skill/references/classes/SYS_ToastMessage.md +194 -194
- package/skill/references/classes/SYS_Tool.md +317 -241
- package/skill/references/classes/SYS_Unit.md +594 -594
- package/skill/references/classes/SYS_WebSocket.md +401 -401
- package/skill/references/classes/SYS_Window.md +849 -850
- package/skill/references/enums/EDMT_EditorDocumentType.md +324 -278
- package/skill/references/enums/EDMT_EditorSplitScreenDirection.md +51 -47
- package/skill/references/enums/EDMT_EditorTabEventType.md +68 -62
- package/skill/references/enums/EDMT_IndicatorMarkerType.md +90 -80
- package/skill/references/enums/EDMT_ItemType.md +181 -157
- package/skill/references/enums/EDMT_ProjectCollaborationMode.md +51 -47
- package/skill/references/enums/EDMT_ProjectFileFormat.md +60 -0
- package/skill/references/enums/EDMT_ProjectReadyState.md +82 -0
- package/skill/references/enums/ELIB_DeviceJlcLibraryCategory.md +51 -47
- package/skill/references/enums/ELIB_LibraryType.md +129 -113
- package/skill/references/enums/ELIB_PreviewType.md +77 -69
- package/skill/references/enums/ELIB_SimulationModelType.md +51 -47
- package/skill/references/enums/ELIB_SymbolType.md +142 -124
- package/skill/references/enums/EPCB_AutoRoutingCornerStyle.md +51 -47
- package/skill/references/enums/EPCB_AutoRoutingExistingPrimitiveMode.md +51 -47
- package/skill/references/enums/EPCB_AutoRoutingOptimization.md +51 -47
- package/skill/references/enums/EPCB_DocumentCanvasUpdateCalculationActiveStatus.md +51 -47
- package/skill/references/enums/EPCB_DocumentRatlineCalculatingActiveStatus.md +55 -51
- package/skill/references/enums/EPCB_InactiveLayerDisplayMode.md +64 -58
- package/skill/references/enums/EPCB_LayerColorConfiguration.md +90 -80
- package/skill/references/enums/EPCB_LayerId.md +1169 -881
- package/skill/references/enums/EPCB_LayerStatus.md +64 -58
- package/skill/references/enums/EPCB_LayerType.md +129 -113
- package/skill/references/enums/EPCB_MouseEventType.md +64 -58
- package/skill/references/enums/EPCB_NetEventType.md +64 -58
- package/skill/references/enums/EPCB_PcbPlateType.md +51 -47
- package/skill/references/enums/EPCB_PdfOutputMethod.md +64 -58
- package/skill/references/enums/EPCB_PrimitiveArcInteractiveMode.md +51 -47
- package/skill/references/enums/EPCB_PrimitiveDimensionType.md +64 -58
- package/skill/references/enums/EPCB_PrimitiveEventType.md +64 -58
- package/skill/references/enums/EPCB_PrimitiveFillMode.md +68 -62
- package/skill/references/enums/EPCB_PrimitivePadHeatWeldingConnectionMethod.md +64 -58
- package/skill/references/enums/EPCB_PrimitivePadHoleType.md +64 -58
- package/skill/references/enums/EPCB_PrimitivePadShapeType.md +90 -80
- package/skill/references/enums/EPCB_PrimitivePadType.md +64 -58
- package/skill/references/enums/EPCB_PrimitivePourFillMethod.md +64 -58
- package/skill/references/enums/EPCB_PrimitiveRegionRuleType.md +107 -95
- package/skill/references/enums/EPCB_PrimitiveStringAlignMode.md +142 -124
- package/skill/references/enums/EPCB_PrimitiveType.md +233 -201
- package/skill/references/enums/EPCB_PrimitiveViaType.md +64 -58
- package/skill/references/enums/ESCH_DynamicSimulationEnginePullEventType.md +116 -102
- package/skill/references/enums/ESCH_DynamicSimulationEnginePushEventType.md +90 -80
- package/skill/references/enums/ESCH_ExportDocumentFileType.md +64 -58
- package/skill/references/enums/ESCH_MouseEventType.md +51 -47
- package/skill/references/enums/ESCH_PrimitiveComponentType.md +142 -124
- package/skill/references/enums/ESCH_PrimitiveEventType.md +77 -69
- package/skill/references/enums/ESCH_PrimitiveFillStyle.md +129 -113
- package/skill/references/enums/ESCH_PrimitiveLineType.md +77 -69
- package/skill/references/enums/ESCH_PrimitivePinShape.md +77 -69
- package/skill/references/enums/ESCH_PrimitivePinType.md +168 -146
- package/skill/references/enums/ESCH_PrimitiveTextAlignMode.md +142 -124
- package/skill/references/enums/ESCH_PrimitiveType.md +207 -179
- package/skill/references/enums/ESCH_SimulationNetlistType.md +38 -36
- package/skill/references/enums/ESCH_SpiceSimulationEnginePullEventType.md +51 -47
- package/skill/references/enums/ESCH_SpiceSimulationEnginePushEventType.md +77 -69
- package/skill/references/enums/ESYS_BottomPanelTab.md +94 -80
- package/skill/references/enums/ESYS_HeaderMenuEnvironment.md +181 -157
- package/skill/references/enums/ESYS_ImportProjectBoardOutlineSource.md +55 -51
- package/skill/references/enums/ESYS_ImportProjectImportOption.md +64 -58
- package/skill/references/enums/ESYS_ImportProjectSchematicObjectStyle.md +51 -47
- package/skill/references/enums/ESYS_ImportProjectViaSolderMaskExpansion.md +55 -51
- package/skill/references/enums/ESYS_JobState.md +95 -0
- package/skill/references/enums/ESYS_LeftPanelTab.md +94 -80
- package/skill/references/enums/ESYS_LogType.md +77 -102
- package/skill/references/enums/ESYS_NetlistType.md +129 -113
- package/skill/references/enums/ESYS_PanelPosition.md +69 -0
- package/skill/references/enums/ESYS_PanelTab.md +368 -0
- package/skill/references/enums/ESYS_RightPanelTab.md +237 -201
- package/skill/references/enums/ESYS_ShortcutKeyEffectiveEditorRange.md +220 -190
- package/skill/references/enums/ESYS_ShortcutKeyEffectiveEditorScene.md +103 -91
- package/skill/references/enums/ESYS_StartPageQuickStartItem.md +237 -205
- package/skill/references/enums/ESYS_Theme.md +51 -47
- package/skill/references/enums/ESYS_ToastMessageType.md +90 -80
- package/skill/references/enums/ESYS_Unit.md +116 -102
- package/skill/references/enums/ESYS_WindowEventType.md +64 -47
- package/skill/references/enums/ESYS_WindowOpenTarget.md +51 -47
- package/skill/references/enums/NetportDeviceName.md +146 -146
- package/skill/references/enums/SchToolBarDeviceName.md +278 -278
- package/skill/references/interfaces/BoardProps.md +169 -169
- package/skill/references/interfaces/BorderConfig.md +109 -0
- package/skill/references/interfaces/ButtonProps.md +196 -169
- package/skill/references/interfaces/CellClickInfo.md +142 -0
- package/skill/references/interfaces/CellCoord.md +88 -0
- package/skill/references/interfaces/CheckBoxProps.md +223 -196
- package/skill/references/interfaces/CheckChangeDetail.md +88 -0
- package/skill/references/interfaces/CheckboxEditConfig.md +159 -0
- package/skill/references/interfaces/ClipboardCellData.md +142 -0
- package/skill/references/interfaces/ClipboardConfig.md +115 -0
- package/skill/references/interfaces/ColorPickerProps.md +169 -0
- package/skill/references/interfaces/ColumnDef.md +605 -0
- package/skill/references/interfaces/ColumnEditTrigger.md +57 -0
- package/skill/references/interfaces/ColumnGroupDef.md +192 -0
- package/skill/references/interfaces/ColumnResizeConfig.md +142 -0
- package/skill/references/interfaces/ComponentPropsMap.md +517 -448
- package/skill/references/interfaces/CustomHeaderConfig.md +169 -0
- package/skill/references/interfaces/DialogProps.md +385 -385
- package/skill/references/interfaces/DragSortConfig.md +115 -0
- package/skill/references/interfaces/EditingConfig.md +196 -0
- package/skill/references/interfaces/FilteringConfig.md +250 -0
- package/skill/references/interfaces/FixedColumnConfig.md +88 -0
- package/skill/references/interfaces/FlexItemProps.md +116 -116
- package/skill/references/interfaces/FlexProps.md +224 -224
- package/skill/references/interfaces/GridItemProps.md +143 -143
- package/skill/references/interfaces/GridProps.md +143 -143
- package/skill/references/interfaces/IDMT_BoardItem.md +171 -171
- package/skill/references/interfaces/IDMT_BriefProjectItem.md +171 -171
- package/skill/references/interfaces/IDMT_EditorDocumentItem.md +169 -169
- package/skill/references/interfaces/IDMT_EditorSplitScreenItem.md +173 -173
- package/skill/references/interfaces/IDMT_EditorTabItem.md +169 -169
- package/skill/references/interfaces/IDMT_FolderItem.md +225 -225
- package/skill/references/interfaces/IDMT_IndicatorMarkerShape.md +393 -393
- package/skill/references/interfaces/IDMT_PanelItem.md +144 -144
- package/skill/references/interfaces/IDMT_PcbItem.md +171 -171
- package/skill/references/interfaces/IDMT_ProjectItem.md +143 -143
- package/skill/references/interfaces/IDMT_SchematicItem.md +225 -225
- package/skill/references/interfaces/IDMT_SchematicPageItem.md +198 -198
- package/skill/references/interfaces/IDMT_TeamItem.md +144 -144
- package/skill/references/interfaces/IDMT_WorkspaceItem.md +117 -117
- package/skill/references/interfaces/IDesignPortal.md +103 -103
- package/skill/references/interfaces/ILIB_3DModelItem.md +198 -198
- package/skill/references/interfaces/ILIB_3DModelSearchItem.md +277 -277
- package/skill/references/interfaces/ILIB_CbbItem.md +225 -225
- package/skill/references/interfaces/ILIB_CbbSearchItem.md +277 -277
- package/skill/references/interfaces/ILIB_ClassificationIndex.md +150 -150
- package/skill/references/interfaces/ILIB_ClassificationNode.md +98 -0
- package/skill/references/interfaces/ILIB_DeviceAssociationItem.md +210 -210
- package/skill/references/interfaces/ILIB_DeviceExtendPropertyItem.md +304 -304
- package/skill/references/interfaces/ILIB_DeviceItem.md +279 -279
- package/skill/references/interfaces/ILIB_DevicePropertiesForSearch.md +250 -250
- package/skill/references/interfaces/ILIB_DeviceSearchItem.md +521 -521
- package/skill/references/interfaces/ILIB_ExtendLibrary3DModelFunctions.md +64 -64
- package/skill/references/interfaces/ILIB_ExtendLibraryCbbFunctions.md +93 -99
- package/skill/references/interfaces/ILIB_ExtendLibraryClassificationIndex.md +150 -150
- package/skill/references/interfaces/ILIB_ExtendLibraryDeviceFunctions.md +143 -157
- package/skill/references/interfaces/ILIB_ExtendLibraryFootprintFunctions.md +63 -63
- package/skill/references/interfaces/ILIB_ExtendLibraryFunctions.md +123 -123
- package/skill/references/interfaces/ILIB_ExtendLibraryItem.md +97 -97
- package/skill/references/interfaces/ILIB_ExtendLibraryItemIndex.md +98 -98
- package/skill/references/interfaces/ILIB_ExtendLibrarySearchProperty.md +115 -115
- package/skill/references/interfaces/ILIB_ExtendLibrarySearchResult.md +169 -169
- package/skill/references/interfaces/ILIB_ExtendLibrarySearchResultDataLine.md +234 -234
- package/skill/references/interfaces/ILIB_ExtendLibrarySymbolFunctions.md +91 -105
- package/skill/references/interfaces/ILIB_ExtendLibraryUserIndex.md +96 -96
- package/skill/references/interfaces/ILIB_FootprintItem.md +256 -198
- package/skill/references/interfaces/ILIB_FootprintPropertiesForSearch.md +61 -61
- package/skill/references/interfaces/ILIB_FootprintSearchItem.md +277 -277
- package/skill/references/interfaces/ILIB_LibraryInfo.md +92 -92
- package/skill/references/interfaces/ILIB_LibraryItem.md +115 -115
- package/skill/references/interfaces/ILIB_PanelLibraryItem.md +198 -198
- package/skill/references/interfaces/ILIB_PanelLibrarySearchItem.md +277 -277
- package/skill/references/interfaces/ILIB_RegisterExtendLibraryProps.md +71 -0
- package/skill/references/interfaces/ILIB_SimulationModelItem.md +306 -306
- package/skill/references/interfaces/ILIB_SimulationModelSearchItem.md +304 -304
- package/skill/references/interfaces/ILIB_SymbolItem.md +306 -279
- package/skill/references/interfaces/ILIB_SymbolPropertiesForSearch.md +61 -61
- package/skill/references/interfaces/ILIB_SymbolSearchItem.md +304 -304
- package/skill/references/interfaces/IPCB_AutoLayoutResult.md +169 -169
- package/skill/references/interfaces/IPCB_AutoRoutingProps.md +220 -220
- package/skill/references/interfaces/IPCB_AutoRoutingResult.md +169 -169
- package/skill/references/interfaces/IPCB_BomPropertiesTableColumns.md +169 -169
- package/skill/references/interfaces/IPCB_DifferentialPairItem.md +115 -115
- package/skill/references/interfaces/IPCB_DiscretizeOptions.md +65 -65
- package/skill/references/interfaces/IPCB_DiscretizedPoint.md +88 -88
- package/skill/references/interfaces/IPCB_EqualLengthNetGroupItem.md +115 -115
- package/skill/references/interfaces/IPCB_LayerItem.md +277 -277
- package/skill/references/interfaces/IPCB_NetClassItem.md +115 -115
- package/skill/references/interfaces/IPCB_NetInfo.md +115 -115
- package/skill/references/interfaces/IPCB_PadPairGroupItem.md +88 -88
- package/skill/references/interfaces/IPCB_PadPairMinWireLengthItem.md +88 -88
- package/skill/references/interfaces/IPCB_PhysicalStackingConfiguration.md +115 -115
- package/skill/references/interfaces/IPCB_Primitive.md +218 -218
- package/skill/references/interfaces/IPCB_PrimitiveAPI.md +174 -175
- package/skill/references/interfaces/IPCB_PrimitivePadHeatWelding.md +151 -151
- package/skill/references/interfaces/IPCB_PrimitivePouredPourFill.md +142 -142
- package/skill/references/interfaces/IPCB_PrimitiveSolderMaskAndPasteMaskExpansion.md +154 -154
- package/skill/references/interfaces/IPCB_RayTracerBackgroundConfig.md +223 -0
- package/skill/references/interfaces/IPCB_RayTracerLightConfig.md +412 -0
- package/skill/references/interfaces/IPCB_RayTracerMaterialConfig.md +547 -0
- package/skill/references/interfaces/IPCB_RayTracerPcbMaterialConfig.md +196 -0
- package/skill/references/interfaces/IPCB_RayTracerRenderConfigurations.md +200 -0
- package/skill/references/interfaces/IPCB_RayTracerRendererConfig.md +196 -0
- package/skill/references/interfaces/IPCB_RayTracerSceneElement.md +115 -0
- package/skill/references/interfaces/IPCB_RayTracerSceneElementTransform.md +123 -0
- package/skill/references/interfaces/IPCB_RayTracerTexture.md +88 -0
- package/skill/references/interfaces/IPCB_SubstratePhysicalProperties.md +88 -88
- package/skill/references/interfaces/IRawNet.md +103 -103
- package/skill/references/interfaces/IRawPureSchematic.md +80 -80
- package/skill/references/interfaces/IRawSchematic.md +103 -103
- package/skill/references/interfaces/IRawWire.md +149 -149
- package/skill/references/interfaces/ISCH_DrcError.md +142 -142
- package/skill/references/interfaces/ISCH_DrcErrorPrimitive.md +142 -142
- package/skill/references/interfaces/ISCH_ExportPngResolution.md +94 -94
- package/skill/references/interfaces/ISCH_NetInfo.md +88 -88
- package/skill/references/interfaces/ISCH_Primitive.md +218 -219
- package/skill/references/interfaces/ISCH_PrimitiveAPI.md +174 -175
- package/skill/references/interfaces/ISCH_ProjectNetInfo.md +142 -142
- package/skill/references/interfaces/ISCH_WireInfo.md +169 -169
- package/skill/references/interfaces/ISYS_ComparisonResponse.md +115 -0
- package/skill/references/interfaces/ISYS_ExtensionExternalApiIndex.md +13 -0
- package/skill/references/interfaces/ISYS_ExtensionRegisteredExternalApis.md +13 -0
- package/skill/references/interfaces/ISYS_ExternalApiHelp.md +173 -0
- package/skill/references/interfaces/ISYS_ExternalApiRegistration.md +146 -0
- package/skill/references/interfaces/ISYS_FileSystemFileList.md +169 -169
- package/skill/references/interfaces/ISYS_HeaderMenuSub1MenuItem.md +205 -174
- package/skill/references/interfaces/ISYS_HeaderMenuSub2MenuItem.md +178 -147
- package/skill/references/interfaces/ISYS_HeaderMenuTopMenuItem.md +115 -115
- package/skill/references/interfaces/ISYS_HeaderMenus.md +408 -408
- package/skill/references/interfaces/ISYS_HelpAudienceEntry.md +92 -0
- package/skill/references/interfaces/ISYS_HelpClassSummary.md +205 -0
- package/skill/references/interfaces/ISYS_HelpData.md +92 -0
- package/skill/references/interfaces/ISYS_HelpMethodDetail.md +310 -0
- package/skill/references/interfaces/ISYS_JobHandle.md +65 -0
- package/skill/references/interfaces/ISYS_JobLogEntry.md +142 -0
- package/skill/references/interfaces/ISYS_JobStatus.md +176 -0
- package/skill/references/interfaces/ISYS_LogLine.md +115 -115
- package/skill/references/interfaces/ISYS_MathBBox.md +142 -142
- package/skill/references/interfaces/ISYS_MathPoint.md +88 -88
- package/skill/references/interfaces/ISYS_MathPolygonWithHoles.md +92 -92
- package/skill/references/interfaces/ISYS_MessageBusTask.md +115 -115
- package/skill/references/interfaces/ISYS_MultilingualLanguagesData.md +12 -12
- package/skill/references/interfaces/ISYS_RightClickMenuItem.md +174 -174
- package/skill/references/interfaces/ISYS_ShortcutKeyData.md +169 -169
- package/skill/references/interfaces/ISYS_ShortcutKeyDataWithCallFn.md +62 -62
- package/skill/references/interfaces/ISYS_ShortcutKeyDataWithUserDefinedShortcutKey.md +62 -62
- package/skill/references/interfaces/ISYS_WindowEventListenerRemovableObject.md +109 -109
- package/skill/references/interfaces/IconProps.md +88 -88
- package/skill/references/interfaces/ImageProps.md +115 -115
- package/skill/references/interfaces/InputEditConfig.md +182 -0
- package/skill/references/interfaces/InputProps.md +547 -520
- package/skill/references/interfaces/KeyboardConfig.md +61 -0
- package/skill/references/interfaces/ListChildren.md +223 -223
- package/skill/references/interfaces/ListProps.md +250 -223
- package/skill/references/interfaces/ModalProps.md +358 -358
- package/skill/references/interfaces/NumberEditConfig.md +234 -0
- package/skill/references/interfaces/RadioGroupProps.md +196 -196
- package/skill/references/interfaces/RadioItem.md +115 -115
- package/skill/references/interfaces/RichTableProps.md +1357 -0
- package/skill/references/interfaces/RowMetaConfig.md +142 -0
- package/skill/references/interfaces/ScrollerProps.md +169 -169
- package/skill/references/interfaces/SelectEditConfig.md +211 -0
- package/skill/references/interfaces/SelectListItem.md +142 -142
- package/skill/references/interfaces/SelectOption.md +142 -0
- package/skill/references/interfaces/SelectProps.md +169 -169
- package/skill/references/interfaces/SelectionConfig.md +358 -0
- package/skill/references/interfaces/SliderProps.md +142 -0
- package/skill/references/interfaces/SlotProps.md +88 -88
- package/skill/references/interfaces/SortState.md +88 -0
- package/skill/references/interfaces/SortingConfig.md +169 -0
- package/skill/references/interfaces/StyleProps.md +439 -385
- package/skill/references/interfaces/TextAreaProps.md +196 -196
- package/skill/references/interfaces/TextProps.md +169 -169
- package/skill/references/interfaces/TextareaEditConfig.md +182 -0
- package/skill/references/interfaces/ValidationRule.md +223 -0
- package/skill/references/interfaces/VirtualScrollConfig.md +115 -0
- package/skill/references/types/Align.md +9 -0
- package/skill/references/types/CellContentType.md +9 -0
- package/skill/references/types/ColumnDefOrGroup.md +12 -0
- package/skill/references/types/ColumnEditConfig.md +13 -0
- package/skill/references/types/ColumnType.md +9 -0
- package/skill/references/types/DataChangeType.md +9 -0
- package/skill/references/types/FilterMatchMode.md +9 -0
- package/skill/references/types/RichTableRow.md +12 -0
- package/skill/references/types/Serializable.md +10 -0
- package/skill/references/types/SerializablePrimitive.md +9 -0
- package/skill/references/types/SortOrder.md +9 -0
- package/skill/references/types/TPCB_LayerTypesOfInnerLayer.md +11 -11
- package/skill/references/types/TPCB_LayersInTheSelectable.md +42 -42
- package/skill/references/types/TPCB_LayersOfComponent.md +11 -11
- package/skill/references/types/TPCB_LayersOfCopper.md +15 -15
- package/skill/references/types/TPCB_LayersOfCustom.md +41 -41
- package/skill/references/types/TPCB_LayersOfDimension.md +16 -16
- package/skill/references/types/TPCB_LayersOfFill.md +28 -28
- package/skill/references/types/TPCB_LayersOfImage.md +22 -22
- package/skill/references/types/TPCB_LayersOfInner.md +41 -41
- package/skill/references/types/TPCB_LayersOfLine.md +25 -25
- package/skill/references/types/TPCB_LayersOfObject.md +12 -12
- package/skill/references/types/TPCB_LayersOfPad.md +11 -11
- package/skill/references/types/TPCB_LayersOfRegion.md +11 -11
- package/skill/references/types/TPCB_NumberOfCopperLayers.md +9 -9
- package/skill/references/types/TPCB_PolygonSourceArray.md +85 -83
- package/skill/references/types/TPCB_PrimitiveDimensionCoordinateSet.md +66 -66
- package/skill/references/types/TPCB_PrimitivePadHole.md +30 -30
- package/skill/references/types/TPCB_PrimitivePadShape.md +61 -61
- package/skill/references/types/TPCB_PrimitiveSpecialPadShape.md +19 -19
- package/skill/references/types/TSYS_ComparisonErrorCode.md +15 -0
- package/skill/references/types/TSYS_LanguageKeyValuePairs.md +13 -0
- package/skill/references/types/TSYS_MathPolygonGroup.md +15 -15
- package/skill/references/types/TSYS_MathPolygonInput.md +20 -20
- package/skill/references/types/TSYS_ShortcutKeys.md +96 -96
- package/skill/user-guide/using-extension.md +47 -47
- package/src/json-gen.test.js +430 -0
- package/skill/guide/ancillary-projects/pro-api-sdk.md +0 -1
- package/skill/references/interfaces/ISYS_PcbComparisonResponse.md +0 -115
- package/skill/references/types/ISYS_LanguageKeyValuePairs.md +0 -13
- package/skill/references/types/TSYS_PcbComparisonErrorCode.md +0 -10
|
@@ -1,2315 +1,2315 @@
|
|
|
1
|
-
# IPCB\_PrimitiveString class
|
|
2
|
-
|
|
3
|
-
Text primitive
|
|
4
|
-
|
|
5
|
-
## Signature
|
|
6
|
-
|
|
7
|
-
```typescript
|
|
8
|
-
class IPCB_PrimitiveString implements IPCB_Primitive
|
|
9
|
-
```
|
|
10
|
-
**Implements:** [IPCB\_Primitive](../interfaces/IPCB_Primitive.md)
|
|
11
|
-
|
|
12
|
-
## Constructors
|
|
13
|
-
|
|
14
|
-
<table><thead><tr><th>
|
|
15
|
-
|
|
16
|
-
Constructor
|
|
17
|
-
|
|
18
|
-
</th><th>
|
|
19
|
-
|
|
20
|
-
Modifiers
|
|
21
|
-
|
|
22
|
-
</th><th>
|
|
23
|
-
|
|
24
|
-
Description
|
|
25
|
-
|
|
26
|
-
</th></tr></thead>
|
|
27
|
-
<tbody><tr><td>
|
|
28
|
-
|
|
29
|
-
[(constructor)(layer, x, y, text, fontFamily, fontSize, lineWidth, alignMode, rotation, reverse, expansion, mirror, primitiveLock, primitiveId)](./IPCB_PrimitiveString.md)
|
|
30
|
-
|
|
31
|
-
</td><td>
|
|
32
|
-
|
|
33
|
-
</td><td>
|
|
34
|
-
|
|
35
|
-
Constructs a new instance of the `IPCB_PrimitiveString` class
|
|
36
|
-
|
|
37
|
-
</td></tr>
|
|
38
|
-
</tbody></table>
|
|
39
|
-
|
|
40
|
-
## Methods
|
|
41
|
-
|
|
42
|
-
<table><thead><tr><th>
|
|
43
|
-
|
|
44
|
-
Method
|
|
45
|
-
|
|
46
|
-
</th><th>
|
|
47
|
-
|
|
48
|
-
Modifiers
|
|
49
|
-
|
|
50
|
-
</th><th>
|
|
51
|
-
|
|
52
|
-
Description
|
|
53
|
-
|
|
54
|
-
</th></tr></thead>
|
|
55
|
-
<tbody><tr><td>
|
|
56
|
-
|
|
57
|
-
[done()](./IPCB_PrimitiveString.md)
|
|
58
|
-
|
|
59
|
-
</td><td>
|
|
60
|
-
|
|
61
|
-
</td><td>
|
|
62
|
-
|
|
63
|
-
**_(BETA)_** Apply the changes to the primitives to the canvas
|
|
64
|
-
|
|
65
|
-
</td></tr>
|
|
66
|
-
<tr><td>
|
|
67
|
-
|
|
68
|
-
[getState\_AlignMode()](./IPCB_PrimitiveString.md)
|
|
69
|
-
|
|
70
|
-
</td><td>
|
|
71
|
-
|
|
72
|
-
</td><td>
|
|
73
|
-
|
|
74
|
-
Get the property state: alignment mode
|
|
75
|
-
|
|
76
|
-
</td></tr>
|
|
77
|
-
<tr><td>
|
|
78
|
-
|
|
79
|
-
[getState\_Expansion()](./IPCB_PrimitiveString.md)
|
|
80
|
-
|
|
81
|
-
</td><td>
|
|
82
|
-
|
|
83
|
-
</td><td>
|
|
84
|
-
|
|
85
|
-
Get the property state: inverted expansion
|
|
86
|
-
|
|
87
|
-
</td></tr>
|
|
88
|
-
<tr><td>
|
|
89
|
-
|
|
90
|
-
[getState\_FontFamily()](./IPCB_PrimitiveString.md)
|
|
91
|
-
|
|
92
|
-
</td><td>
|
|
93
|
-
|
|
94
|
-
</td><td>
|
|
95
|
-
|
|
96
|
-
Get the property state: font
|
|
97
|
-
|
|
98
|
-
</td></tr>
|
|
99
|
-
<tr><td>
|
|
100
|
-
|
|
101
|
-
[getState\_FontSize()](./IPCB_PrimitiveString.md)
|
|
102
|
-
|
|
103
|
-
</td><td>
|
|
104
|
-
|
|
105
|
-
</td><td>
|
|
106
|
-
|
|
107
|
-
Get the property state: font size
|
|
108
|
-
|
|
109
|
-
</td></tr>
|
|
110
|
-
<tr><td>
|
|
111
|
-
|
|
112
|
-
[getState\_Layer()](./IPCB_PrimitiveString.md)
|
|
113
|
-
|
|
114
|
-
</td><td>
|
|
115
|
-
|
|
116
|
-
</td><td>
|
|
117
|
-
|
|
118
|
-
Get the property state: Layer
|
|
119
|
-
|
|
120
|
-
</td></tr>
|
|
121
|
-
<tr><td>
|
|
122
|
-
|
|
123
|
-
[getState\_LineWidth()](./IPCB_PrimitiveString.md)
|
|
124
|
-
|
|
125
|
-
</td><td>
|
|
126
|
-
|
|
127
|
-
</td><td>
|
|
128
|
-
|
|
129
|
-
Get the property state: Line width
|
|
130
|
-
|
|
131
|
-
</td></tr>
|
|
132
|
-
<tr><td>
|
|
133
|
-
|
|
134
|
-
[getState\_Mirror()](./IPCB_PrimitiveString.md)
|
|
135
|
-
|
|
136
|
-
</td><td>
|
|
137
|
-
|
|
138
|
-
</td><td>
|
|
139
|
-
|
|
140
|
-
Get the property state: whether it is mirrored
|
|
141
|
-
|
|
142
|
-
</td></tr>
|
|
143
|
-
<tr><td>
|
|
144
|
-
|
|
145
|
-
[getState\_PrimitiveId()](./IPCB_PrimitiveString.md)
|
|
146
|
-
|
|
147
|
-
</td><td>
|
|
148
|
-
|
|
149
|
-
</td><td>
|
|
150
|
-
|
|
151
|
-
Get the property state: primitive ID
|
|
152
|
-
|
|
153
|
-
</td></tr>
|
|
154
|
-
<tr><td>
|
|
155
|
-
|
|
156
|
-
[getState\_PrimitiveLock()](./IPCB_PrimitiveString.md)
|
|
157
|
-
|
|
158
|
-
</td><td>
|
|
159
|
-
|
|
160
|
-
</td><td>
|
|
161
|
-
|
|
162
|
-
Get the property state: whether it is locked
|
|
163
|
-
|
|
164
|
-
</td></tr>
|
|
165
|
-
<tr><td>
|
|
166
|
-
|
|
167
|
-
[getState\_PrimitiveType()](./IPCB_PrimitiveString.md)
|
|
168
|
-
|
|
169
|
-
</td><td>
|
|
170
|
-
|
|
171
|
-
</td><td>
|
|
172
|
-
|
|
173
|
-
Get the property state: primitive type
|
|
174
|
-
|
|
175
|
-
</td></tr>
|
|
176
|
-
<tr><td>
|
|
177
|
-
|
|
178
|
-
[getState\_Reverse()](./IPCB_PrimitiveString.md)
|
|
179
|
-
|
|
180
|
-
</td><td>
|
|
181
|
-
|
|
182
|
-
</td><td>
|
|
183
|
-
|
|
184
|
-
Get the property state: whether it is inverted
|
|
185
|
-
|
|
186
|
-
</td></tr>
|
|
187
|
-
<tr><td>
|
|
188
|
-
|
|
189
|
-
[getState\_Rotation()](./IPCB_PrimitiveString.md)
|
|
190
|
-
|
|
191
|
-
</td><td>
|
|
192
|
-
|
|
193
|
-
</td><td>
|
|
194
|
-
|
|
195
|
-
Get the property state: rotation angle
|
|
196
|
-
|
|
197
|
-
</td></tr>
|
|
198
|
-
<tr><td>
|
|
199
|
-
|
|
200
|
-
[getState\_Text()](./IPCB_PrimitiveString.md)
|
|
201
|
-
|
|
202
|
-
</td><td>
|
|
203
|
-
|
|
204
|
-
</td><td>
|
|
205
|
-
|
|
206
|
-
Get the property state: text content
|
|
207
|
-
|
|
208
|
-
</td></tr>
|
|
209
|
-
<tr><td>
|
|
210
|
-
|
|
211
|
-
[getState\_X()](./IPCB_PrimitiveString.md)
|
|
212
|
-
|
|
213
|
-
</td><td>
|
|
214
|
-
|
|
215
|
-
</td><td>
|
|
216
|
-
|
|
217
|
-
Get the property state: X coordinate
|
|
218
|
-
|
|
219
|
-
</td></tr>
|
|
220
|
-
<tr><td>
|
|
221
|
-
|
|
222
|
-
[getState\_Y()](./IPCB_PrimitiveString.md)
|
|
223
|
-
|
|
224
|
-
</td><td>
|
|
225
|
-
|
|
226
|
-
</td><td>
|
|
227
|
-
|
|
228
|
-
Get the property state: Y coordinate
|
|
229
|
-
|
|
230
|
-
</td></tr>
|
|
231
|
-
<tr><td>
|
|
232
|
-
|
|
233
|
-
[isAsync()](./IPCB_PrimitiveString.md)
|
|
234
|
-
|
|
235
|
-
</td><td>
|
|
236
|
-
|
|
237
|
-
</td><td>
|
|
238
|
-
|
|
239
|
-
Query whether the primitive is an async primitive
|
|
240
|
-
|
|
241
|
-
</td></tr>
|
|
242
|
-
<tr><td>
|
|
243
|
-
|
|
244
|
-
[reset()](./IPCB_PrimitiveString.md)
|
|
245
|
-
|
|
246
|
-
</td><td>
|
|
247
|
-
|
|
248
|
-
</td><td>
|
|
249
|
-
|
|
250
|
-
**_(BETA)_** Reset the async primitive to the current canvas state
|
|
251
|
-
|
|
252
|
-
</td></tr>
|
|
253
|
-
<tr><td>
|
|
254
|
-
|
|
255
|
-
[setState\_AlignMode(alignMode)](./IPCB_PrimitiveString.md)
|
|
256
|
-
|
|
257
|
-
</td><td>
|
|
258
|
-
|
|
259
|
-
</td><td>
|
|
260
|
-
|
|
261
|
-
**_(BETA)_** Set the property state: alignment mode
|
|
262
|
-
|
|
263
|
-
</td></tr>
|
|
264
|
-
<tr><td>
|
|
265
|
-
|
|
266
|
-
[setState\_Expansion(expansion)](./IPCB_PrimitiveString.md)
|
|
267
|
-
|
|
268
|
-
</td><td>
|
|
269
|
-
|
|
270
|
-
</td><td>
|
|
271
|
-
|
|
272
|
-
**_(BETA)_** Set the property state: inverted expansion
|
|
273
|
-
|
|
274
|
-
</td></tr>
|
|
275
|
-
<tr><td>
|
|
276
|
-
|
|
277
|
-
[setState\_FontFamily(fontFamily)](./IPCB_PrimitiveString.md)
|
|
278
|
-
|
|
279
|
-
</td><td>
|
|
280
|
-
|
|
281
|
-
</td><td>
|
|
282
|
-
|
|
283
|
-
**_(BETA)_** Set the property state: font
|
|
284
|
-
|
|
285
|
-
</td></tr>
|
|
286
|
-
<tr><td>
|
|
287
|
-
|
|
288
|
-
[setState\_FontSize(fontSize)](./IPCB_PrimitiveString.md)
|
|
289
|
-
|
|
290
|
-
</td><td>
|
|
291
|
-
|
|
292
|
-
</td><td>
|
|
293
|
-
|
|
294
|
-
**_(BETA)_** Set the property state: font size
|
|
295
|
-
|
|
296
|
-
</td></tr>
|
|
297
|
-
<tr><td>
|
|
298
|
-
|
|
299
|
-
[setState\_Layer(layer)](./IPCB_PrimitiveString.md)
|
|
300
|
-
|
|
301
|
-
</td><td>
|
|
302
|
-
|
|
303
|
-
</td><td>
|
|
304
|
-
|
|
305
|
-
**_(BETA)_** Set the property state: Layer
|
|
306
|
-
|
|
307
|
-
</td></tr>
|
|
308
|
-
<tr><td>
|
|
309
|
-
|
|
310
|
-
[setState\_LineWidth(lineWidth)](./IPCB_PrimitiveString.md)
|
|
311
|
-
|
|
312
|
-
</td><td>
|
|
313
|
-
|
|
314
|
-
</td><td>
|
|
315
|
-
|
|
316
|
-
**_(BETA)_** Set the property state: Line width
|
|
317
|
-
|
|
318
|
-
</td></tr>
|
|
319
|
-
<tr><td>
|
|
320
|
-
|
|
321
|
-
[setState\_Mirror(mirror)](./IPCB_PrimitiveString.md)
|
|
322
|
-
|
|
323
|
-
</td><td>
|
|
324
|
-
|
|
325
|
-
</td><td>
|
|
326
|
-
|
|
327
|
-
**_(BETA)_** Set the property state: whether it is mirrored
|
|
328
|
-
|
|
329
|
-
</td></tr>
|
|
330
|
-
<tr><td>
|
|
331
|
-
|
|
332
|
-
[setState\_PrimitiveLock(primitiveLock)](./IPCB_PrimitiveString.md)
|
|
333
|
-
|
|
334
|
-
</td><td>
|
|
335
|
-
|
|
336
|
-
</td><td>
|
|
337
|
-
|
|
338
|
-
**_(BETA)_** Set the property state: whether it is locked
|
|
339
|
-
|
|
340
|
-
</td></tr>
|
|
341
|
-
<tr><td>
|
|
342
|
-
|
|
343
|
-
[setState\_Reverse(reverse)](./IPCB_PrimitiveString.md)
|
|
344
|
-
|
|
345
|
-
</td><td>
|
|
346
|
-
|
|
347
|
-
</td><td>
|
|
348
|
-
|
|
349
|
-
**_(BETA)_** Set the property state: whether it is inverted
|
|
350
|
-
|
|
351
|
-
</td></tr>
|
|
352
|
-
<tr><td>
|
|
353
|
-
|
|
354
|
-
[setState\_Rotation(rotation)](./IPCB_PrimitiveString.md)
|
|
355
|
-
|
|
356
|
-
</td><td>
|
|
357
|
-
|
|
358
|
-
</td><td>
|
|
359
|
-
|
|
360
|
-
**_(BETA)_** Set the property state: rotation angle
|
|
361
|
-
|
|
362
|
-
</td></tr>
|
|
363
|
-
<tr><td>
|
|
364
|
-
|
|
365
|
-
[setState\_Text(text)](./IPCB_PrimitiveString.md)
|
|
366
|
-
|
|
367
|
-
</td><td>
|
|
368
|
-
|
|
369
|
-
</td><td>
|
|
370
|
-
|
|
371
|
-
**_(BETA)_** Set the property state: text content
|
|
372
|
-
|
|
373
|
-
</td></tr>
|
|
374
|
-
<tr><td>
|
|
375
|
-
|
|
376
|
-
[setState\_X(x)](./IPCB_PrimitiveString.md)
|
|
377
|
-
|
|
378
|
-
</td><td>
|
|
379
|
-
|
|
380
|
-
</td><td>
|
|
381
|
-
|
|
382
|
-
**_(BETA)_** Set the property state: X coordinate
|
|
383
|
-
|
|
384
|
-
</td></tr>
|
|
385
|
-
<tr><td>
|
|
386
|
-
|
|
387
|
-
[setState\_Y(y)](./IPCB_PrimitiveString.md)
|
|
388
|
-
|
|
389
|
-
</td><td>
|
|
390
|
-
|
|
391
|
-
</td><td>
|
|
392
|
-
|
|
393
|
-
**_(BETA)_** Set the property state: Y coordinate
|
|
394
|
-
|
|
395
|
-
</td></tr>
|
|
396
|
-
<tr><td>
|
|
397
|
-
|
|
398
|
-
[toAsync()](./IPCB_PrimitiveString.md)
|
|
399
|
-
|
|
400
|
-
</td><td>
|
|
401
|
-
|
|
402
|
-
</td><td>
|
|
403
|
-
|
|
404
|
-
Convert Primitive to Async primitive
|
|
405
|
-
|
|
406
|
-
</td></tr>
|
|
407
|
-
<tr><td>
|
|
408
|
-
|
|
409
|
-
[toSync()](./IPCB_PrimitiveString.md)
|
|
410
|
-
|
|
411
|
-
</td><td>
|
|
412
|
-
|
|
413
|
-
</td><td>
|
|
414
|
-
|
|
415
|
-
Convert Primitive to Sync primitive
|
|
416
|
-
|
|
417
|
-
</td></tr>
|
|
418
|
-
</tbody></table>
|
|
419
|
-
|
|
420
|
-
---
|
|
421
|
-
|
|
422
|
-
## 构造函数详情
|
|
423
|
-
|
|
424
|
-
### _constructor_
|
|
425
|
-
|
|
426
|
-
# IPCB\_PrimitiveString.(constructor)
|
|
427
|
-
|
|
428
|
-
Constructs a new instance of the `IPCB_PrimitiveString` class
|
|
429
|
-
|
|
430
|
-
## Signature
|
|
431
|
-
|
|
432
|
-
```typescript
|
|
433
|
-
function constructor(
|
|
434
|
-
layer: TPCB_LayersOfImage,
|
|
435
|
-
x: number,
|
|
436
|
-
y: number,
|
|
437
|
-
text: string,
|
|
438
|
-
fontFamily?: string,
|
|
439
|
-
fontSize?: number,
|
|
440
|
-
lineWidth?: number,
|
|
441
|
-
alignMode?: EPCB_PrimitiveStringAlignMode,
|
|
442
|
-
rotation?: number,
|
|
443
|
-
reverse?: boolean,
|
|
444
|
-
expansion?: number,
|
|
445
|
-
mirror?: boolean,
|
|
446
|
-
primitiveLock?: boolean,
|
|
447
|
-
primitiveId?: string,
|
|
448
|
-
);
|
|
449
|
-
```
|
|
450
|
-
|
|
451
|
-
## Parameters
|
|
452
|
-
|
|
453
|
-
<table><thead><tr><th>
|
|
454
|
-
|
|
455
|
-
Parameter
|
|
456
|
-
|
|
457
|
-
</th><th>
|
|
458
|
-
|
|
459
|
-
Type
|
|
460
|
-
|
|
461
|
-
</th><th>
|
|
462
|
-
|
|
463
|
-
Description
|
|
464
|
-
|
|
465
|
-
</th></tr></thead>
|
|
466
|
-
<tbody><tr><td>
|
|
467
|
-
|
|
468
|
-
layer
|
|
469
|
-
|
|
470
|
-
</td><td>
|
|
471
|
-
|
|
472
|
-
[TPCB\_LayersOfImage](../types/TPCB_LayersOfImage.md)
|
|
473
|
-
|
|
474
|
-
</td><td>
|
|
475
|
-
|
|
476
|
-
</td></tr>
|
|
477
|
-
<tr><td>
|
|
478
|
-
|
|
479
|
-
x
|
|
480
|
-
|
|
481
|
-
</td><td>
|
|
482
|
-
|
|
483
|
-
number
|
|
484
|
-
|
|
485
|
-
</td><td>
|
|
486
|
-
|
|
487
|
-
</td></tr>
|
|
488
|
-
<tr><td>
|
|
489
|
-
|
|
490
|
-
y
|
|
491
|
-
|
|
492
|
-
</td><td>
|
|
493
|
-
|
|
494
|
-
number
|
|
495
|
-
|
|
496
|
-
</td><td>
|
|
497
|
-
|
|
498
|
-
</td></tr>
|
|
499
|
-
<tr><td>
|
|
500
|
-
|
|
501
|
-
text
|
|
502
|
-
|
|
503
|
-
</td><td>
|
|
504
|
-
|
|
505
|
-
string
|
|
506
|
-
|
|
507
|
-
</td><td>
|
|
508
|
-
|
|
509
|
-
</td></tr>
|
|
510
|
-
<tr><td>
|
|
511
|
-
|
|
512
|
-
fontFamily
|
|
513
|
-
|
|
514
|
-
</td><td>
|
|
515
|
-
|
|
516
|
-
string
|
|
517
|
-
|
|
518
|
-
</td><td>
|
|
519
|
-
|
|
520
|
-
_(Optional)_
|
|
521
|
-
|
|
522
|
-
</td></tr>
|
|
523
|
-
<tr><td>
|
|
524
|
-
|
|
525
|
-
fontSize
|
|
526
|
-
|
|
527
|
-
</td><td>
|
|
528
|
-
|
|
529
|
-
number
|
|
530
|
-
|
|
531
|
-
</td><td>
|
|
532
|
-
|
|
533
|
-
_(Optional)_
|
|
534
|
-
|
|
535
|
-
</td></tr>
|
|
536
|
-
<tr><td>
|
|
537
|
-
|
|
538
|
-
lineWidth
|
|
539
|
-
|
|
540
|
-
</td><td>
|
|
541
|
-
|
|
542
|
-
number
|
|
543
|
-
|
|
544
|
-
</td><td>
|
|
545
|
-
|
|
546
|
-
_(Optional)_
|
|
547
|
-
|
|
548
|
-
</td></tr>
|
|
549
|
-
<tr><td>
|
|
550
|
-
|
|
551
|
-
alignMode
|
|
552
|
-
|
|
553
|
-
</td><td>
|
|
554
|
-
|
|
555
|
-
[EPCB\_PrimitiveStringAlignMode](../enums/EPCB_PrimitiveStringAlignMode.md)
|
|
556
|
-
|
|
557
|
-
</td><td>
|
|
558
|
-
|
|
559
|
-
_(Optional)_
|
|
560
|
-
|
|
561
|
-
</td></tr>
|
|
562
|
-
<tr><td>
|
|
563
|
-
|
|
564
|
-
rotation
|
|
565
|
-
|
|
566
|
-
</td><td>
|
|
567
|
-
|
|
568
|
-
number
|
|
569
|
-
|
|
570
|
-
</td><td>
|
|
571
|
-
|
|
572
|
-
_(Optional)_
|
|
573
|
-
|
|
574
|
-
</td></tr>
|
|
575
|
-
<tr><td>
|
|
576
|
-
|
|
577
|
-
reverse
|
|
578
|
-
|
|
579
|
-
</td><td>
|
|
580
|
-
|
|
581
|
-
boolean
|
|
582
|
-
|
|
583
|
-
</td><td>
|
|
584
|
-
|
|
585
|
-
_(Optional)_
|
|
586
|
-
|
|
587
|
-
</td></tr>
|
|
588
|
-
<tr><td>
|
|
589
|
-
|
|
590
|
-
expansion
|
|
591
|
-
|
|
592
|
-
</td><td>
|
|
593
|
-
|
|
594
|
-
number
|
|
595
|
-
|
|
596
|
-
</td><td>
|
|
597
|
-
|
|
598
|
-
_(Optional)_
|
|
599
|
-
|
|
600
|
-
</td></tr>
|
|
601
|
-
<tr><td>
|
|
602
|
-
|
|
603
|
-
mirror
|
|
604
|
-
|
|
605
|
-
</td><td>
|
|
606
|
-
|
|
607
|
-
boolean
|
|
608
|
-
|
|
609
|
-
</td><td>
|
|
610
|
-
|
|
611
|
-
_(Optional)_
|
|
612
|
-
|
|
613
|
-
</td></tr>
|
|
614
|
-
<tr><td>
|
|
615
|
-
|
|
616
|
-
primitiveLock
|
|
617
|
-
|
|
618
|
-
</td><td>
|
|
619
|
-
|
|
620
|
-
boolean
|
|
621
|
-
|
|
622
|
-
</td><td>
|
|
623
|
-
|
|
624
|
-
_(Optional)_
|
|
625
|
-
|
|
626
|
-
</td></tr>
|
|
627
|
-
<tr><td>
|
|
628
|
-
|
|
629
|
-
primitiveId
|
|
630
|
-
|
|
631
|
-
</td><td>
|
|
632
|
-
|
|
633
|
-
string
|
|
634
|
-
|
|
635
|
-
</td><td>
|
|
636
|
-
|
|
637
|
-
_(Optional)_
|
|
638
|
-
|
|
639
|
-
</td></tr>
|
|
640
|
-
</tbody></table>
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
---
|
|
644
|
-
|
|
645
|
-
## 方法详情
|
|
646
|
-
|
|
647
|
-
### done
|
|
648
|
-
|
|
649
|
-
# IPCB\_PrimitiveString.done() method
|
|
650
|
-
|
|
651
|
-
> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
|
652
|
-
|
|
653
|
-
Apply the changes to the primitives to the canvas
|
|
654
|
-
|
|
655
|
-
## Signature
|
|
656
|
-
|
|
657
|
-
```typescript
|
|
658
|
-
function done(): Promise<IPCB_PrimitiveString>;
|
|
659
|
-
```
|
|
660
|
-
|
|
661
|
-
## Returns
|
|
662
|
-
|
|
663
|
-
Promise<[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)<!-- -->>
|
|
664
|
-
|
|
665
|
-
Text primitive object
|
|
666
|
-
|
|
667
|
-
## Example
|
|
668
|
-
|
|
669
|
-
```javascript
|
|
670
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
|
|
671
|
-
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
672
|
-
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
673
|
-
|
|
674
|
-
// 2. 在顶层丝印(3)放置一行文本
|
|
675
|
-
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
676
|
-
const before = str.getState_Text();
|
|
677
|
-
|
|
678
|
-
// 3. 异步模式下批量改两个字段(此时画布还没变)
|
|
679
|
-
const asyncStr = str.toAsync();
|
|
680
|
-
asyncStr.setState_Text('嘉立创示例_DONE');
|
|
681
|
-
asyncStr.setState_Rotation(90);
|
|
682
|
-
await asyncStr.done();
|
|
683
|
-
|
|
684
|
-
// 4. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
685
|
-
const refetched = await eda.pcb_PrimitiveString.get(str.getState_PrimitiveId());
|
|
686
|
-
|
|
687
|
-
console.log('text:', before, '→', refetched.getState_Text());
|
|
688
|
-
console.log('rotation:', refetched.getState_Rotation());
|
|
689
|
-
```
|
|
690
|
-
|
|
691
|
-
### getstate_alignmode
|
|
692
|
-
|
|
693
|
-
# IPCB\_PrimitiveString.getState\_AlignMode() method
|
|
694
|
-
|
|
695
|
-
Get the property state: alignment mode
|
|
696
|
-
|
|
697
|
-
## Signature
|
|
698
|
-
|
|
699
|
-
```typescript
|
|
700
|
-
function getState_AlignMode(): EPCB_PrimitiveStringAlignMode;
|
|
701
|
-
```
|
|
702
|
-
|
|
703
|
-
## Returns
|
|
704
|
-
|
|
705
|
-
[EPCB\_PrimitiveStringAlignMode](../enums/EPCB_PrimitiveStringAlignMode.md)
|
|
706
|
-
|
|
707
|
-
Alignment mode
|
|
708
|
-
|
|
709
|
-
## Example
|
|
710
|
-
|
|
711
|
-
```javascript
|
|
712
|
-
// 1. 在顶层丝印(3)放置一行左下(3)对齐的文本
|
|
713
|
-
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
714
|
-
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
715
|
-
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
716
|
-
|
|
717
|
-
// 2. 读取对齐模式(1-9:3=左下、5=居中)
|
|
718
|
-
const alignMode = str.getState_AlignMode();
|
|
719
|
-
|
|
720
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
721
|
-
await eda.pcb_PrimitiveString.delete([str.getState_PrimitiveId()]);
|
|
722
|
-
|
|
723
|
-
console.log('alignMode:', alignMode);
|
|
724
|
-
```
|
|
725
|
-
|
|
726
|
-
### getstate_expansion
|
|
727
|
-
|
|
728
|
-
# IPCB\_PrimitiveString.getState\_Expansion() method
|
|
729
|
-
|
|
730
|
-
Get the property state: inverted expansion
|
|
731
|
-
|
|
732
|
-
## Signature
|
|
733
|
-
|
|
734
|
-
```typescript
|
|
735
|
-
function getState_Expansion(): number;
|
|
736
|
-
```
|
|
737
|
-
|
|
738
|
-
## Returns
|
|
739
|
-
|
|
740
|
-
number
|
|
741
|
-
|
|
742
|
-
Inverted expansion
|
|
743
|
-
|
|
744
|
-
## Example
|
|
745
|
-
|
|
746
|
-
```javascript
|
|
747
|
-
// 1. 在顶层丝印(3)放置一行文本(反相扩展默认 0)
|
|
748
|
-
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
749
|
-
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
750
|
-
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
751
|
-
|
|
752
|
-
// 2. 读取反相扩展值
|
|
753
|
-
const expansion = str.getState_Expansion();
|
|
754
|
-
|
|
755
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
756
|
-
await eda.pcb_PrimitiveString.delete([str.getState_PrimitiveId()]);
|
|
757
|
-
|
|
758
|
-
console.log('expansion:', expansion);
|
|
759
|
-
```
|
|
760
|
-
|
|
761
|
-
### getstate_fontfamily
|
|
762
|
-
|
|
763
|
-
# IPCB\_PrimitiveString.getState\_FontFamily() method
|
|
764
|
-
|
|
765
|
-
Get the property state: font
|
|
766
|
-
|
|
767
|
-
## Signature
|
|
768
|
-
|
|
769
|
-
```typescript
|
|
770
|
-
function getState_FontFamily(): string;
|
|
771
|
-
```
|
|
772
|
-
|
|
773
|
-
## Returns
|
|
774
|
-
|
|
775
|
-
string
|
|
776
|
-
|
|
777
|
-
Font
|
|
778
|
-
|
|
779
|
-
## Example
|
|
780
|
-
|
|
781
|
-
```javascript
|
|
782
|
-
// 1. 在顶层丝印(3)放置一行默认字体的文本
|
|
783
|
-
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
784
|
-
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
785
|
-
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
786
|
-
|
|
787
|
-
// 2. 读取字体名
|
|
788
|
-
const fontFamily = str.getState_FontFamily();
|
|
789
|
-
|
|
790
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
791
|
-
await eda.pcb_PrimitiveString.delete([str.getState_PrimitiveId()]);
|
|
792
|
-
|
|
793
|
-
console.log('fontFamily:', fontFamily);
|
|
794
|
-
```
|
|
795
|
-
|
|
796
|
-
### getstate_fontsize
|
|
797
|
-
|
|
798
|
-
# IPCB\_PrimitiveString.getState\_FontSize() method
|
|
799
|
-
|
|
800
|
-
Get the property state: font size
|
|
801
|
-
|
|
802
|
-
## Signature
|
|
803
|
-
|
|
804
|
-
```typescript
|
|
805
|
-
function getState_FontSize(): number;
|
|
806
|
-
```
|
|
807
|
-
|
|
808
|
-
## Returns
|
|
809
|
-
|
|
810
|
-
number
|
|
811
|
-
|
|
812
|
-
Font size
|
|
813
|
-
|
|
814
|
-
## Example
|
|
815
|
-
|
|
816
|
-
```javascript
|
|
817
|
-
// 1. 在顶层丝印(3)放置一行 45mil 字号的文本
|
|
818
|
-
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
819
|
-
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
820
|
-
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
821
|
-
|
|
822
|
-
// 2. 读取字号
|
|
823
|
-
const fontSize = str.getState_FontSize();
|
|
824
|
-
|
|
825
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
826
|
-
await eda.pcb_PrimitiveString.delete([str.getState_PrimitiveId()]);
|
|
827
|
-
|
|
828
|
-
console.log('fontSize:', fontSize);
|
|
829
|
-
```
|
|
830
|
-
|
|
831
|
-
### getstate_layer
|
|
832
|
-
|
|
833
|
-
# IPCB\_PrimitiveString.getState\_Layer() method
|
|
834
|
-
|
|
835
|
-
Get the property state: Layer
|
|
836
|
-
|
|
837
|
-
## Signature
|
|
838
|
-
|
|
839
|
-
```typescript
|
|
840
|
-
function getState_Layer(): TPCB_LayersOfImage;
|
|
841
|
-
```
|
|
842
|
-
|
|
843
|
-
## Returns
|
|
844
|
-
|
|
845
|
-
[TPCB\_LayersOfImage](../types/TPCB_LayersOfImage.md)
|
|
846
|
-
|
|
847
|
-
Layer
|
|
848
|
-
|
|
849
|
-
## Example
|
|
850
|
-
|
|
851
|
-
```javascript
|
|
852
|
-
// 1. 在顶层丝印(3)放置一行文本
|
|
853
|
-
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
854
|
-
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
855
|
-
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
856
|
-
|
|
857
|
-
// 2. 读取所在层
|
|
858
|
-
const layer = str.getState_Layer();
|
|
859
|
-
|
|
860
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
861
|
-
await eda.pcb_PrimitiveString.delete([str.getState_PrimitiveId()]);
|
|
862
|
-
|
|
863
|
-
console.log('layer:', layer);
|
|
864
|
-
```
|
|
865
|
-
|
|
866
|
-
### getstate_linewidth
|
|
867
|
-
|
|
868
|
-
# IPCB\_PrimitiveString.getState\_LineWidth() method
|
|
869
|
-
|
|
870
|
-
Get the property state: Line width
|
|
871
|
-
|
|
872
|
-
## Signature
|
|
873
|
-
|
|
874
|
-
```typescript
|
|
875
|
-
function getState_LineWidth(): number;
|
|
876
|
-
```
|
|
877
|
-
|
|
878
|
-
## Returns
|
|
879
|
-
|
|
880
|
-
number
|
|
881
|
-
|
|
882
|
-
Line width
|
|
883
|
-
|
|
884
|
-
## Example
|
|
885
|
-
|
|
886
|
-
```javascript
|
|
887
|
-
// 1. 在顶层丝印(3)放置一行笔画 6mil 的文本
|
|
888
|
-
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
889
|
-
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
890
|
-
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
891
|
-
|
|
892
|
-
// 2. 读取笔画线宽
|
|
893
|
-
const lineWidth = str.getState_LineWidth();
|
|
894
|
-
|
|
895
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
896
|
-
await eda.pcb_PrimitiveString.delete([str.getState_PrimitiveId()]);
|
|
897
|
-
|
|
898
|
-
console.log('lineWidth:', lineWidth);
|
|
899
|
-
```
|
|
900
|
-
|
|
901
|
-
### getstate_mirror
|
|
902
|
-
|
|
903
|
-
# IPCB\_PrimitiveString.getState\_Mirror() method
|
|
904
|
-
|
|
905
|
-
Get the property state: whether it is mirrored
|
|
906
|
-
|
|
907
|
-
## Signature
|
|
908
|
-
|
|
909
|
-
```typescript
|
|
910
|
-
function getState_Mirror(): boolean;
|
|
911
|
-
```
|
|
912
|
-
|
|
913
|
-
## Returns
|
|
914
|
-
|
|
915
|
-
boolean
|
|
916
|
-
|
|
917
|
-
Whether it is mirrored
|
|
918
|
-
|
|
919
|
-
## Example
|
|
920
|
-
|
|
921
|
-
```javascript
|
|
922
|
-
// 1. 在顶层丝印(3)放置一行不镜像的文本
|
|
923
|
-
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
924
|
-
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
925
|
-
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
926
|
-
|
|
927
|
-
// 2. 读取镜像状态
|
|
928
|
-
const mirror = str.getState_Mirror();
|
|
929
|
-
|
|
930
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
931
|
-
await eda.pcb_PrimitiveString.delete([str.getState_PrimitiveId()]);
|
|
932
|
-
|
|
933
|
-
console.log('mirror:', mirror);
|
|
934
|
-
```
|
|
935
|
-
|
|
936
|
-
### getstate_primitiveid
|
|
937
|
-
|
|
938
|
-
# IPCB\_PrimitiveString.getState\_PrimitiveId() method
|
|
939
|
-
|
|
940
|
-
Get the property state: primitive ID
|
|
941
|
-
|
|
942
|
-
## Signature
|
|
943
|
-
|
|
944
|
-
```typescript
|
|
945
|
-
function getState_PrimitiveId(): string;
|
|
946
|
-
```
|
|
947
|
-
|
|
948
|
-
## Returns
|
|
949
|
-
|
|
950
|
-
string
|
|
951
|
-
|
|
952
|
-
Primitive ID
|
|
953
|
-
|
|
954
|
-
## Example
|
|
955
|
-
|
|
956
|
-
```javascript
|
|
957
|
-
// 1. 在顶层丝印(3)放置一行文本
|
|
958
|
-
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
959
|
-
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
960
|
-
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
961
|
-
|
|
962
|
-
// 2. 读取图元 ID
|
|
963
|
-
const primitiveId = str.getState_PrimitiveId();
|
|
964
|
-
|
|
965
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
966
|
-
await eda.pcb_PrimitiveString.delete([primitiveId]);
|
|
967
|
-
|
|
968
|
-
console.log('primitiveId:', primitiveId);
|
|
969
|
-
```
|
|
970
|
-
|
|
971
|
-
### getstate_primitivelock
|
|
972
|
-
|
|
973
|
-
# IPCB\_PrimitiveString.getState\_PrimitiveLock() method
|
|
974
|
-
|
|
975
|
-
Get the property state: whether it is locked
|
|
976
|
-
|
|
977
|
-
## Signature
|
|
978
|
-
|
|
979
|
-
```typescript
|
|
980
|
-
function getState_PrimitiveLock(): boolean;
|
|
981
|
-
```
|
|
982
|
-
|
|
983
|
-
## Returns
|
|
984
|
-
|
|
985
|
-
boolean
|
|
986
|
-
|
|
987
|
-
Whether it is locked
|
|
988
|
-
|
|
989
|
-
## Example
|
|
990
|
-
|
|
991
|
-
```javascript
|
|
992
|
-
// 1. 在顶层丝印(3)放置一行未锁定的文本
|
|
993
|
-
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
994
|
-
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
995
|
-
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
996
|
-
|
|
997
|
-
// 2. 读取锁定状态
|
|
998
|
-
const primitiveLock = str.getState_PrimitiveLock();
|
|
999
|
-
|
|
1000
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
1001
|
-
await eda.pcb_PrimitiveString.delete([str.getState_PrimitiveId()]);
|
|
1002
|
-
|
|
1003
|
-
console.log('primitiveLock:', primitiveLock);
|
|
1004
|
-
```
|
|
1005
|
-
|
|
1006
|
-
### getstate_primitivetype
|
|
1007
|
-
|
|
1008
|
-
# IPCB\_PrimitiveString.getState\_PrimitiveType() method
|
|
1009
|
-
|
|
1010
|
-
Get the property state: primitive type
|
|
1011
|
-
|
|
1012
|
-
## Signature
|
|
1013
|
-
|
|
1014
|
-
```typescript
|
|
1015
|
-
function getState_PrimitiveType(): EPCB_PrimitiveType;
|
|
1016
|
-
```
|
|
1017
|
-
|
|
1018
|
-
## Returns
|
|
1019
|
-
|
|
1020
|
-
[EPCB\_PrimitiveType](../enums/EPCB_PrimitiveType.md)
|
|
1021
|
-
|
|
1022
|
-
Primitive type
|
|
1023
|
-
|
|
1024
|
-
## Example
|
|
1025
|
-
|
|
1026
|
-
```javascript
|
|
1027
|
-
// 1. 在顶层丝印(3)放置一行文本
|
|
1028
|
-
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
1029
|
-
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
1030
|
-
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
1031
|
-
|
|
1032
|
-
// 2. 读取图元类型
|
|
1033
|
-
const primitiveType = str.getState_PrimitiveType();
|
|
1034
|
-
|
|
1035
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
1036
|
-
await eda.pcb_PrimitiveString.delete([str.getState_PrimitiveId()]);
|
|
1037
|
-
|
|
1038
|
-
console.log('primitiveType:', primitiveType);
|
|
1039
|
-
```
|
|
1040
|
-
|
|
1041
|
-
### getstate_reverse
|
|
1042
|
-
|
|
1043
|
-
# IPCB\_PrimitiveString.getState\_Reverse() method
|
|
1044
|
-
|
|
1045
|
-
Get the property state: whether it is inverted
|
|
1046
|
-
|
|
1047
|
-
## Signature
|
|
1048
|
-
|
|
1049
|
-
```typescript
|
|
1050
|
-
function getState_Reverse(): boolean;
|
|
1051
|
-
```
|
|
1052
|
-
|
|
1053
|
-
## Returns
|
|
1054
|
-
|
|
1055
|
-
boolean
|
|
1056
|
-
|
|
1057
|
-
Whether it is inverted
|
|
1058
|
-
|
|
1059
|
-
## Example
|
|
1060
|
-
|
|
1061
|
-
```javascript
|
|
1062
|
-
// 1. 在顶层丝印(3)放置一行不反相的文本
|
|
1063
|
-
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
1064
|
-
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
1065
|
-
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
1066
|
-
|
|
1067
|
-
// 2. 读取反相状态
|
|
1068
|
-
const reverse = str.getState_Reverse();
|
|
1069
|
-
|
|
1070
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
1071
|
-
await eda.pcb_PrimitiveString.delete([str.getState_PrimitiveId()]);
|
|
1072
|
-
|
|
1073
|
-
console.log('reverse:', reverse);
|
|
1074
|
-
```
|
|
1075
|
-
|
|
1076
|
-
### getstate_rotation
|
|
1077
|
-
|
|
1078
|
-
# IPCB\_PrimitiveString.getState\_Rotation() method
|
|
1079
|
-
|
|
1080
|
-
Get the property state: rotation angle
|
|
1081
|
-
|
|
1082
|
-
## Signature
|
|
1083
|
-
|
|
1084
|
-
```typescript
|
|
1085
|
-
function getState_Rotation(): number;
|
|
1086
|
-
```
|
|
1087
|
-
|
|
1088
|
-
## Returns
|
|
1089
|
-
|
|
1090
|
-
number
|
|
1091
|
-
|
|
1092
|
-
Rotation angle
|
|
1093
|
-
|
|
1094
|
-
## Example
|
|
1095
|
-
|
|
1096
|
-
```javascript
|
|
1097
|
-
// 1. 在顶层丝印(3)放置一行不旋转(0°)的文本
|
|
1098
|
-
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
1099
|
-
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
1100
|
-
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
1101
|
-
|
|
1102
|
-
// 2. 读取旋转角度
|
|
1103
|
-
const rotation = str.getState_Rotation();
|
|
1104
|
-
|
|
1105
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
1106
|
-
await eda.pcb_PrimitiveString.delete([str.getState_PrimitiveId()]);
|
|
1107
|
-
|
|
1108
|
-
console.log('rotation:', rotation);
|
|
1109
|
-
```
|
|
1110
|
-
|
|
1111
|
-
### getstate_text
|
|
1112
|
-
|
|
1113
|
-
# IPCB\_PrimitiveString.getState\_Text() method
|
|
1114
|
-
|
|
1115
|
-
Get the property state: text content
|
|
1116
|
-
|
|
1117
|
-
## Signature
|
|
1118
|
-
|
|
1119
|
-
```typescript
|
|
1120
|
-
function getState_Text(): string;
|
|
1121
|
-
```
|
|
1122
|
-
|
|
1123
|
-
## Returns
|
|
1124
|
-
|
|
1125
|
-
string
|
|
1126
|
-
|
|
1127
|
-
Text content
|
|
1128
|
-
|
|
1129
|
-
## Example
|
|
1130
|
-
|
|
1131
|
-
```javascript
|
|
1132
|
-
// 1. 在顶层丝印(3)放置一行文本
|
|
1133
|
-
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
1134
|
-
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
1135
|
-
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
1136
|
-
|
|
1137
|
-
// 2. 读取文本内容
|
|
1138
|
-
const text = str.getState_Text();
|
|
1139
|
-
|
|
1140
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
1141
|
-
await eda.pcb_PrimitiveString.delete([str.getState_PrimitiveId()]);
|
|
1142
|
-
|
|
1143
|
-
console.log('text:', text);
|
|
1144
|
-
```
|
|
1145
|
-
|
|
1146
|
-
### getstate_x
|
|
1147
|
-
|
|
1148
|
-
# IPCB\_PrimitiveString.getState\_X() method
|
|
1149
|
-
|
|
1150
|
-
Get the property state: X coordinate
|
|
1151
|
-
|
|
1152
|
-
## Signature
|
|
1153
|
-
|
|
1154
|
-
```typescript
|
|
1155
|
-
function getState_X(): number;
|
|
1156
|
-
```
|
|
1157
|
-
|
|
1158
|
-
## Returns
|
|
1159
|
-
|
|
1160
|
-
number
|
|
1161
|
-
|
|
1162
|
-
X coordinate
|
|
1163
|
-
|
|
1164
|
-
## Example
|
|
1165
|
-
|
|
1166
|
-
```javascript
|
|
1167
|
-
// 1. 在顶层丝印(3)放置一行文本
|
|
1168
|
-
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
1169
|
-
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
1170
|
-
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
1171
|
-
|
|
1172
|
-
// 2. 读取锚点 X 坐标
|
|
1173
|
-
const anchorX = str.getState_X();
|
|
1174
|
-
|
|
1175
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
1176
|
-
await eda.pcb_PrimitiveString.delete([str.getState_PrimitiveId()]);
|
|
1177
|
-
|
|
1178
|
-
console.log('x:', anchorX);
|
|
1179
|
-
```
|
|
1180
|
-
|
|
1181
|
-
### getstate_y
|
|
1182
|
-
|
|
1183
|
-
# IPCB\_PrimitiveString.getState\_Y() method
|
|
1184
|
-
|
|
1185
|
-
Get the property state: Y coordinate
|
|
1186
|
-
|
|
1187
|
-
## Signature
|
|
1188
|
-
|
|
1189
|
-
```typescript
|
|
1190
|
-
function getState_Y(): number;
|
|
1191
|
-
```
|
|
1192
|
-
|
|
1193
|
-
## Returns
|
|
1194
|
-
|
|
1195
|
-
number
|
|
1196
|
-
|
|
1197
|
-
Y coordinate
|
|
1198
|
-
|
|
1199
|
-
## Example
|
|
1200
|
-
|
|
1201
|
-
```javascript
|
|
1202
|
-
// 1. 在顶层丝印(3)放置一行文本
|
|
1203
|
-
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
1204
|
-
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
1205
|
-
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
1206
|
-
|
|
1207
|
-
// 2. 读取锚点 Y 坐标
|
|
1208
|
-
const anchorY = str.getState_Y();
|
|
1209
|
-
|
|
1210
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
1211
|
-
await eda.pcb_PrimitiveString.delete([str.getState_PrimitiveId()]);
|
|
1212
|
-
|
|
1213
|
-
console.log('y:', anchorY);
|
|
1214
|
-
```
|
|
1215
|
-
|
|
1216
|
-
### isasync
|
|
1217
|
-
|
|
1218
|
-
# IPCB\_PrimitiveString.isAsync() method
|
|
1219
|
-
|
|
1220
|
-
Query whether the primitive is an async primitive
|
|
1221
|
-
|
|
1222
|
-
## Signature
|
|
1223
|
-
|
|
1224
|
-
```typescript
|
|
1225
|
-
function isAsync(): boolean;
|
|
1226
|
-
```
|
|
1227
|
-
|
|
1228
|
-
## Returns
|
|
1229
|
-
|
|
1230
|
-
boolean
|
|
1231
|
-
|
|
1232
|
-
Whether Is async primitive
|
|
1233
|
-
|
|
1234
|
-
## Example
|
|
1235
|
-
|
|
1236
|
-
```javascript
|
|
1237
|
-
// 1. 在顶层丝印(3)放置一行文本
|
|
1238
|
-
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
1239
|
-
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
1240
|
-
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
1241
|
-
|
|
1242
|
-
// 2. 查询异步模式
|
|
1243
|
-
const isAsync = str.isAsync();
|
|
1244
|
-
|
|
1245
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
1246
|
-
await eda.pcb_PrimitiveString.delete([str.getState_PrimitiveId()]);
|
|
1247
|
-
|
|
1248
|
-
console.log('isAsync:', isAsync);
|
|
1249
|
-
```
|
|
1250
|
-
|
|
1251
|
-
### reset
|
|
1252
|
-
|
|
1253
|
-
# IPCB\_PrimitiveString.reset() 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
|
-
Reset the async primitive to the current canvas state
|
|
1258
|
-
|
|
1259
|
-
## Signature
|
|
1260
|
-
|
|
1261
|
-
```typescript
|
|
1262
|
-
function reset(): Promise<IPCB_PrimitiveString>;
|
|
1263
|
-
```
|
|
1264
|
-
|
|
1265
|
-
## Returns
|
|
1266
|
-
|
|
1267
|
-
Promise<[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)<!-- -->>
|
|
1268
|
-
|
|
1269
|
-
This primitive object
|
|
1270
|
-
|
|
1271
|
-
## Example
|
|
1272
|
-
|
|
1273
|
-
```javascript
|
|
1274
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
|
|
1275
|
-
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
1276
|
-
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
1277
|
-
|
|
1278
|
-
// 2. 在顶层丝印(3)放置一行不旋转的文本
|
|
1279
|
-
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
1280
|
-
const before = str.getState_Rotation();
|
|
1281
|
-
|
|
1282
|
-
// 3. 异步模式下把文本旋转 90°,随后反悔(不调 done())
|
|
1283
|
-
const asyncStr = str.toAsync();
|
|
1284
|
-
asyncStr.setState_Rotation(90);
|
|
1285
|
-
|
|
1286
|
-
// 4. reset 丢弃未提交的修改(保留现场供观察)
|
|
1287
|
-
await asyncStr.reset();
|
|
1288
|
-
|
|
1289
|
-
// 5. 从画布重新读取,确认旋转角度没有变
|
|
1290
|
-
const refetched = await eda.pcb_PrimitiveString.get(str.getState_PrimitiveId());
|
|
1291
|
-
|
|
1292
|
-
console.log('rotation:', before, '→', refetched.getState_Rotation());
|
|
1293
|
-
```
|
|
1294
|
-
|
|
1295
|
-
### setstate_alignmode
|
|
1296
|
-
|
|
1297
|
-
# IPCB\_PrimitiveString.setState\_AlignMode() method
|
|
1298
|
-
|
|
1299
|
-
> 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.
|
|
1300
|
-
|
|
1301
|
-
Set the property state: alignment mode
|
|
1302
|
-
|
|
1303
|
-
## Signature
|
|
1304
|
-
|
|
1305
|
-
```typescript
|
|
1306
|
-
function setState_AlignMode(alignMode: EPCB_PrimitiveStringAlignMode): IPCB_PrimitiveString;
|
|
1307
|
-
```
|
|
1308
|
-
|
|
1309
|
-
## Parameters
|
|
1310
|
-
|
|
1311
|
-
<table><thead><tr><th>
|
|
1312
|
-
|
|
1313
|
-
Parameter
|
|
1314
|
-
|
|
1315
|
-
</th><th>
|
|
1316
|
-
|
|
1317
|
-
Type
|
|
1318
|
-
|
|
1319
|
-
</th><th>
|
|
1320
|
-
|
|
1321
|
-
Description
|
|
1322
|
-
|
|
1323
|
-
</th></tr></thead>
|
|
1324
|
-
<tbody><tr><td>
|
|
1325
|
-
|
|
1326
|
-
alignMode
|
|
1327
|
-
|
|
1328
|
-
</td><td>
|
|
1329
|
-
|
|
1330
|
-
[EPCB\_PrimitiveStringAlignMode](../enums/EPCB_PrimitiveStringAlignMode.md)
|
|
1331
|
-
|
|
1332
|
-
</td><td>
|
|
1333
|
-
|
|
1334
|
-
Alignment mode
|
|
1335
|
-
|
|
1336
|
-
</td></tr>
|
|
1337
|
-
</tbody></table>
|
|
1338
|
-
|
|
1339
|
-
## Returns
|
|
1340
|
-
|
|
1341
|
-
[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)
|
|
1342
|
-
|
|
1343
|
-
Text primitive object
|
|
1344
|
-
|
|
1345
|
-
## Example
|
|
1346
|
-
|
|
1347
|
-
```javascript
|
|
1348
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
|
|
1349
|
-
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
1350
|
-
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
1351
|
-
|
|
1352
|
-
// 2. 在顶层丝印(3)放置一行左下(3)对齐的文本
|
|
1353
|
-
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
1354
|
-
const before = str.getState_AlignMode();
|
|
1355
|
-
|
|
1356
|
-
// 3. 异步模式把对齐模式改为居中(5)
|
|
1357
|
-
const asyncStr = str.toAsync();
|
|
1358
|
-
asyncStr.setState_AlignMode(5);
|
|
1359
|
-
await asyncStr.done();
|
|
1360
|
-
|
|
1361
|
-
// 4. 从画布重新读取,确认修改生效(保留现场供观察)
|
|
1362
|
-
const refetched = await eda.pcb_PrimitiveString.get(str.getState_PrimitiveId());
|
|
1363
|
-
|
|
1364
|
-
console.log('alignMode:', before, '→', refetched.getState_AlignMode());
|
|
1365
|
-
```
|
|
1366
|
-
|
|
1367
|
-
### setstate_expansion
|
|
1368
|
-
|
|
1369
|
-
# IPCB\_PrimitiveString.setState\_Expansion() method
|
|
1370
|
-
|
|
1371
|
-
> 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.
|
|
1372
|
-
|
|
1373
|
-
Set the property state: inverted expansion
|
|
1374
|
-
|
|
1375
|
-
## Signature
|
|
1376
|
-
|
|
1377
|
-
```typescript
|
|
1378
|
-
function setState_Expansion(expansion: number): IPCB_PrimitiveString;
|
|
1379
|
-
```
|
|
1380
|
-
|
|
1381
|
-
## Parameters
|
|
1382
|
-
|
|
1383
|
-
<table><thead><tr><th>
|
|
1384
|
-
|
|
1385
|
-
Parameter
|
|
1386
|
-
|
|
1387
|
-
</th><th>
|
|
1388
|
-
|
|
1389
|
-
Type
|
|
1390
|
-
|
|
1391
|
-
</th><th>
|
|
1392
|
-
|
|
1393
|
-
Description
|
|
1394
|
-
|
|
1395
|
-
</th></tr></thead>
|
|
1396
|
-
<tbody><tr><td>
|
|
1397
|
-
|
|
1398
|
-
expansion
|
|
1399
|
-
|
|
1400
|
-
</td><td>
|
|
1401
|
-
|
|
1402
|
-
number
|
|
1403
|
-
|
|
1404
|
-
</td><td>
|
|
1405
|
-
|
|
1406
|
-
Inverted expansion
|
|
1407
|
-
|
|
1408
|
-
</td></tr>
|
|
1409
|
-
</tbody></table>
|
|
1410
|
-
|
|
1411
|
-
## Returns
|
|
1412
|
-
|
|
1413
|
-
[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)
|
|
1414
|
-
|
|
1415
|
-
Text primitive object
|
|
1416
|
-
|
|
1417
|
-
## Example
|
|
1418
|
-
|
|
1419
|
-
```javascript
|
|
1420
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
|
|
1421
|
-
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
1422
|
-
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
1423
|
-
|
|
1424
|
-
// 2. 在顶层丝印(3)放置一行反相扩展为 0 的文本
|
|
1425
|
-
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
1426
|
-
const before = str.getState_Expansion();
|
|
1427
|
-
|
|
1428
|
-
// 3. 异步模式把反相扩展加大到 10
|
|
1429
|
-
const asyncStr = str.toAsync();
|
|
1430
|
-
asyncStr.setState_Expansion(10);
|
|
1431
|
-
await asyncStr.done();
|
|
1432
|
-
|
|
1433
|
-
// 4. 从画布重新读取,确认修改生效(保留现场供观察)
|
|
1434
|
-
const refetched = await eda.pcb_PrimitiveString.get(str.getState_PrimitiveId());
|
|
1435
|
-
|
|
1436
|
-
console.log('expansion:', before, '→', refetched.getState_Expansion());
|
|
1437
|
-
```
|
|
1438
|
-
|
|
1439
|
-
### setstate_fontfamily
|
|
1440
|
-
|
|
1441
|
-
# IPCB\_PrimitiveString.setState\_FontFamily() method
|
|
1442
|
-
|
|
1443
|
-
> 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.
|
|
1444
|
-
|
|
1445
|
-
Set the property state: font
|
|
1446
|
-
|
|
1447
|
-
## Signature
|
|
1448
|
-
|
|
1449
|
-
```typescript
|
|
1450
|
-
function setState_FontFamily(fontFamily: string): IPCB_PrimitiveString;
|
|
1451
|
-
```
|
|
1452
|
-
|
|
1453
|
-
## Parameters
|
|
1454
|
-
|
|
1455
|
-
<table><thead><tr><th>
|
|
1456
|
-
|
|
1457
|
-
Parameter
|
|
1458
|
-
|
|
1459
|
-
</th><th>
|
|
1460
|
-
|
|
1461
|
-
Type
|
|
1462
|
-
|
|
1463
|
-
</th><th>
|
|
1464
|
-
|
|
1465
|
-
Description
|
|
1466
|
-
|
|
1467
|
-
</th></tr></thead>
|
|
1468
|
-
<tbody><tr><td>
|
|
1469
|
-
|
|
1470
|
-
fontFamily
|
|
1471
|
-
|
|
1472
|
-
</td><td>
|
|
1473
|
-
|
|
1474
|
-
string
|
|
1475
|
-
|
|
1476
|
-
</td><td>
|
|
1477
|
-
|
|
1478
|
-
Font
|
|
1479
|
-
|
|
1480
|
-
</td></tr>
|
|
1481
|
-
</tbody></table>
|
|
1482
|
-
|
|
1483
|
-
## Returns
|
|
1484
|
-
|
|
1485
|
-
[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)
|
|
1486
|
-
|
|
1487
|
-
Text primitive object
|
|
1488
|
-
|
|
1489
|
-
## Example
|
|
1490
|
-
|
|
1491
|
-
```javascript
|
|
1492
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
|
|
1493
|
-
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
1494
|
-
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
1495
|
-
|
|
1496
|
-
// 2. 在顶层丝印(3)放置一行默认字体的文本
|
|
1497
|
-
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
1498
|
-
const before = str.getState_FontFamily();
|
|
1499
|
-
|
|
1500
|
-
// 3. 异步模式把字体换成 Arial
|
|
1501
|
-
const asyncStr = str.toAsync();
|
|
1502
|
-
asyncStr.setState_FontFamily('Arial');
|
|
1503
|
-
await asyncStr.done();
|
|
1504
|
-
|
|
1505
|
-
// 4. 从画布重新读取,确认修改生效(保留现场供观察)
|
|
1506
|
-
const refetched = await eda.pcb_PrimitiveString.get(str.getState_PrimitiveId());
|
|
1507
|
-
|
|
1508
|
-
console.log('fontFamily:', before, '→', refetched.getState_FontFamily());
|
|
1509
|
-
```
|
|
1510
|
-
|
|
1511
|
-
### setstate_fontsize
|
|
1512
|
-
|
|
1513
|
-
# IPCB\_PrimitiveString.setState\_FontSize() method
|
|
1514
|
-
|
|
1515
|
-
> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
|
1516
|
-
|
|
1517
|
-
Set the property state: font size
|
|
1518
|
-
|
|
1519
|
-
## Signature
|
|
1520
|
-
|
|
1521
|
-
```typescript
|
|
1522
|
-
function setState_FontSize(fontSize: number): IPCB_PrimitiveString;
|
|
1523
|
-
```
|
|
1524
|
-
|
|
1525
|
-
## Parameters
|
|
1526
|
-
|
|
1527
|
-
<table><thead><tr><th>
|
|
1528
|
-
|
|
1529
|
-
Parameter
|
|
1530
|
-
|
|
1531
|
-
</th><th>
|
|
1532
|
-
|
|
1533
|
-
Type
|
|
1534
|
-
|
|
1535
|
-
</th><th>
|
|
1536
|
-
|
|
1537
|
-
Description
|
|
1538
|
-
|
|
1539
|
-
</th></tr></thead>
|
|
1540
|
-
<tbody><tr><td>
|
|
1541
|
-
|
|
1542
|
-
fontSize
|
|
1543
|
-
|
|
1544
|
-
</td><td>
|
|
1545
|
-
|
|
1546
|
-
number
|
|
1547
|
-
|
|
1548
|
-
</td><td>
|
|
1549
|
-
|
|
1550
|
-
Font size
|
|
1551
|
-
|
|
1552
|
-
</td></tr>
|
|
1553
|
-
</tbody></table>
|
|
1554
|
-
|
|
1555
|
-
## Returns
|
|
1556
|
-
|
|
1557
|
-
[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)
|
|
1558
|
-
|
|
1559
|
-
Text primitive object
|
|
1560
|
-
|
|
1561
|
-
## Example
|
|
1562
|
-
|
|
1563
|
-
```javascript
|
|
1564
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
|
|
1565
|
-
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
1566
|
-
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
1567
|
-
|
|
1568
|
-
// 2. 在顶层丝印(3)放置一行 45mil 字号的文本
|
|
1569
|
-
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
1570
|
-
const before = str.getState_FontSize();
|
|
1571
|
-
|
|
1572
|
-
// 3. 异步模式把字号加大到 60
|
|
1573
|
-
const asyncStr = str.toAsync();
|
|
1574
|
-
asyncStr.setState_FontSize(60);
|
|
1575
|
-
await asyncStr.done();
|
|
1576
|
-
|
|
1577
|
-
// 4. 从画布重新读取,确认修改生效(保留现场供观察)
|
|
1578
|
-
const refetched = await eda.pcb_PrimitiveString.get(str.getState_PrimitiveId());
|
|
1579
|
-
|
|
1580
|
-
console.log('fontSize:', before, '→', refetched.getState_FontSize());
|
|
1581
|
-
```
|
|
1582
|
-
|
|
1583
|
-
### setstate_layer
|
|
1584
|
-
|
|
1585
|
-
# IPCB\_PrimitiveString.setState\_Layer() method
|
|
1586
|
-
|
|
1587
|
-
> 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.
|
|
1588
|
-
|
|
1589
|
-
Set the property state: Layer
|
|
1590
|
-
|
|
1591
|
-
## Signature
|
|
1592
|
-
|
|
1593
|
-
```typescript
|
|
1594
|
-
function setState_Layer(layer: TPCB_LayersOfImage): IPCB_PrimitiveString;
|
|
1595
|
-
```
|
|
1596
|
-
|
|
1597
|
-
## Parameters
|
|
1598
|
-
|
|
1599
|
-
<table><thead><tr><th>
|
|
1600
|
-
|
|
1601
|
-
Parameter
|
|
1602
|
-
|
|
1603
|
-
</th><th>
|
|
1604
|
-
|
|
1605
|
-
Type
|
|
1606
|
-
|
|
1607
|
-
</th><th>
|
|
1608
|
-
|
|
1609
|
-
Description
|
|
1610
|
-
|
|
1611
|
-
</th></tr></thead>
|
|
1612
|
-
<tbody><tr><td>
|
|
1613
|
-
|
|
1614
|
-
layer
|
|
1615
|
-
|
|
1616
|
-
</td><td>
|
|
1617
|
-
|
|
1618
|
-
[TPCB\_LayersOfImage](../types/TPCB_LayersOfImage.md)
|
|
1619
|
-
|
|
1620
|
-
</td><td>
|
|
1621
|
-
|
|
1622
|
-
Layer
|
|
1623
|
-
|
|
1624
|
-
</td></tr>
|
|
1625
|
-
</tbody></table>
|
|
1626
|
-
|
|
1627
|
-
## Returns
|
|
1628
|
-
|
|
1629
|
-
[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)
|
|
1630
|
-
|
|
1631
|
-
Text primitive object
|
|
1632
|
-
|
|
1633
|
-
## Example
|
|
1634
|
-
|
|
1635
|
-
```javascript
|
|
1636
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
|
|
1637
|
-
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
1638
|
-
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
1639
|
-
|
|
1640
|
-
// 2. 在顶层丝印(3)放置一行文本
|
|
1641
|
-
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
1642
|
-
const before = str.getState_Layer();
|
|
1643
|
-
|
|
1644
|
-
// 3. 异步模式把文本挪到底层丝印(4)
|
|
1645
|
-
const asyncStr = str.toAsync();
|
|
1646
|
-
asyncStr.setState_Layer(4);
|
|
1647
|
-
await asyncStr.done();
|
|
1648
|
-
|
|
1649
|
-
// 4. 从画布重新读取,确认层已切换(保留现场供观察)
|
|
1650
|
-
const refetched = await eda.pcb_PrimitiveString.get(str.getState_PrimitiveId());
|
|
1651
|
-
|
|
1652
|
-
console.log('layer:', before, '→', refetched.getState_Layer());
|
|
1653
|
-
```
|
|
1654
|
-
|
|
1655
|
-
### setstate_linewidth
|
|
1656
|
-
|
|
1657
|
-
# IPCB\_PrimitiveString.setState\_LineWidth() method
|
|
1658
|
-
|
|
1659
|
-
> 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.
|
|
1660
|
-
|
|
1661
|
-
Set the property state: Line width
|
|
1662
|
-
|
|
1663
|
-
## Signature
|
|
1664
|
-
|
|
1665
|
-
```typescript
|
|
1666
|
-
function setState_LineWidth(lineWidth: number): IPCB_PrimitiveString;
|
|
1667
|
-
```
|
|
1668
|
-
|
|
1669
|
-
## Parameters
|
|
1670
|
-
|
|
1671
|
-
<table><thead><tr><th>
|
|
1672
|
-
|
|
1673
|
-
Parameter
|
|
1674
|
-
|
|
1675
|
-
</th><th>
|
|
1676
|
-
|
|
1677
|
-
Type
|
|
1678
|
-
|
|
1679
|
-
</th><th>
|
|
1680
|
-
|
|
1681
|
-
Description
|
|
1682
|
-
|
|
1683
|
-
</th></tr></thead>
|
|
1684
|
-
<tbody><tr><td>
|
|
1685
|
-
|
|
1686
|
-
lineWidth
|
|
1687
|
-
|
|
1688
|
-
</td><td>
|
|
1689
|
-
|
|
1690
|
-
number
|
|
1691
|
-
|
|
1692
|
-
</td><td>
|
|
1693
|
-
|
|
1694
|
-
Line width
|
|
1695
|
-
|
|
1696
|
-
</td></tr>
|
|
1697
|
-
</tbody></table>
|
|
1698
|
-
|
|
1699
|
-
## Returns
|
|
1700
|
-
|
|
1701
|
-
[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)
|
|
1702
|
-
|
|
1703
|
-
Text primitive object
|
|
1704
|
-
|
|
1705
|
-
## Example
|
|
1706
|
-
|
|
1707
|
-
```javascript
|
|
1708
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
|
|
1709
|
-
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
1710
|
-
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
1711
|
-
|
|
1712
|
-
// 2. 在顶层丝印(3)放置一行笔画 6mil 的文本
|
|
1713
|
-
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
1714
|
-
const before = str.getState_LineWidth();
|
|
1715
|
-
|
|
1716
|
-
// 3. 异步模式把笔画加粗到 10
|
|
1717
|
-
const asyncStr = str.toAsync();
|
|
1718
|
-
asyncStr.setState_LineWidth(10);
|
|
1719
|
-
await asyncStr.done();
|
|
1720
|
-
|
|
1721
|
-
// 4. 从画布重新读取,确认修改生效(保留现场供观察)
|
|
1722
|
-
const refetched = await eda.pcb_PrimitiveString.get(str.getState_PrimitiveId());
|
|
1723
|
-
|
|
1724
|
-
console.log('lineWidth:', before, '→', refetched.getState_LineWidth());
|
|
1725
|
-
```
|
|
1726
|
-
|
|
1727
|
-
### setstate_mirror
|
|
1728
|
-
|
|
1729
|
-
# IPCB\_PrimitiveString.setState\_Mirror() method
|
|
1730
|
-
|
|
1731
|
-
> 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.
|
|
1732
|
-
|
|
1733
|
-
Set the property state: whether it is mirrored
|
|
1734
|
-
|
|
1735
|
-
## Signature
|
|
1736
|
-
|
|
1737
|
-
```typescript
|
|
1738
|
-
function setState_Mirror(mirror: boolean): IPCB_PrimitiveString;
|
|
1739
|
-
```
|
|
1740
|
-
|
|
1741
|
-
## Parameters
|
|
1742
|
-
|
|
1743
|
-
<table><thead><tr><th>
|
|
1744
|
-
|
|
1745
|
-
Parameter
|
|
1746
|
-
|
|
1747
|
-
</th><th>
|
|
1748
|
-
|
|
1749
|
-
Type
|
|
1750
|
-
|
|
1751
|
-
</th><th>
|
|
1752
|
-
|
|
1753
|
-
Description
|
|
1754
|
-
|
|
1755
|
-
</th></tr></thead>
|
|
1756
|
-
<tbody><tr><td>
|
|
1757
|
-
|
|
1758
|
-
mirror
|
|
1759
|
-
|
|
1760
|
-
</td><td>
|
|
1761
|
-
|
|
1762
|
-
boolean
|
|
1763
|
-
|
|
1764
|
-
</td><td>
|
|
1765
|
-
|
|
1766
|
-
Whether it is mirrored
|
|
1767
|
-
|
|
1768
|
-
</td></tr>
|
|
1769
|
-
</tbody></table>
|
|
1770
|
-
|
|
1771
|
-
## Returns
|
|
1772
|
-
|
|
1773
|
-
[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)
|
|
1774
|
-
|
|
1775
|
-
Text primitive object
|
|
1776
|
-
|
|
1777
|
-
## Example
|
|
1778
|
-
|
|
1779
|
-
```javascript
|
|
1780
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
|
|
1781
|
-
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
1782
|
-
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
1783
|
-
|
|
1784
|
-
// 2. 在顶层丝印(3)放置一行不镜像的文本
|
|
1785
|
-
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
1786
|
-
const before = str.getState_Mirror();
|
|
1787
|
-
|
|
1788
|
-
// 3. 异步模式开启镜像
|
|
1789
|
-
const asyncStr = str.toAsync();
|
|
1790
|
-
asyncStr.setState_Mirror(true);
|
|
1791
|
-
await asyncStr.done();
|
|
1792
|
-
|
|
1793
|
-
// 4. 从画布重新读取,确认修改生效(保留现场供观察)
|
|
1794
|
-
const refetched = await eda.pcb_PrimitiveString.get(str.getState_PrimitiveId());
|
|
1795
|
-
|
|
1796
|
-
console.log('mirror:', before, '→', refetched.getState_Mirror());
|
|
1797
|
-
```
|
|
1798
|
-
|
|
1799
|
-
### setstate_primitivelock
|
|
1800
|
-
|
|
1801
|
-
# IPCB\_PrimitiveString.setState\_PrimitiveLock() method
|
|
1802
|
-
|
|
1803
|
-
> 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.
|
|
1804
|
-
|
|
1805
|
-
Set the property state: whether it is locked
|
|
1806
|
-
|
|
1807
|
-
## Signature
|
|
1808
|
-
|
|
1809
|
-
```typescript
|
|
1810
|
-
function setState_PrimitiveLock(primitiveLock: boolean): IPCB_PrimitiveString;
|
|
1811
|
-
```
|
|
1812
|
-
|
|
1813
|
-
## Parameters
|
|
1814
|
-
|
|
1815
|
-
<table><thead><tr><th>
|
|
1816
|
-
|
|
1817
|
-
Parameter
|
|
1818
|
-
|
|
1819
|
-
</th><th>
|
|
1820
|
-
|
|
1821
|
-
Type
|
|
1822
|
-
|
|
1823
|
-
</th><th>
|
|
1824
|
-
|
|
1825
|
-
Description
|
|
1826
|
-
|
|
1827
|
-
</th></tr></thead>
|
|
1828
|
-
<tbody><tr><td>
|
|
1829
|
-
|
|
1830
|
-
primitiveLock
|
|
1831
|
-
|
|
1832
|
-
</td><td>
|
|
1833
|
-
|
|
1834
|
-
boolean
|
|
1835
|
-
|
|
1836
|
-
</td><td>
|
|
1837
|
-
|
|
1838
|
-
Whether it is locked
|
|
1839
|
-
|
|
1840
|
-
</td></tr>
|
|
1841
|
-
</tbody></table>
|
|
1842
|
-
|
|
1843
|
-
## Returns
|
|
1844
|
-
|
|
1845
|
-
[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)
|
|
1846
|
-
|
|
1847
|
-
Text primitive object
|
|
1848
|
-
|
|
1849
|
-
## Example
|
|
1850
|
-
|
|
1851
|
-
```javascript
|
|
1852
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
|
|
1853
|
-
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
1854
|
-
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
1855
|
-
|
|
1856
|
-
// 2. 在顶层丝印(3)放置一行未锁定的文本
|
|
1857
|
-
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
1858
|
-
const before = str.getState_PrimitiveLock();
|
|
1859
|
-
|
|
1860
|
-
// 3. 异步模式锁定文本
|
|
1861
|
-
const asyncStr = str.toAsync();
|
|
1862
|
-
asyncStr.setState_PrimitiveLock(true);
|
|
1863
|
-
await asyncStr.done();
|
|
1864
|
-
|
|
1865
|
-
// 4. 从画布重新读取,确认修改生效(保留现场供观察)
|
|
1866
|
-
const refetched = await eda.pcb_PrimitiveString.get(str.getState_PrimitiveId());
|
|
1867
|
-
|
|
1868
|
-
console.log('primitiveLock:', before, '→', refetched.getState_PrimitiveLock());
|
|
1869
|
-
```
|
|
1870
|
-
|
|
1871
|
-
### setstate_reverse
|
|
1872
|
-
|
|
1873
|
-
# IPCB\_PrimitiveString.setState\_Reverse() method
|
|
1874
|
-
|
|
1875
|
-
> 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.
|
|
1876
|
-
|
|
1877
|
-
Set the property state: whether it is inverted
|
|
1878
|
-
|
|
1879
|
-
## Signature
|
|
1880
|
-
|
|
1881
|
-
```typescript
|
|
1882
|
-
function setState_Reverse(reverse: boolean): IPCB_PrimitiveString;
|
|
1883
|
-
```
|
|
1884
|
-
|
|
1885
|
-
## Parameters
|
|
1886
|
-
|
|
1887
|
-
<table><thead><tr><th>
|
|
1888
|
-
|
|
1889
|
-
Parameter
|
|
1890
|
-
|
|
1891
|
-
</th><th>
|
|
1892
|
-
|
|
1893
|
-
Type
|
|
1894
|
-
|
|
1895
|
-
</th><th>
|
|
1896
|
-
|
|
1897
|
-
Description
|
|
1898
|
-
|
|
1899
|
-
</th></tr></thead>
|
|
1900
|
-
<tbody><tr><td>
|
|
1901
|
-
|
|
1902
|
-
reverse
|
|
1903
|
-
|
|
1904
|
-
</td><td>
|
|
1905
|
-
|
|
1906
|
-
boolean
|
|
1907
|
-
|
|
1908
|
-
</td><td>
|
|
1909
|
-
|
|
1910
|
-
Whether it is inverted
|
|
1911
|
-
|
|
1912
|
-
</td></tr>
|
|
1913
|
-
</tbody></table>
|
|
1914
|
-
|
|
1915
|
-
## Returns
|
|
1916
|
-
|
|
1917
|
-
[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)
|
|
1918
|
-
|
|
1919
|
-
Text primitive object
|
|
1920
|
-
|
|
1921
|
-
## Remarks
|
|
1922
|
-
|
|
1923
|
-
The default font does not support inversion
|
|
1924
|
-
|
|
1925
|
-
## Example
|
|
1926
|
-
|
|
1927
|
-
```javascript
|
|
1928
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
|
|
1929
|
-
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
1930
|
-
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
1931
|
-
|
|
1932
|
-
// 2. 在顶层丝印(3)放置一行默认字体的文本(默认字体不支持反相)
|
|
1933
|
-
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
1934
|
-
const before = str.getState_Reverse();
|
|
1935
|
-
|
|
1936
|
-
// 3. 异步模式先换 Arial 字体再开启反相,一次 done() 同时提交两个修改
|
|
1937
|
-
const asyncStr = str.toAsync();
|
|
1938
|
-
asyncStr.setState_FontFamily('Arial');
|
|
1939
|
-
asyncStr.setState_Reverse(true);
|
|
1940
|
-
await asyncStr.done();
|
|
1941
|
-
|
|
1942
|
-
// 4. 从画布重新读取,确认修改生效(保留现场供观察)
|
|
1943
|
-
const refetched = await eda.pcb_PrimitiveString.get(str.getState_PrimitiveId());
|
|
1944
|
-
|
|
1945
|
-
console.log('reverse:', before, '→', refetched.getState_Reverse());
|
|
1946
|
-
console.log('fontFamily:', refetched.getState_FontFamily());
|
|
1947
|
-
```
|
|
1948
|
-
|
|
1949
|
-
### setstate_rotation
|
|
1950
|
-
|
|
1951
|
-
# IPCB\_PrimitiveString.setState\_Rotation() method
|
|
1952
|
-
|
|
1953
|
-
> 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.
|
|
1954
|
-
|
|
1955
|
-
Set the property state: rotation angle
|
|
1956
|
-
|
|
1957
|
-
## Signature
|
|
1958
|
-
|
|
1959
|
-
```typescript
|
|
1960
|
-
function setState_Rotation(rotation: number): IPCB_PrimitiveString;
|
|
1961
|
-
```
|
|
1962
|
-
|
|
1963
|
-
## Parameters
|
|
1964
|
-
|
|
1965
|
-
<table><thead><tr><th>
|
|
1966
|
-
|
|
1967
|
-
Parameter
|
|
1968
|
-
|
|
1969
|
-
</th><th>
|
|
1970
|
-
|
|
1971
|
-
Type
|
|
1972
|
-
|
|
1973
|
-
</th><th>
|
|
1974
|
-
|
|
1975
|
-
Description
|
|
1976
|
-
|
|
1977
|
-
</th></tr></thead>
|
|
1978
|
-
<tbody><tr><td>
|
|
1979
|
-
|
|
1980
|
-
rotation
|
|
1981
|
-
|
|
1982
|
-
</td><td>
|
|
1983
|
-
|
|
1984
|
-
number
|
|
1985
|
-
|
|
1986
|
-
</td><td>
|
|
1987
|
-
|
|
1988
|
-
Rotation angle
|
|
1989
|
-
|
|
1990
|
-
</td></tr>
|
|
1991
|
-
</tbody></table>
|
|
1992
|
-
|
|
1993
|
-
## Returns
|
|
1994
|
-
|
|
1995
|
-
[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)
|
|
1996
|
-
|
|
1997
|
-
Text primitive object
|
|
1998
|
-
|
|
1999
|
-
## Example
|
|
2000
|
-
|
|
2001
|
-
```javascript
|
|
2002
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
|
|
2003
|
-
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
2004
|
-
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
2005
|
-
|
|
2006
|
-
// 2. 在顶层丝印(3)放置一行不旋转(0°)的文本
|
|
2007
|
-
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
2008
|
-
const before = str.getState_Rotation();
|
|
2009
|
-
|
|
2010
|
-
// 3. 异步模式把文本旋转 90°(竖排)
|
|
2011
|
-
const asyncStr = str.toAsync();
|
|
2012
|
-
asyncStr.setState_Rotation(90);
|
|
2013
|
-
await asyncStr.done();
|
|
2014
|
-
|
|
2015
|
-
// 4. 从画布重新读取,确认修改生效(保留现场供观察)
|
|
2016
|
-
const refetched = await eda.pcb_PrimitiveString.get(str.getState_PrimitiveId());
|
|
2017
|
-
|
|
2018
|
-
console.log('rotation:', before, '→', refetched.getState_Rotation());
|
|
2019
|
-
```
|
|
2020
|
-
|
|
2021
|
-
### setstate_text
|
|
2022
|
-
|
|
2023
|
-
# IPCB\_PrimitiveString.setState\_Text() method
|
|
2024
|
-
|
|
2025
|
-
> 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.
|
|
2026
|
-
|
|
2027
|
-
Set the property state: text content
|
|
2028
|
-
|
|
2029
|
-
## Signature
|
|
2030
|
-
|
|
2031
|
-
```typescript
|
|
2032
|
-
function setState_Text(text: string): IPCB_PrimitiveString;
|
|
2033
|
-
```
|
|
2034
|
-
|
|
2035
|
-
## Parameters
|
|
2036
|
-
|
|
2037
|
-
<table><thead><tr><th>
|
|
2038
|
-
|
|
2039
|
-
Parameter
|
|
2040
|
-
|
|
2041
|
-
</th><th>
|
|
2042
|
-
|
|
2043
|
-
Type
|
|
2044
|
-
|
|
2045
|
-
</th><th>
|
|
2046
|
-
|
|
2047
|
-
Description
|
|
2048
|
-
|
|
2049
|
-
</th></tr></thead>
|
|
2050
|
-
<tbody><tr><td>
|
|
2051
|
-
|
|
2052
|
-
text
|
|
2053
|
-
|
|
2054
|
-
</td><td>
|
|
2055
|
-
|
|
2056
|
-
string
|
|
2057
|
-
|
|
2058
|
-
</td><td>
|
|
2059
|
-
|
|
2060
|
-
Text content
|
|
2061
|
-
|
|
2062
|
-
</td></tr>
|
|
2063
|
-
</tbody></table>
|
|
2064
|
-
|
|
2065
|
-
## Returns
|
|
2066
|
-
|
|
2067
|
-
[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)
|
|
2068
|
-
|
|
2069
|
-
Text primitive object
|
|
2070
|
-
|
|
2071
|
-
## Example
|
|
2072
|
-
|
|
2073
|
-
```javascript
|
|
2074
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
|
|
2075
|
-
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
2076
|
-
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
2077
|
-
|
|
2078
|
-
// 2. 在顶层丝印(3)放置一行文本
|
|
2079
|
-
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_V1.0', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
2080
|
-
const before = str.getState_Text();
|
|
2081
|
-
|
|
2082
|
-
// 3. 异步模式把内容改为新版本号
|
|
2083
|
-
const asyncStr = str.toAsync();
|
|
2084
|
-
asyncStr.setState_Text('嘉立创示例_V2.0');
|
|
2085
|
-
await asyncStr.done();
|
|
2086
|
-
|
|
2087
|
-
// 4. 从画布重新读取,确认修改生效(保留现场供观察)
|
|
2088
|
-
const refetched = await eda.pcb_PrimitiveString.get(str.getState_PrimitiveId());
|
|
2089
|
-
|
|
2090
|
-
console.log('text:', before, '→', refetched.getState_Text());
|
|
2091
|
-
```
|
|
2092
|
-
|
|
2093
|
-
### setstate_x
|
|
2094
|
-
|
|
2095
|
-
# IPCB\_PrimitiveString.setState\_X() method
|
|
2096
|
-
|
|
2097
|
-
> 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.
|
|
2098
|
-
|
|
2099
|
-
Set the property state: X coordinate
|
|
2100
|
-
|
|
2101
|
-
## Signature
|
|
2102
|
-
|
|
2103
|
-
```typescript
|
|
2104
|
-
function setState_X(x: number): IPCB_PrimitiveString;
|
|
2105
|
-
```
|
|
2106
|
-
|
|
2107
|
-
## Parameters
|
|
2108
|
-
|
|
2109
|
-
<table><thead><tr><th>
|
|
2110
|
-
|
|
2111
|
-
Parameter
|
|
2112
|
-
|
|
2113
|
-
</th><th>
|
|
2114
|
-
|
|
2115
|
-
Type
|
|
2116
|
-
|
|
2117
|
-
</th><th>
|
|
2118
|
-
|
|
2119
|
-
Description
|
|
2120
|
-
|
|
2121
|
-
</th></tr></thead>
|
|
2122
|
-
<tbody><tr><td>
|
|
2123
|
-
|
|
2124
|
-
x
|
|
2125
|
-
|
|
2126
|
-
</td><td>
|
|
2127
|
-
|
|
2128
|
-
number
|
|
2129
|
-
|
|
2130
|
-
</td><td>
|
|
2131
|
-
|
|
2132
|
-
X coordinate
|
|
2133
|
-
|
|
2134
|
-
</td></tr>
|
|
2135
|
-
</tbody></table>
|
|
2136
|
-
|
|
2137
|
-
## Returns
|
|
2138
|
-
|
|
2139
|
-
[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)
|
|
2140
|
-
|
|
2141
|
-
Text primitive object
|
|
2142
|
-
|
|
2143
|
-
## Example
|
|
2144
|
-
|
|
2145
|
-
```javascript
|
|
2146
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
|
|
2147
|
-
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
2148
|
-
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
2149
|
-
|
|
2150
|
-
// 2. 在顶层丝印(3)放置一行文本
|
|
2151
|
-
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
2152
|
-
const before = str.getState_X();
|
|
2153
|
-
|
|
2154
|
-
// 3. 异步模式把锚点向右平移 500mil
|
|
2155
|
-
const asyncStr = str.toAsync();
|
|
2156
|
-
asyncStr.setState_X(before + 500);
|
|
2157
|
-
await asyncStr.done();
|
|
2158
|
-
|
|
2159
|
-
// 4. 从画布重新读取,确认修改生效(保留现场供观察)
|
|
2160
|
-
const refetched = await eda.pcb_PrimitiveString.get(str.getState_PrimitiveId());
|
|
2161
|
-
|
|
2162
|
-
console.log('x:', before, '→', refetched.getState_X());
|
|
2163
|
-
```
|
|
2164
|
-
|
|
2165
|
-
### setstate_y
|
|
2166
|
-
|
|
2167
|
-
# IPCB\_PrimitiveString.setState\_Y() method
|
|
2168
|
-
|
|
2169
|
-
> 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.
|
|
2170
|
-
|
|
2171
|
-
Set the property state: Y coordinate
|
|
2172
|
-
|
|
2173
|
-
## Signature
|
|
2174
|
-
|
|
2175
|
-
```typescript
|
|
2176
|
-
function setState_Y(y: number): IPCB_PrimitiveString;
|
|
2177
|
-
```
|
|
2178
|
-
|
|
2179
|
-
## Parameters
|
|
2180
|
-
|
|
2181
|
-
<table><thead><tr><th>
|
|
2182
|
-
|
|
2183
|
-
Parameter
|
|
2184
|
-
|
|
2185
|
-
</th><th>
|
|
2186
|
-
|
|
2187
|
-
Type
|
|
2188
|
-
|
|
2189
|
-
</th><th>
|
|
2190
|
-
|
|
2191
|
-
Description
|
|
2192
|
-
|
|
2193
|
-
</th></tr></thead>
|
|
2194
|
-
<tbody><tr><td>
|
|
2195
|
-
|
|
2196
|
-
y
|
|
2197
|
-
|
|
2198
|
-
</td><td>
|
|
2199
|
-
|
|
2200
|
-
number
|
|
2201
|
-
|
|
2202
|
-
</td><td>
|
|
2203
|
-
|
|
2204
|
-
Y coordinate
|
|
2205
|
-
|
|
2206
|
-
</td></tr>
|
|
2207
|
-
</tbody></table>
|
|
2208
|
-
|
|
2209
|
-
## Returns
|
|
2210
|
-
|
|
2211
|
-
[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)
|
|
2212
|
-
|
|
2213
|
-
Text primitive object
|
|
2214
|
-
|
|
2215
|
-
## Example
|
|
2216
|
-
|
|
2217
|
-
```javascript
|
|
2218
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
|
|
2219
|
-
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
2220
|
-
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
2221
|
-
|
|
2222
|
-
// 2. 在顶层丝印(3)放置一行文本
|
|
2223
|
-
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
2224
|
-
const before = str.getState_Y();
|
|
2225
|
-
|
|
2226
|
-
// 3. 异步模式把锚点向上平移 500mil
|
|
2227
|
-
const asyncStr = str.toAsync();
|
|
2228
|
-
asyncStr.setState_Y(before + 500);
|
|
2229
|
-
await asyncStr.done();
|
|
2230
|
-
|
|
2231
|
-
// 4. 从画布重新读取,确认修改生效(保留现场供观察)
|
|
2232
|
-
const refetched = await eda.pcb_PrimitiveString.get(str.getState_PrimitiveId());
|
|
2233
|
-
|
|
2234
|
-
console.log('y:', before, '→', refetched.getState_Y());
|
|
2235
|
-
```
|
|
2236
|
-
|
|
2237
|
-
### toasync
|
|
2238
|
-
|
|
2239
|
-
# IPCB\_PrimitiveString.toAsync() method
|
|
2240
|
-
|
|
2241
|
-
Convert Primitive to Async primitive
|
|
2242
|
-
|
|
2243
|
-
## Signature
|
|
2244
|
-
|
|
2245
|
-
```typescript
|
|
2246
|
-
function toAsync(): IPCB_PrimitiveString;
|
|
2247
|
-
```
|
|
2248
|
-
|
|
2249
|
-
## Returns
|
|
2250
|
-
|
|
2251
|
-
[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)
|
|
2252
|
-
|
|
2253
|
-
Text primitive object
|
|
2254
|
-
|
|
2255
|
-
## Example
|
|
2256
|
-
|
|
2257
|
-
```javascript
|
|
2258
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
|
|
2259
|
-
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
2260
|
-
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
2261
|
-
|
|
2262
|
-
// 2. 在顶层丝印(3)放置一行文本
|
|
2263
|
-
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
2264
|
-
|
|
2265
|
-
// 3. 切换异步模式后批量修改:改内容 + 加大字号
|
|
2266
|
-
const asyncStr = str.toAsync();
|
|
2267
|
-
asyncStr.setState_Text('嘉立创示例_批量');
|
|
2268
|
-
asyncStr.setState_FontSize(60);
|
|
2269
|
-
await asyncStr.done();
|
|
2270
|
-
|
|
2271
|
-
// 4. 从画布重新读取,确认批量修改已生效(保留现场供观察)
|
|
2272
|
-
const refetched = await eda.pcb_PrimitiveString.get(str.getState_PrimitiveId());
|
|
2273
|
-
|
|
2274
|
-
console.log('text:', refetched.getState_Text());
|
|
2275
|
-
console.log('fontSize:', refetched.getState_FontSize());
|
|
2276
|
-
```
|
|
2277
|
-
|
|
2278
|
-
### tosync
|
|
2279
|
-
|
|
2280
|
-
# IPCB\_PrimitiveString.toSync() method
|
|
2281
|
-
|
|
2282
|
-
Convert Primitive to Sync primitive
|
|
2283
|
-
|
|
2284
|
-
## Signature
|
|
2285
|
-
|
|
2286
|
-
```typescript
|
|
2287
|
-
function toSync(): IPCB_PrimitiveString;
|
|
2288
|
-
```
|
|
2289
|
-
|
|
2290
|
-
## Returns
|
|
2291
|
-
|
|
2292
|
-
[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)
|
|
2293
|
-
|
|
2294
|
-
Text primitive object
|
|
2295
|
-
|
|
2296
|
-
## Example
|
|
2297
|
-
|
|
2298
|
-
```javascript
|
|
2299
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
|
|
2300
|
-
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
2301
|
-
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
2302
|
-
|
|
2303
|
-
// 2. 在顶层丝印(3)放置一行文本
|
|
2304
|
-
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
2305
|
-
const before = str.isAsync();
|
|
2306
|
-
|
|
2307
|
-
// 3. 转换为同步图元(保留现场供观察)
|
|
2308
|
-
const syncStr = str.toSync();
|
|
2309
|
-
const after = syncStr.isAsync();
|
|
2310
|
-
|
|
2311
|
-
// 4. 同步图元直接读取属性,无需提交
|
|
2312
|
-
console.log('isAsync:', before, '→', after);
|
|
2313
|
-
console.log('primitiveType:', syncStr.getState_PrimitiveType());
|
|
2314
|
-
console.log('layer:', syncStr.getState_Layer());
|
|
2315
|
-
```
|
|
1
|
+
# IPCB\_PrimitiveString class
|
|
2
|
+
|
|
3
|
+
Text primitive
|
|
4
|
+
|
|
5
|
+
## Signature
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
class IPCB_PrimitiveString implements IPCB_Primitive
|
|
9
|
+
```
|
|
10
|
+
**Implements:** [IPCB\_Primitive](../interfaces/IPCB_Primitive.md)
|
|
11
|
+
|
|
12
|
+
## Constructors
|
|
13
|
+
|
|
14
|
+
<table><thead><tr><th>
|
|
15
|
+
|
|
16
|
+
Constructor
|
|
17
|
+
|
|
18
|
+
</th><th>
|
|
19
|
+
|
|
20
|
+
Modifiers
|
|
21
|
+
|
|
22
|
+
</th><th>
|
|
23
|
+
|
|
24
|
+
Description
|
|
25
|
+
|
|
26
|
+
</th></tr></thead>
|
|
27
|
+
<tbody><tr><td>
|
|
28
|
+
|
|
29
|
+
[(constructor)(layer, x, y, text, fontFamily, fontSize, lineWidth, alignMode, rotation, reverse, expansion, mirror, primitiveLock, primitiveId)](./IPCB_PrimitiveString.md)
|
|
30
|
+
|
|
31
|
+
</td><td>
|
|
32
|
+
|
|
33
|
+
</td><td>
|
|
34
|
+
|
|
35
|
+
Constructs a new instance of the `IPCB_PrimitiveString` class
|
|
36
|
+
|
|
37
|
+
</td></tr>
|
|
38
|
+
</tbody></table>
|
|
39
|
+
|
|
40
|
+
## Methods
|
|
41
|
+
|
|
42
|
+
<table><thead><tr><th>
|
|
43
|
+
|
|
44
|
+
Method
|
|
45
|
+
|
|
46
|
+
</th><th>
|
|
47
|
+
|
|
48
|
+
Modifiers
|
|
49
|
+
|
|
50
|
+
</th><th>
|
|
51
|
+
|
|
52
|
+
Description
|
|
53
|
+
|
|
54
|
+
</th></tr></thead>
|
|
55
|
+
<tbody><tr><td>
|
|
56
|
+
|
|
57
|
+
[done()](./IPCB_PrimitiveString.md)
|
|
58
|
+
|
|
59
|
+
</td><td>
|
|
60
|
+
|
|
61
|
+
</td><td>
|
|
62
|
+
|
|
63
|
+
**_(BETA)_** Apply the changes to the primitives to the canvas
|
|
64
|
+
|
|
65
|
+
</td></tr>
|
|
66
|
+
<tr><td>
|
|
67
|
+
|
|
68
|
+
[getState\_AlignMode()](./IPCB_PrimitiveString.md)
|
|
69
|
+
|
|
70
|
+
</td><td>
|
|
71
|
+
|
|
72
|
+
</td><td>
|
|
73
|
+
|
|
74
|
+
Get the property state: alignment mode
|
|
75
|
+
|
|
76
|
+
</td></tr>
|
|
77
|
+
<tr><td>
|
|
78
|
+
|
|
79
|
+
[getState\_Expansion()](./IPCB_PrimitiveString.md)
|
|
80
|
+
|
|
81
|
+
</td><td>
|
|
82
|
+
|
|
83
|
+
</td><td>
|
|
84
|
+
|
|
85
|
+
Get the property state: inverted expansion
|
|
86
|
+
|
|
87
|
+
</td></tr>
|
|
88
|
+
<tr><td>
|
|
89
|
+
|
|
90
|
+
[getState\_FontFamily()](./IPCB_PrimitiveString.md)
|
|
91
|
+
|
|
92
|
+
</td><td>
|
|
93
|
+
|
|
94
|
+
</td><td>
|
|
95
|
+
|
|
96
|
+
Get the property state: font
|
|
97
|
+
|
|
98
|
+
</td></tr>
|
|
99
|
+
<tr><td>
|
|
100
|
+
|
|
101
|
+
[getState\_FontSize()](./IPCB_PrimitiveString.md)
|
|
102
|
+
|
|
103
|
+
</td><td>
|
|
104
|
+
|
|
105
|
+
</td><td>
|
|
106
|
+
|
|
107
|
+
Get the property state: font size
|
|
108
|
+
|
|
109
|
+
</td></tr>
|
|
110
|
+
<tr><td>
|
|
111
|
+
|
|
112
|
+
[getState\_Layer()](./IPCB_PrimitiveString.md)
|
|
113
|
+
|
|
114
|
+
</td><td>
|
|
115
|
+
|
|
116
|
+
</td><td>
|
|
117
|
+
|
|
118
|
+
Get the property state: Layer
|
|
119
|
+
|
|
120
|
+
</td></tr>
|
|
121
|
+
<tr><td>
|
|
122
|
+
|
|
123
|
+
[getState\_LineWidth()](./IPCB_PrimitiveString.md)
|
|
124
|
+
|
|
125
|
+
</td><td>
|
|
126
|
+
|
|
127
|
+
</td><td>
|
|
128
|
+
|
|
129
|
+
Get the property state: Line width
|
|
130
|
+
|
|
131
|
+
</td></tr>
|
|
132
|
+
<tr><td>
|
|
133
|
+
|
|
134
|
+
[getState\_Mirror()](./IPCB_PrimitiveString.md)
|
|
135
|
+
|
|
136
|
+
</td><td>
|
|
137
|
+
|
|
138
|
+
</td><td>
|
|
139
|
+
|
|
140
|
+
Get the property state: whether it is mirrored
|
|
141
|
+
|
|
142
|
+
</td></tr>
|
|
143
|
+
<tr><td>
|
|
144
|
+
|
|
145
|
+
[getState\_PrimitiveId()](./IPCB_PrimitiveString.md)
|
|
146
|
+
|
|
147
|
+
</td><td>
|
|
148
|
+
|
|
149
|
+
</td><td>
|
|
150
|
+
|
|
151
|
+
Get the property state: primitive ID
|
|
152
|
+
|
|
153
|
+
</td></tr>
|
|
154
|
+
<tr><td>
|
|
155
|
+
|
|
156
|
+
[getState\_PrimitiveLock()](./IPCB_PrimitiveString.md)
|
|
157
|
+
|
|
158
|
+
</td><td>
|
|
159
|
+
|
|
160
|
+
</td><td>
|
|
161
|
+
|
|
162
|
+
Get the property state: whether it is locked
|
|
163
|
+
|
|
164
|
+
</td></tr>
|
|
165
|
+
<tr><td>
|
|
166
|
+
|
|
167
|
+
[getState\_PrimitiveType()](./IPCB_PrimitiveString.md)
|
|
168
|
+
|
|
169
|
+
</td><td>
|
|
170
|
+
|
|
171
|
+
</td><td>
|
|
172
|
+
|
|
173
|
+
Get the property state: primitive type
|
|
174
|
+
|
|
175
|
+
</td></tr>
|
|
176
|
+
<tr><td>
|
|
177
|
+
|
|
178
|
+
[getState\_Reverse()](./IPCB_PrimitiveString.md)
|
|
179
|
+
|
|
180
|
+
</td><td>
|
|
181
|
+
|
|
182
|
+
</td><td>
|
|
183
|
+
|
|
184
|
+
Get the property state: whether it is inverted
|
|
185
|
+
|
|
186
|
+
</td></tr>
|
|
187
|
+
<tr><td>
|
|
188
|
+
|
|
189
|
+
[getState\_Rotation()](./IPCB_PrimitiveString.md)
|
|
190
|
+
|
|
191
|
+
</td><td>
|
|
192
|
+
|
|
193
|
+
</td><td>
|
|
194
|
+
|
|
195
|
+
Get the property state: rotation angle
|
|
196
|
+
|
|
197
|
+
</td></tr>
|
|
198
|
+
<tr><td>
|
|
199
|
+
|
|
200
|
+
[getState\_Text()](./IPCB_PrimitiveString.md)
|
|
201
|
+
|
|
202
|
+
</td><td>
|
|
203
|
+
|
|
204
|
+
</td><td>
|
|
205
|
+
|
|
206
|
+
Get the property state: text content
|
|
207
|
+
|
|
208
|
+
</td></tr>
|
|
209
|
+
<tr><td>
|
|
210
|
+
|
|
211
|
+
[getState\_X()](./IPCB_PrimitiveString.md)
|
|
212
|
+
|
|
213
|
+
</td><td>
|
|
214
|
+
|
|
215
|
+
</td><td>
|
|
216
|
+
|
|
217
|
+
Get the property state: X coordinate
|
|
218
|
+
|
|
219
|
+
</td></tr>
|
|
220
|
+
<tr><td>
|
|
221
|
+
|
|
222
|
+
[getState\_Y()](./IPCB_PrimitiveString.md)
|
|
223
|
+
|
|
224
|
+
</td><td>
|
|
225
|
+
|
|
226
|
+
</td><td>
|
|
227
|
+
|
|
228
|
+
Get the property state: Y coordinate
|
|
229
|
+
|
|
230
|
+
</td></tr>
|
|
231
|
+
<tr><td>
|
|
232
|
+
|
|
233
|
+
[isAsync()](./IPCB_PrimitiveString.md)
|
|
234
|
+
|
|
235
|
+
</td><td>
|
|
236
|
+
|
|
237
|
+
</td><td>
|
|
238
|
+
|
|
239
|
+
Query whether the primitive is an async primitive
|
|
240
|
+
|
|
241
|
+
</td></tr>
|
|
242
|
+
<tr><td>
|
|
243
|
+
|
|
244
|
+
[reset()](./IPCB_PrimitiveString.md)
|
|
245
|
+
|
|
246
|
+
</td><td>
|
|
247
|
+
|
|
248
|
+
</td><td>
|
|
249
|
+
|
|
250
|
+
**_(BETA)_** Reset the async primitive to the current canvas state
|
|
251
|
+
|
|
252
|
+
</td></tr>
|
|
253
|
+
<tr><td>
|
|
254
|
+
|
|
255
|
+
[setState\_AlignMode(alignMode)](./IPCB_PrimitiveString.md)
|
|
256
|
+
|
|
257
|
+
</td><td>
|
|
258
|
+
|
|
259
|
+
</td><td>
|
|
260
|
+
|
|
261
|
+
**_(BETA)_** Set the property state: alignment mode
|
|
262
|
+
|
|
263
|
+
</td></tr>
|
|
264
|
+
<tr><td>
|
|
265
|
+
|
|
266
|
+
[setState\_Expansion(expansion)](./IPCB_PrimitiveString.md)
|
|
267
|
+
|
|
268
|
+
</td><td>
|
|
269
|
+
|
|
270
|
+
</td><td>
|
|
271
|
+
|
|
272
|
+
**_(BETA)_** Set the property state: inverted expansion
|
|
273
|
+
|
|
274
|
+
</td></tr>
|
|
275
|
+
<tr><td>
|
|
276
|
+
|
|
277
|
+
[setState\_FontFamily(fontFamily)](./IPCB_PrimitiveString.md)
|
|
278
|
+
|
|
279
|
+
</td><td>
|
|
280
|
+
|
|
281
|
+
</td><td>
|
|
282
|
+
|
|
283
|
+
**_(BETA)_** Set the property state: font
|
|
284
|
+
|
|
285
|
+
</td></tr>
|
|
286
|
+
<tr><td>
|
|
287
|
+
|
|
288
|
+
[setState\_FontSize(fontSize)](./IPCB_PrimitiveString.md)
|
|
289
|
+
|
|
290
|
+
</td><td>
|
|
291
|
+
|
|
292
|
+
</td><td>
|
|
293
|
+
|
|
294
|
+
**_(BETA)_** Set the property state: font size
|
|
295
|
+
|
|
296
|
+
</td></tr>
|
|
297
|
+
<tr><td>
|
|
298
|
+
|
|
299
|
+
[setState\_Layer(layer)](./IPCB_PrimitiveString.md)
|
|
300
|
+
|
|
301
|
+
</td><td>
|
|
302
|
+
|
|
303
|
+
</td><td>
|
|
304
|
+
|
|
305
|
+
**_(BETA)_** Set the property state: Layer
|
|
306
|
+
|
|
307
|
+
</td></tr>
|
|
308
|
+
<tr><td>
|
|
309
|
+
|
|
310
|
+
[setState\_LineWidth(lineWidth)](./IPCB_PrimitiveString.md)
|
|
311
|
+
|
|
312
|
+
</td><td>
|
|
313
|
+
|
|
314
|
+
</td><td>
|
|
315
|
+
|
|
316
|
+
**_(BETA)_** Set the property state: Line width
|
|
317
|
+
|
|
318
|
+
</td></tr>
|
|
319
|
+
<tr><td>
|
|
320
|
+
|
|
321
|
+
[setState\_Mirror(mirror)](./IPCB_PrimitiveString.md)
|
|
322
|
+
|
|
323
|
+
</td><td>
|
|
324
|
+
|
|
325
|
+
</td><td>
|
|
326
|
+
|
|
327
|
+
**_(BETA)_** Set the property state: whether it is mirrored
|
|
328
|
+
|
|
329
|
+
</td></tr>
|
|
330
|
+
<tr><td>
|
|
331
|
+
|
|
332
|
+
[setState\_PrimitiveLock(primitiveLock)](./IPCB_PrimitiveString.md)
|
|
333
|
+
|
|
334
|
+
</td><td>
|
|
335
|
+
|
|
336
|
+
</td><td>
|
|
337
|
+
|
|
338
|
+
**_(BETA)_** Set the property state: whether it is locked
|
|
339
|
+
|
|
340
|
+
</td></tr>
|
|
341
|
+
<tr><td>
|
|
342
|
+
|
|
343
|
+
[setState\_Reverse(reverse)](./IPCB_PrimitiveString.md)
|
|
344
|
+
|
|
345
|
+
</td><td>
|
|
346
|
+
|
|
347
|
+
</td><td>
|
|
348
|
+
|
|
349
|
+
**_(BETA)_** Set the property state: whether it is inverted
|
|
350
|
+
|
|
351
|
+
</td></tr>
|
|
352
|
+
<tr><td>
|
|
353
|
+
|
|
354
|
+
[setState\_Rotation(rotation)](./IPCB_PrimitiveString.md)
|
|
355
|
+
|
|
356
|
+
</td><td>
|
|
357
|
+
|
|
358
|
+
</td><td>
|
|
359
|
+
|
|
360
|
+
**_(BETA)_** Set the property state: rotation angle
|
|
361
|
+
|
|
362
|
+
</td></tr>
|
|
363
|
+
<tr><td>
|
|
364
|
+
|
|
365
|
+
[setState\_Text(text)](./IPCB_PrimitiveString.md)
|
|
366
|
+
|
|
367
|
+
</td><td>
|
|
368
|
+
|
|
369
|
+
</td><td>
|
|
370
|
+
|
|
371
|
+
**_(BETA)_** Set the property state: text content
|
|
372
|
+
|
|
373
|
+
</td></tr>
|
|
374
|
+
<tr><td>
|
|
375
|
+
|
|
376
|
+
[setState\_X(x)](./IPCB_PrimitiveString.md)
|
|
377
|
+
|
|
378
|
+
</td><td>
|
|
379
|
+
|
|
380
|
+
</td><td>
|
|
381
|
+
|
|
382
|
+
**_(BETA)_** Set the property state: X coordinate
|
|
383
|
+
|
|
384
|
+
</td></tr>
|
|
385
|
+
<tr><td>
|
|
386
|
+
|
|
387
|
+
[setState\_Y(y)](./IPCB_PrimitiveString.md)
|
|
388
|
+
|
|
389
|
+
</td><td>
|
|
390
|
+
|
|
391
|
+
</td><td>
|
|
392
|
+
|
|
393
|
+
**_(BETA)_** Set the property state: Y coordinate
|
|
394
|
+
|
|
395
|
+
</td></tr>
|
|
396
|
+
<tr><td>
|
|
397
|
+
|
|
398
|
+
[toAsync()](./IPCB_PrimitiveString.md)
|
|
399
|
+
|
|
400
|
+
</td><td>
|
|
401
|
+
|
|
402
|
+
</td><td>
|
|
403
|
+
|
|
404
|
+
Convert Primitive to Async primitive
|
|
405
|
+
|
|
406
|
+
</td></tr>
|
|
407
|
+
<tr><td>
|
|
408
|
+
|
|
409
|
+
[toSync()](./IPCB_PrimitiveString.md)
|
|
410
|
+
|
|
411
|
+
</td><td>
|
|
412
|
+
|
|
413
|
+
</td><td>
|
|
414
|
+
|
|
415
|
+
Convert Primitive to Sync primitive
|
|
416
|
+
|
|
417
|
+
</td></tr>
|
|
418
|
+
</tbody></table>
|
|
419
|
+
|
|
420
|
+
---
|
|
421
|
+
|
|
422
|
+
## 构造函数详情
|
|
423
|
+
|
|
424
|
+
### _constructor_
|
|
425
|
+
|
|
426
|
+
# IPCB\_PrimitiveString.(constructor)
|
|
427
|
+
|
|
428
|
+
Constructs a new instance of the `IPCB_PrimitiveString` class
|
|
429
|
+
|
|
430
|
+
## Signature
|
|
431
|
+
|
|
432
|
+
```typescript
|
|
433
|
+
function constructor(
|
|
434
|
+
layer: TPCB_LayersOfImage,
|
|
435
|
+
x: number,
|
|
436
|
+
y: number,
|
|
437
|
+
text: string,
|
|
438
|
+
fontFamily?: string,
|
|
439
|
+
fontSize?: number,
|
|
440
|
+
lineWidth?: number,
|
|
441
|
+
alignMode?: EPCB_PrimitiveStringAlignMode,
|
|
442
|
+
rotation?: number,
|
|
443
|
+
reverse?: boolean,
|
|
444
|
+
expansion?: number,
|
|
445
|
+
mirror?: boolean,
|
|
446
|
+
primitiveLock?: boolean,
|
|
447
|
+
primitiveId?: string,
|
|
448
|
+
);
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
## Parameters
|
|
452
|
+
|
|
453
|
+
<table><thead><tr><th>
|
|
454
|
+
|
|
455
|
+
Parameter
|
|
456
|
+
|
|
457
|
+
</th><th>
|
|
458
|
+
|
|
459
|
+
Type
|
|
460
|
+
|
|
461
|
+
</th><th>
|
|
462
|
+
|
|
463
|
+
Description
|
|
464
|
+
|
|
465
|
+
</th></tr></thead>
|
|
466
|
+
<tbody><tr><td>
|
|
467
|
+
|
|
468
|
+
layer
|
|
469
|
+
|
|
470
|
+
</td><td>
|
|
471
|
+
|
|
472
|
+
[TPCB\_LayersOfImage](../types/TPCB_LayersOfImage.md)
|
|
473
|
+
|
|
474
|
+
</td><td>
|
|
475
|
+
|
|
476
|
+
</td></tr>
|
|
477
|
+
<tr><td>
|
|
478
|
+
|
|
479
|
+
x
|
|
480
|
+
|
|
481
|
+
</td><td>
|
|
482
|
+
|
|
483
|
+
number
|
|
484
|
+
|
|
485
|
+
</td><td>
|
|
486
|
+
|
|
487
|
+
</td></tr>
|
|
488
|
+
<tr><td>
|
|
489
|
+
|
|
490
|
+
y
|
|
491
|
+
|
|
492
|
+
</td><td>
|
|
493
|
+
|
|
494
|
+
number
|
|
495
|
+
|
|
496
|
+
</td><td>
|
|
497
|
+
|
|
498
|
+
</td></tr>
|
|
499
|
+
<tr><td>
|
|
500
|
+
|
|
501
|
+
text
|
|
502
|
+
|
|
503
|
+
</td><td>
|
|
504
|
+
|
|
505
|
+
string
|
|
506
|
+
|
|
507
|
+
</td><td>
|
|
508
|
+
|
|
509
|
+
</td></tr>
|
|
510
|
+
<tr><td>
|
|
511
|
+
|
|
512
|
+
fontFamily
|
|
513
|
+
|
|
514
|
+
</td><td>
|
|
515
|
+
|
|
516
|
+
string
|
|
517
|
+
|
|
518
|
+
</td><td>
|
|
519
|
+
|
|
520
|
+
_(Optional)_
|
|
521
|
+
|
|
522
|
+
</td></tr>
|
|
523
|
+
<tr><td>
|
|
524
|
+
|
|
525
|
+
fontSize
|
|
526
|
+
|
|
527
|
+
</td><td>
|
|
528
|
+
|
|
529
|
+
number
|
|
530
|
+
|
|
531
|
+
</td><td>
|
|
532
|
+
|
|
533
|
+
_(Optional)_
|
|
534
|
+
|
|
535
|
+
</td></tr>
|
|
536
|
+
<tr><td>
|
|
537
|
+
|
|
538
|
+
lineWidth
|
|
539
|
+
|
|
540
|
+
</td><td>
|
|
541
|
+
|
|
542
|
+
number
|
|
543
|
+
|
|
544
|
+
</td><td>
|
|
545
|
+
|
|
546
|
+
_(Optional)_
|
|
547
|
+
|
|
548
|
+
</td></tr>
|
|
549
|
+
<tr><td>
|
|
550
|
+
|
|
551
|
+
alignMode
|
|
552
|
+
|
|
553
|
+
</td><td>
|
|
554
|
+
|
|
555
|
+
[EPCB\_PrimitiveStringAlignMode](../enums/EPCB_PrimitiveStringAlignMode.md)
|
|
556
|
+
|
|
557
|
+
</td><td>
|
|
558
|
+
|
|
559
|
+
_(Optional)_
|
|
560
|
+
|
|
561
|
+
</td></tr>
|
|
562
|
+
<tr><td>
|
|
563
|
+
|
|
564
|
+
rotation
|
|
565
|
+
|
|
566
|
+
</td><td>
|
|
567
|
+
|
|
568
|
+
number
|
|
569
|
+
|
|
570
|
+
</td><td>
|
|
571
|
+
|
|
572
|
+
_(Optional)_
|
|
573
|
+
|
|
574
|
+
</td></tr>
|
|
575
|
+
<tr><td>
|
|
576
|
+
|
|
577
|
+
reverse
|
|
578
|
+
|
|
579
|
+
</td><td>
|
|
580
|
+
|
|
581
|
+
boolean
|
|
582
|
+
|
|
583
|
+
</td><td>
|
|
584
|
+
|
|
585
|
+
_(Optional)_
|
|
586
|
+
|
|
587
|
+
</td></tr>
|
|
588
|
+
<tr><td>
|
|
589
|
+
|
|
590
|
+
expansion
|
|
591
|
+
|
|
592
|
+
</td><td>
|
|
593
|
+
|
|
594
|
+
number
|
|
595
|
+
|
|
596
|
+
</td><td>
|
|
597
|
+
|
|
598
|
+
_(Optional)_
|
|
599
|
+
|
|
600
|
+
</td></tr>
|
|
601
|
+
<tr><td>
|
|
602
|
+
|
|
603
|
+
mirror
|
|
604
|
+
|
|
605
|
+
</td><td>
|
|
606
|
+
|
|
607
|
+
boolean
|
|
608
|
+
|
|
609
|
+
</td><td>
|
|
610
|
+
|
|
611
|
+
_(Optional)_
|
|
612
|
+
|
|
613
|
+
</td></tr>
|
|
614
|
+
<tr><td>
|
|
615
|
+
|
|
616
|
+
primitiveLock
|
|
617
|
+
|
|
618
|
+
</td><td>
|
|
619
|
+
|
|
620
|
+
boolean
|
|
621
|
+
|
|
622
|
+
</td><td>
|
|
623
|
+
|
|
624
|
+
_(Optional)_
|
|
625
|
+
|
|
626
|
+
</td></tr>
|
|
627
|
+
<tr><td>
|
|
628
|
+
|
|
629
|
+
primitiveId
|
|
630
|
+
|
|
631
|
+
</td><td>
|
|
632
|
+
|
|
633
|
+
string
|
|
634
|
+
|
|
635
|
+
</td><td>
|
|
636
|
+
|
|
637
|
+
_(Optional)_
|
|
638
|
+
|
|
639
|
+
</td></tr>
|
|
640
|
+
</tbody></table>
|
|
641
|
+
|
|
642
|
+
|
|
643
|
+
---
|
|
644
|
+
|
|
645
|
+
## 方法详情
|
|
646
|
+
|
|
647
|
+
### done
|
|
648
|
+
|
|
649
|
+
# IPCB\_PrimitiveString.done() method
|
|
650
|
+
|
|
651
|
+
> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
|
652
|
+
|
|
653
|
+
Apply the changes to the primitives to the canvas
|
|
654
|
+
|
|
655
|
+
## Signature
|
|
656
|
+
|
|
657
|
+
```typescript
|
|
658
|
+
function done(): Promise<IPCB_PrimitiveString>;
|
|
659
|
+
```
|
|
660
|
+
|
|
661
|
+
## Returns
|
|
662
|
+
|
|
663
|
+
Promise<[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)<!-- -->>
|
|
664
|
+
|
|
665
|
+
Text primitive object
|
|
666
|
+
|
|
667
|
+
## Example
|
|
668
|
+
|
|
669
|
+
```javascript
|
|
670
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
|
|
671
|
+
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
672
|
+
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
673
|
+
|
|
674
|
+
// 2. 在顶层丝印(3)放置一行文本
|
|
675
|
+
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
676
|
+
const before = str.getState_Text();
|
|
677
|
+
|
|
678
|
+
// 3. 异步模式下批量改两个字段(此时画布还没变)
|
|
679
|
+
const asyncStr = str.toAsync();
|
|
680
|
+
asyncStr.setState_Text('嘉立创示例_DONE');
|
|
681
|
+
asyncStr.setState_Rotation(90);
|
|
682
|
+
await asyncStr.done();
|
|
683
|
+
|
|
684
|
+
// 4. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
685
|
+
const refetched = await eda.pcb_PrimitiveString.get(str.getState_PrimitiveId());
|
|
686
|
+
|
|
687
|
+
console.log('text:', before, '→', refetched.getState_Text());
|
|
688
|
+
console.log('rotation:', refetched.getState_Rotation());
|
|
689
|
+
```
|
|
690
|
+
|
|
691
|
+
### getstate_alignmode
|
|
692
|
+
|
|
693
|
+
# IPCB\_PrimitiveString.getState\_AlignMode() method
|
|
694
|
+
|
|
695
|
+
Get the property state: alignment mode
|
|
696
|
+
|
|
697
|
+
## Signature
|
|
698
|
+
|
|
699
|
+
```typescript
|
|
700
|
+
function getState_AlignMode(): EPCB_PrimitiveStringAlignMode;
|
|
701
|
+
```
|
|
702
|
+
|
|
703
|
+
## Returns
|
|
704
|
+
|
|
705
|
+
[EPCB\_PrimitiveStringAlignMode](../enums/EPCB_PrimitiveStringAlignMode.md)
|
|
706
|
+
|
|
707
|
+
Alignment mode
|
|
708
|
+
|
|
709
|
+
## Example
|
|
710
|
+
|
|
711
|
+
```javascript
|
|
712
|
+
// 1. 在顶层丝印(3)放置一行左下(3)对齐的文本
|
|
713
|
+
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
714
|
+
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
715
|
+
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
716
|
+
|
|
717
|
+
// 2. 读取对齐模式(1-9:3=左下、5=居中)
|
|
718
|
+
const alignMode = str.getState_AlignMode();
|
|
719
|
+
|
|
720
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
721
|
+
await eda.pcb_PrimitiveString.delete([str.getState_PrimitiveId()]);
|
|
722
|
+
|
|
723
|
+
console.log('alignMode:', alignMode);
|
|
724
|
+
```
|
|
725
|
+
|
|
726
|
+
### getstate_expansion
|
|
727
|
+
|
|
728
|
+
# IPCB\_PrimitiveString.getState\_Expansion() method
|
|
729
|
+
|
|
730
|
+
Get the property state: inverted expansion
|
|
731
|
+
|
|
732
|
+
## Signature
|
|
733
|
+
|
|
734
|
+
```typescript
|
|
735
|
+
function getState_Expansion(): number;
|
|
736
|
+
```
|
|
737
|
+
|
|
738
|
+
## Returns
|
|
739
|
+
|
|
740
|
+
number
|
|
741
|
+
|
|
742
|
+
Inverted expansion
|
|
743
|
+
|
|
744
|
+
## Example
|
|
745
|
+
|
|
746
|
+
```javascript
|
|
747
|
+
// 1. 在顶层丝印(3)放置一行文本(反相扩展默认 0)
|
|
748
|
+
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
749
|
+
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
750
|
+
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
751
|
+
|
|
752
|
+
// 2. 读取反相扩展值
|
|
753
|
+
const expansion = str.getState_Expansion();
|
|
754
|
+
|
|
755
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
756
|
+
await eda.pcb_PrimitiveString.delete([str.getState_PrimitiveId()]);
|
|
757
|
+
|
|
758
|
+
console.log('expansion:', expansion);
|
|
759
|
+
```
|
|
760
|
+
|
|
761
|
+
### getstate_fontfamily
|
|
762
|
+
|
|
763
|
+
# IPCB\_PrimitiveString.getState\_FontFamily() method
|
|
764
|
+
|
|
765
|
+
Get the property state: font
|
|
766
|
+
|
|
767
|
+
## Signature
|
|
768
|
+
|
|
769
|
+
```typescript
|
|
770
|
+
function getState_FontFamily(): string;
|
|
771
|
+
```
|
|
772
|
+
|
|
773
|
+
## Returns
|
|
774
|
+
|
|
775
|
+
string
|
|
776
|
+
|
|
777
|
+
Font
|
|
778
|
+
|
|
779
|
+
## Example
|
|
780
|
+
|
|
781
|
+
```javascript
|
|
782
|
+
// 1. 在顶层丝印(3)放置一行默认字体的文本
|
|
783
|
+
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
784
|
+
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
785
|
+
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
786
|
+
|
|
787
|
+
// 2. 读取字体名
|
|
788
|
+
const fontFamily = str.getState_FontFamily();
|
|
789
|
+
|
|
790
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
791
|
+
await eda.pcb_PrimitiveString.delete([str.getState_PrimitiveId()]);
|
|
792
|
+
|
|
793
|
+
console.log('fontFamily:', fontFamily);
|
|
794
|
+
```
|
|
795
|
+
|
|
796
|
+
### getstate_fontsize
|
|
797
|
+
|
|
798
|
+
# IPCB\_PrimitiveString.getState\_FontSize() method
|
|
799
|
+
|
|
800
|
+
Get the property state: font size
|
|
801
|
+
|
|
802
|
+
## Signature
|
|
803
|
+
|
|
804
|
+
```typescript
|
|
805
|
+
function getState_FontSize(): number;
|
|
806
|
+
```
|
|
807
|
+
|
|
808
|
+
## Returns
|
|
809
|
+
|
|
810
|
+
number
|
|
811
|
+
|
|
812
|
+
Font size
|
|
813
|
+
|
|
814
|
+
## Example
|
|
815
|
+
|
|
816
|
+
```javascript
|
|
817
|
+
// 1. 在顶层丝印(3)放置一行 45mil 字号的文本
|
|
818
|
+
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
819
|
+
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
820
|
+
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
821
|
+
|
|
822
|
+
// 2. 读取字号
|
|
823
|
+
const fontSize = str.getState_FontSize();
|
|
824
|
+
|
|
825
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
826
|
+
await eda.pcb_PrimitiveString.delete([str.getState_PrimitiveId()]);
|
|
827
|
+
|
|
828
|
+
console.log('fontSize:', fontSize);
|
|
829
|
+
```
|
|
830
|
+
|
|
831
|
+
### getstate_layer
|
|
832
|
+
|
|
833
|
+
# IPCB\_PrimitiveString.getState\_Layer() method
|
|
834
|
+
|
|
835
|
+
Get the property state: Layer
|
|
836
|
+
|
|
837
|
+
## Signature
|
|
838
|
+
|
|
839
|
+
```typescript
|
|
840
|
+
function getState_Layer(): TPCB_LayersOfImage;
|
|
841
|
+
```
|
|
842
|
+
|
|
843
|
+
## Returns
|
|
844
|
+
|
|
845
|
+
[TPCB\_LayersOfImage](../types/TPCB_LayersOfImage.md)
|
|
846
|
+
|
|
847
|
+
Layer
|
|
848
|
+
|
|
849
|
+
## Example
|
|
850
|
+
|
|
851
|
+
```javascript
|
|
852
|
+
// 1. 在顶层丝印(3)放置一行文本
|
|
853
|
+
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
854
|
+
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
855
|
+
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
856
|
+
|
|
857
|
+
// 2. 读取所在层
|
|
858
|
+
const layer = str.getState_Layer();
|
|
859
|
+
|
|
860
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
861
|
+
await eda.pcb_PrimitiveString.delete([str.getState_PrimitiveId()]);
|
|
862
|
+
|
|
863
|
+
console.log('layer:', layer);
|
|
864
|
+
```
|
|
865
|
+
|
|
866
|
+
### getstate_linewidth
|
|
867
|
+
|
|
868
|
+
# IPCB\_PrimitiveString.getState\_LineWidth() method
|
|
869
|
+
|
|
870
|
+
Get the property state: Line width
|
|
871
|
+
|
|
872
|
+
## Signature
|
|
873
|
+
|
|
874
|
+
```typescript
|
|
875
|
+
function getState_LineWidth(): number;
|
|
876
|
+
```
|
|
877
|
+
|
|
878
|
+
## Returns
|
|
879
|
+
|
|
880
|
+
number
|
|
881
|
+
|
|
882
|
+
Line width
|
|
883
|
+
|
|
884
|
+
## Example
|
|
885
|
+
|
|
886
|
+
```javascript
|
|
887
|
+
// 1. 在顶层丝印(3)放置一行笔画 6mil 的文本
|
|
888
|
+
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
889
|
+
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
890
|
+
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
891
|
+
|
|
892
|
+
// 2. 读取笔画线宽
|
|
893
|
+
const lineWidth = str.getState_LineWidth();
|
|
894
|
+
|
|
895
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
896
|
+
await eda.pcb_PrimitiveString.delete([str.getState_PrimitiveId()]);
|
|
897
|
+
|
|
898
|
+
console.log('lineWidth:', lineWidth);
|
|
899
|
+
```
|
|
900
|
+
|
|
901
|
+
### getstate_mirror
|
|
902
|
+
|
|
903
|
+
# IPCB\_PrimitiveString.getState\_Mirror() method
|
|
904
|
+
|
|
905
|
+
Get the property state: whether it is mirrored
|
|
906
|
+
|
|
907
|
+
## Signature
|
|
908
|
+
|
|
909
|
+
```typescript
|
|
910
|
+
function getState_Mirror(): boolean;
|
|
911
|
+
```
|
|
912
|
+
|
|
913
|
+
## Returns
|
|
914
|
+
|
|
915
|
+
boolean
|
|
916
|
+
|
|
917
|
+
Whether it is mirrored
|
|
918
|
+
|
|
919
|
+
## Example
|
|
920
|
+
|
|
921
|
+
```javascript
|
|
922
|
+
// 1. 在顶层丝印(3)放置一行不镜像的文本
|
|
923
|
+
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
924
|
+
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
925
|
+
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
926
|
+
|
|
927
|
+
// 2. 读取镜像状态
|
|
928
|
+
const mirror = str.getState_Mirror();
|
|
929
|
+
|
|
930
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
931
|
+
await eda.pcb_PrimitiveString.delete([str.getState_PrimitiveId()]);
|
|
932
|
+
|
|
933
|
+
console.log('mirror:', mirror);
|
|
934
|
+
```
|
|
935
|
+
|
|
936
|
+
### getstate_primitiveid
|
|
937
|
+
|
|
938
|
+
# IPCB\_PrimitiveString.getState\_PrimitiveId() method
|
|
939
|
+
|
|
940
|
+
Get the property state: primitive ID
|
|
941
|
+
|
|
942
|
+
## Signature
|
|
943
|
+
|
|
944
|
+
```typescript
|
|
945
|
+
function getState_PrimitiveId(): string;
|
|
946
|
+
```
|
|
947
|
+
|
|
948
|
+
## Returns
|
|
949
|
+
|
|
950
|
+
string
|
|
951
|
+
|
|
952
|
+
Primitive ID
|
|
953
|
+
|
|
954
|
+
## Example
|
|
955
|
+
|
|
956
|
+
```javascript
|
|
957
|
+
// 1. 在顶层丝印(3)放置一行文本
|
|
958
|
+
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
959
|
+
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
960
|
+
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
961
|
+
|
|
962
|
+
// 2. 读取图元 ID
|
|
963
|
+
const primitiveId = str.getState_PrimitiveId();
|
|
964
|
+
|
|
965
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
966
|
+
await eda.pcb_PrimitiveString.delete([primitiveId]);
|
|
967
|
+
|
|
968
|
+
console.log('primitiveId:', primitiveId);
|
|
969
|
+
```
|
|
970
|
+
|
|
971
|
+
### getstate_primitivelock
|
|
972
|
+
|
|
973
|
+
# IPCB\_PrimitiveString.getState\_PrimitiveLock() method
|
|
974
|
+
|
|
975
|
+
Get the property state: whether it is locked
|
|
976
|
+
|
|
977
|
+
## Signature
|
|
978
|
+
|
|
979
|
+
```typescript
|
|
980
|
+
function getState_PrimitiveLock(): boolean;
|
|
981
|
+
```
|
|
982
|
+
|
|
983
|
+
## Returns
|
|
984
|
+
|
|
985
|
+
boolean
|
|
986
|
+
|
|
987
|
+
Whether it is locked
|
|
988
|
+
|
|
989
|
+
## Example
|
|
990
|
+
|
|
991
|
+
```javascript
|
|
992
|
+
// 1. 在顶层丝印(3)放置一行未锁定的文本
|
|
993
|
+
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
994
|
+
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
995
|
+
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
996
|
+
|
|
997
|
+
// 2. 读取锁定状态
|
|
998
|
+
const primitiveLock = str.getState_PrimitiveLock();
|
|
999
|
+
|
|
1000
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
1001
|
+
await eda.pcb_PrimitiveString.delete([str.getState_PrimitiveId()]);
|
|
1002
|
+
|
|
1003
|
+
console.log('primitiveLock:', primitiveLock);
|
|
1004
|
+
```
|
|
1005
|
+
|
|
1006
|
+
### getstate_primitivetype
|
|
1007
|
+
|
|
1008
|
+
# IPCB\_PrimitiveString.getState\_PrimitiveType() method
|
|
1009
|
+
|
|
1010
|
+
Get the property state: primitive type
|
|
1011
|
+
|
|
1012
|
+
## Signature
|
|
1013
|
+
|
|
1014
|
+
```typescript
|
|
1015
|
+
function getState_PrimitiveType(): EPCB_PrimitiveType;
|
|
1016
|
+
```
|
|
1017
|
+
|
|
1018
|
+
## Returns
|
|
1019
|
+
|
|
1020
|
+
[EPCB\_PrimitiveType](../enums/EPCB_PrimitiveType.md)
|
|
1021
|
+
|
|
1022
|
+
Primitive type
|
|
1023
|
+
|
|
1024
|
+
## Example
|
|
1025
|
+
|
|
1026
|
+
```javascript
|
|
1027
|
+
// 1. 在顶层丝印(3)放置一行文本
|
|
1028
|
+
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
1029
|
+
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
1030
|
+
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
1031
|
+
|
|
1032
|
+
// 2. 读取图元类型
|
|
1033
|
+
const primitiveType = str.getState_PrimitiveType();
|
|
1034
|
+
|
|
1035
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
1036
|
+
await eda.pcb_PrimitiveString.delete([str.getState_PrimitiveId()]);
|
|
1037
|
+
|
|
1038
|
+
console.log('primitiveType:', primitiveType);
|
|
1039
|
+
```
|
|
1040
|
+
|
|
1041
|
+
### getstate_reverse
|
|
1042
|
+
|
|
1043
|
+
# IPCB\_PrimitiveString.getState\_Reverse() method
|
|
1044
|
+
|
|
1045
|
+
Get the property state: whether it is inverted
|
|
1046
|
+
|
|
1047
|
+
## Signature
|
|
1048
|
+
|
|
1049
|
+
```typescript
|
|
1050
|
+
function getState_Reverse(): boolean;
|
|
1051
|
+
```
|
|
1052
|
+
|
|
1053
|
+
## Returns
|
|
1054
|
+
|
|
1055
|
+
boolean
|
|
1056
|
+
|
|
1057
|
+
Whether it is inverted
|
|
1058
|
+
|
|
1059
|
+
## Example
|
|
1060
|
+
|
|
1061
|
+
```javascript
|
|
1062
|
+
// 1. 在顶层丝印(3)放置一行不反相的文本
|
|
1063
|
+
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
1064
|
+
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
1065
|
+
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
1066
|
+
|
|
1067
|
+
// 2. 读取反相状态
|
|
1068
|
+
const reverse = str.getState_Reverse();
|
|
1069
|
+
|
|
1070
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
1071
|
+
await eda.pcb_PrimitiveString.delete([str.getState_PrimitiveId()]);
|
|
1072
|
+
|
|
1073
|
+
console.log('reverse:', reverse);
|
|
1074
|
+
```
|
|
1075
|
+
|
|
1076
|
+
### getstate_rotation
|
|
1077
|
+
|
|
1078
|
+
# IPCB\_PrimitiveString.getState\_Rotation() method
|
|
1079
|
+
|
|
1080
|
+
Get the property state: rotation angle
|
|
1081
|
+
|
|
1082
|
+
## Signature
|
|
1083
|
+
|
|
1084
|
+
```typescript
|
|
1085
|
+
function getState_Rotation(): number;
|
|
1086
|
+
```
|
|
1087
|
+
|
|
1088
|
+
## Returns
|
|
1089
|
+
|
|
1090
|
+
number
|
|
1091
|
+
|
|
1092
|
+
Rotation angle
|
|
1093
|
+
|
|
1094
|
+
## Example
|
|
1095
|
+
|
|
1096
|
+
```javascript
|
|
1097
|
+
// 1. 在顶层丝印(3)放置一行不旋转(0°)的文本
|
|
1098
|
+
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
1099
|
+
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
1100
|
+
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
1101
|
+
|
|
1102
|
+
// 2. 读取旋转角度
|
|
1103
|
+
const rotation = str.getState_Rotation();
|
|
1104
|
+
|
|
1105
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
1106
|
+
await eda.pcb_PrimitiveString.delete([str.getState_PrimitiveId()]);
|
|
1107
|
+
|
|
1108
|
+
console.log('rotation:', rotation);
|
|
1109
|
+
```
|
|
1110
|
+
|
|
1111
|
+
### getstate_text
|
|
1112
|
+
|
|
1113
|
+
# IPCB\_PrimitiveString.getState\_Text() method
|
|
1114
|
+
|
|
1115
|
+
Get the property state: text content
|
|
1116
|
+
|
|
1117
|
+
## Signature
|
|
1118
|
+
|
|
1119
|
+
```typescript
|
|
1120
|
+
function getState_Text(): string;
|
|
1121
|
+
```
|
|
1122
|
+
|
|
1123
|
+
## Returns
|
|
1124
|
+
|
|
1125
|
+
string
|
|
1126
|
+
|
|
1127
|
+
Text content
|
|
1128
|
+
|
|
1129
|
+
## Example
|
|
1130
|
+
|
|
1131
|
+
```javascript
|
|
1132
|
+
// 1. 在顶层丝印(3)放置一行文本
|
|
1133
|
+
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
1134
|
+
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
1135
|
+
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
1136
|
+
|
|
1137
|
+
// 2. 读取文本内容
|
|
1138
|
+
const text = str.getState_Text();
|
|
1139
|
+
|
|
1140
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
1141
|
+
await eda.pcb_PrimitiveString.delete([str.getState_PrimitiveId()]);
|
|
1142
|
+
|
|
1143
|
+
console.log('text:', text);
|
|
1144
|
+
```
|
|
1145
|
+
|
|
1146
|
+
### getstate_x
|
|
1147
|
+
|
|
1148
|
+
# IPCB\_PrimitiveString.getState\_X() method
|
|
1149
|
+
|
|
1150
|
+
Get the property state: X coordinate
|
|
1151
|
+
|
|
1152
|
+
## Signature
|
|
1153
|
+
|
|
1154
|
+
```typescript
|
|
1155
|
+
function getState_X(): number;
|
|
1156
|
+
```
|
|
1157
|
+
|
|
1158
|
+
## Returns
|
|
1159
|
+
|
|
1160
|
+
number
|
|
1161
|
+
|
|
1162
|
+
X coordinate
|
|
1163
|
+
|
|
1164
|
+
## Example
|
|
1165
|
+
|
|
1166
|
+
```javascript
|
|
1167
|
+
// 1. 在顶层丝印(3)放置一行文本
|
|
1168
|
+
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
1169
|
+
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
1170
|
+
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
1171
|
+
|
|
1172
|
+
// 2. 读取锚点 X 坐标
|
|
1173
|
+
const anchorX = str.getState_X();
|
|
1174
|
+
|
|
1175
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
1176
|
+
await eda.pcb_PrimitiveString.delete([str.getState_PrimitiveId()]);
|
|
1177
|
+
|
|
1178
|
+
console.log('x:', anchorX);
|
|
1179
|
+
```
|
|
1180
|
+
|
|
1181
|
+
### getstate_y
|
|
1182
|
+
|
|
1183
|
+
# IPCB\_PrimitiveString.getState\_Y() method
|
|
1184
|
+
|
|
1185
|
+
Get the property state: Y coordinate
|
|
1186
|
+
|
|
1187
|
+
## Signature
|
|
1188
|
+
|
|
1189
|
+
```typescript
|
|
1190
|
+
function getState_Y(): number;
|
|
1191
|
+
```
|
|
1192
|
+
|
|
1193
|
+
## Returns
|
|
1194
|
+
|
|
1195
|
+
number
|
|
1196
|
+
|
|
1197
|
+
Y coordinate
|
|
1198
|
+
|
|
1199
|
+
## Example
|
|
1200
|
+
|
|
1201
|
+
```javascript
|
|
1202
|
+
// 1. 在顶层丝印(3)放置一行文本
|
|
1203
|
+
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
1204
|
+
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
1205
|
+
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
1206
|
+
|
|
1207
|
+
// 2. 读取锚点 Y 坐标
|
|
1208
|
+
const anchorY = str.getState_Y();
|
|
1209
|
+
|
|
1210
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
1211
|
+
await eda.pcb_PrimitiveString.delete([str.getState_PrimitiveId()]);
|
|
1212
|
+
|
|
1213
|
+
console.log('y:', anchorY);
|
|
1214
|
+
```
|
|
1215
|
+
|
|
1216
|
+
### isasync
|
|
1217
|
+
|
|
1218
|
+
# IPCB\_PrimitiveString.isAsync() method
|
|
1219
|
+
|
|
1220
|
+
Query whether the primitive is an async primitive
|
|
1221
|
+
|
|
1222
|
+
## Signature
|
|
1223
|
+
|
|
1224
|
+
```typescript
|
|
1225
|
+
function isAsync(): boolean;
|
|
1226
|
+
```
|
|
1227
|
+
|
|
1228
|
+
## Returns
|
|
1229
|
+
|
|
1230
|
+
boolean
|
|
1231
|
+
|
|
1232
|
+
Whether Is async primitive
|
|
1233
|
+
|
|
1234
|
+
## Example
|
|
1235
|
+
|
|
1236
|
+
```javascript
|
|
1237
|
+
// 1. 在顶层丝印(3)放置一行文本
|
|
1238
|
+
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
1239
|
+
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
1240
|
+
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
1241
|
+
|
|
1242
|
+
// 2. 查询异步模式
|
|
1243
|
+
const isAsync = str.isAsync();
|
|
1244
|
+
|
|
1245
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
1246
|
+
await eda.pcb_PrimitiveString.delete([str.getState_PrimitiveId()]);
|
|
1247
|
+
|
|
1248
|
+
console.log('isAsync:', isAsync);
|
|
1249
|
+
```
|
|
1250
|
+
|
|
1251
|
+
### reset
|
|
1252
|
+
|
|
1253
|
+
# IPCB\_PrimitiveString.reset() 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
|
+
Reset the async primitive to the current canvas state
|
|
1258
|
+
|
|
1259
|
+
## Signature
|
|
1260
|
+
|
|
1261
|
+
```typescript
|
|
1262
|
+
function reset(): Promise<IPCB_PrimitiveString>;
|
|
1263
|
+
```
|
|
1264
|
+
|
|
1265
|
+
## Returns
|
|
1266
|
+
|
|
1267
|
+
Promise<[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)<!-- -->>
|
|
1268
|
+
|
|
1269
|
+
This primitive object
|
|
1270
|
+
|
|
1271
|
+
## Example
|
|
1272
|
+
|
|
1273
|
+
```javascript
|
|
1274
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
|
|
1275
|
+
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
1276
|
+
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
1277
|
+
|
|
1278
|
+
// 2. 在顶层丝印(3)放置一行不旋转的文本
|
|
1279
|
+
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
1280
|
+
const before = str.getState_Rotation();
|
|
1281
|
+
|
|
1282
|
+
// 3. 异步模式下把文本旋转 90°,随后反悔(不调 done())
|
|
1283
|
+
const asyncStr = str.toAsync();
|
|
1284
|
+
asyncStr.setState_Rotation(90);
|
|
1285
|
+
|
|
1286
|
+
// 4. reset 丢弃未提交的修改(保留现场供观察)
|
|
1287
|
+
await asyncStr.reset();
|
|
1288
|
+
|
|
1289
|
+
// 5. 从画布重新读取,确认旋转角度没有变
|
|
1290
|
+
const refetched = await eda.pcb_PrimitiveString.get(str.getState_PrimitiveId());
|
|
1291
|
+
|
|
1292
|
+
console.log('rotation:', before, '→', refetched.getState_Rotation());
|
|
1293
|
+
```
|
|
1294
|
+
|
|
1295
|
+
### setstate_alignmode
|
|
1296
|
+
|
|
1297
|
+
# IPCB\_PrimitiveString.setState\_AlignMode() method
|
|
1298
|
+
|
|
1299
|
+
> 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.
|
|
1300
|
+
|
|
1301
|
+
Set the property state: alignment mode
|
|
1302
|
+
|
|
1303
|
+
## Signature
|
|
1304
|
+
|
|
1305
|
+
```typescript
|
|
1306
|
+
function setState_AlignMode(alignMode: EPCB_PrimitiveStringAlignMode): IPCB_PrimitiveString;
|
|
1307
|
+
```
|
|
1308
|
+
|
|
1309
|
+
## Parameters
|
|
1310
|
+
|
|
1311
|
+
<table><thead><tr><th>
|
|
1312
|
+
|
|
1313
|
+
Parameter
|
|
1314
|
+
|
|
1315
|
+
</th><th>
|
|
1316
|
+
|
|
1317
|
+
Type
|
|
1318
|
+
|
|
1319
|
+
</th><th>
|
|
1320
|
+
|
|
1321
|
+
Description
|
|
1322
|
+
|
|
1323
|
+
</th></tr></thead>
|
|
1324
|
+
<tbody><tr><td>
|
|
1325
|
+
|
|
1326
|
+
alignMode
|
|
1327
|
+
|
|
1328
|
+
</td><td>
|
|
1329
|
+
|
|
1330
|
+
[EPCB\_PrimitiveStringAlignMode](../enums/EPCB_PrimitiveStringAlignMode.md)
|
|
1331
|
+
|
|
1332
|
+
</td><td>
|
|
1333
|
+
|
|
1334
|
+
Alignment mode
|
|
1335
|
+
|
|
1336
|
+
</td></tr>
|
|
1337
|
+
</tbody></table>
|
|
1338
|
+
|
|
1339
|
+
## Returns
|
|
1340
|
+
|
|
1341
|
+
[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)
|
|
1342
|
+
|
|
1343
|
+
Text primitive object
|
|
1344
|
+
|
|
1345
|
+
## Example
|
|
1346
|
+
|
|
1347
|
+
```javascript
|
|
1348
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
|
|
1349
|
+
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
1350
|
+
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
1351
|
+
|
|
1352
|
+
// 2. 在顶层丝印(3)放置一行左下(3)对齐的文本
|
|
1353
|
+
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
1354
|
+
const before = str.getState_AlignMode();
|
|
1355
|
+
|
|
1356
|
+
// 3. 异步模式把对齐模式改为居中(5)
|
|
1357
|
+
const asyncStr = str.toAsync();
|
|
1358
|
+
asyncStr.setState_AlignMode(5);
|
|
1359
|
+
await asyncStr.done();
|
|
1360
|
+
|
|
1361
|
+
// 4. 从画布重新读取,确认修改生效(保留现场供观察)
|
|
1362
|
+
const refetched = await eda.pcb_PrimitiveString.get(str.getState_PrimitiveId());
|
|
1363
|
+
|
|
1364
|
+
console.log('alignMode:', before, '→', refetched.getState_AlignMode());
|
|
1365
|
+
```
|
|
1366
|
+
|
|
1367
|
+
### setstate_expansion
|
|
1368
|
+
|
|
1369
|
+
# IPCB\_PrimitiveString.setState\_Expansion() method
|
|
1370
|
+
|
|
1371
|
+
> 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.
|
|
1372
|
+
|
|
1373
|
+
Set the property state: inverted expansion
|
|
1374
|
+
|
|
1375
|
+
## Signature
|
|
1376
|
+
|
|
1377
|
+
```typescript
|
|
1378
|
+
function setState_Expansion(expansion: number): IPCB_PrimitiveString;
|
|
1379
|
+
```
|
|
1380
|
+
|
|
1381
|
+
## Parameters
|
|
1382
|
+
|
|
1383
|
+
<table><thead><tr><th>
|
|
1384
|
+
|
|
1385
|
+
Parameter
|
|
1386
|
+
|
|
1387
|
+
</th><th>
|
|
1388
|
+
|
|
1389
|
+
Type
|
|
1390
|
+
|
|
1391
|
+
</th><th>
|
|
1392
|
+
|
|
1393
|
+
Description
|
|
1394
|
+
|
|
1395
|
+
</th></tr></thead>
|
|
1396
|
+
<tbody><tr><td>
|
|
1397
|
+
|
|
1398
|
+
expansion
|
|
1399
|
+
|
|
1400
|
+
</td><td>
|
|
1401
|
+
|
|
1402
|
+
number
|
|
1403
|
+
|
|
1404
|
+
</td><td>
|
|
1405
|
+
|
|
1406
|
+
Inverted expansion
|
|
1407
|
+
|
|
1408
|
+
</td></tr>
|
|
1409
|
+
</tbody></table>
|
|
1410
|
+
|
|
1411
|
+
## Returns
|
|
1412
|
+
|
|
1413
|
+
[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)
|
|
1414
|
+
|
|
1415
|
+
Text primitive object
|
|
1416
|
+
|
|
1417
|
+
## Example
|
|
1418
|
+
|
|
1419
|
+
```javascript
|
|
1420
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
|
|
1421
|
+
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
1422
|
+
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
1423
|
+
|
|
1424
|
+
// 2. 在顶层丝印(3)放置一行反相扩展为 0 的文本
|
|
1425
|
+
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
1426
|
+
const before = str.getState_Expansion();
|
|
1427
|
+
|
|
1428
|
+
// 3. 异步模式把反相扩展加大到 10
|
|
1429
|
+
const asyncStr = str.toAsync();
|
|
1430
|
+
asyncStr.setState_Expansion(10);
|
|
1431
|
+
await asyncStr.done();
|
|
1432
|
+
|
|
1433
|
+
// 4. 从画布重新读取,确认修改生效(保留现场供观察)
|
|
1434
|
+
const refetched = await eda.pcb_PrimitiveString.get(str.getState_PrimitiveId());
|
|
1435
|
+
|
|
1436
|
+
console.log('expansion:', before, '→', refetched.getState_Expansion());
|
|
1437
|
+
```
|
|
1438
|
+
|
|
1439
|
+
### setstate_fontfamily
|
|
1440
|
+
|
|
1441
|
+
# IPCB\_PrimitiveString.setState\_FontFamily() method
|
|
1442
|
+
|
|
1443
|
+
> 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.
|
|
1444
|
+
|
|
1445
|
+
Set the property state: font
|
|
1446
|
+
|
|
1447
|
+
## Signature
|
|
1448
|
+
|
|
1449
|
+
```typescript
|
|
1450
|
+
function setState_FontFamily(fontFamily: string): IPCB_PrimitiveString;
|
|
1451
|
+
```
|
|
1452
|
+
|
|
1453
|
+
## Parameters
|
|
1454
|
+
|
|
1455
|
+
<table><thead><tr><th>
|
|
1456
|
+
|
|
1457
|
+
Parameter
|
|
1458
|
+
|
|
1459
|
+
</th><th>
|
|
1460
|
+
|
|
1461
|
+
Type
|
|
1462
|
+
|
|
1463
|
+
</th><th>
|
|
1464
|
+
|
|
1465
|
+
Description
|
|
1466
|
+
|
|
1467
|
+
</th></tr></thead>
|
|
1468
|
+
<tbody><tr><td>
|
|
1469
|
+
|
|
1470
|
+
fontFamily
|
|
1471
|
+
|
|
1472
|
+
</td><td>
|
|
1473
|
+
|
|
1474
|
+
string
|
|
1475
|
+
|
|
1476
|
+
</td><td>
|
|
1477
|
+
|
|
1478
|
+
Font
|
|
1479
|
+
|
|
1480
|
+
</td></tr>
|
|
1481
|
+
</tbody></table>
|
|
1482
|
+
|
|
1483
|
+
## Returns
|
|
1484
|
+
|
|
1485
|
+
[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)
|
|
1486
|
+
|
|
1487
|
+
Text primitive object
|
|
1488
|
+
|
|
1489
|
+
## Example
|
|
1490
|
+
|
|
1491
|
+
```javascript
|
|
1492
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
|
|
1493
|
+
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
1494
|
+
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
1495
|
+
|
|
1496
|
+
// 2. 在顶层丝印(3)放置一行默认字体的文本
|
|
1497
|
+
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
1498
|
+
const before = str.getState_FontFamily();
|
|
1499
|
+
|
|
1500
|
+
// 3. 异步模式把字体换成 Arial
|
|
1501
|
+
const asyncStr = str.toAsync();
|
|
1502
|
+
asyncStr.setState_FontFamily('Arial');
|
|
1503
|
+
await asyncStr.done();
|
|
1504
|
+
|
|
1505
|
+
// 4. 从画布重新读取,确认修改生效(保留现场供观察)
|
|
1506
|
+
const refetched = await eda.pcb_PrimitiveString.get(str.getState_PrimitiveId());
|
|
1507
|
+
|
|
1508
|
+
console.log('fontFamily:', before, '→', refetched.getState_FontFamily());
|
|
1509
|
+
```
|
|
1510
|
+
|
|
1511
|
+
### setstate_fontsize
|
|
1512
|
+
|
|
1513
|
+
# IPCB\_PrimitiveString.setState\_FontSize() method
|
|
1514
|
+
|
|
1515
|
+
> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
|
1516
|
+
|
|
1517
|
+
Set the property state: font size
|
|
1518
|
+
|
|
1519
|
+
## Signature
|
|
1520
|
+
|
|
1521
|
+
```typescript
|
|
1522
|
+
function setState_FontSize(fontSize: number): IPCB_PrimitiveString;
|
|
1523
|
+
```
|
|
1524
|
+
|
|
1525
|
+
## Parameters
|
|
1526
|
+
|
|
1527
|
+
<table><thead><tr><th>
|
|
1528
|
+
|
|
1529
|
+
Parameter
|
|
1530
|
+
|
|
1531
|
+
</th><th>
|
|
1532
|
+
|
|
1533
|
+
Type
|
|
1534
|
+
|
|
1535
|
+
</th><th>
|
|
1536
|
+
|
|
1537
|
+
Description
|
|
1538
|
+
|
|
1539
|
+
</th></tr></thead>
|
|
1540
|
+
<tbody><tr><td>
|
|
1541
|
+
|
|
1542
|
+
fontSize
|
|
1543
|
+
|
|
1544
|
+
</td><td>
|
|
1545
|
+
|
|
1546
|
+
number
|
|
1547
|
+
|
|
1548
|
+
</td><td>
|
|
1549
|
+
|
|
1550
|
+
Font size
|
|
1551
|
+
|
|
1552
|
+
</td></tr>
|
|
1553
|
+
</tbody></table>
|
|
1554
|
+
|
|
1555
|
+
## Returns
|
|
1556
|
+
|
|
1557
|
+
[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)
|
|
1558
|
+
|
|
1559
|
+
Text primitive object
|
|
1560
|
+
|
|
1561
|
+
## Example
|
|
1562
|
+
|
|
1563
|
+
```javascript
|
|
1564
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
|
|
1565
|
+
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
1566
|
+
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
1567
|
+
|
|
1568
|
+
// 2. 在顶层丝印(3)放置一行 45mil 字号的文本
|
|
1569
|
+
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
1570
|
+
const before = str.getState_FontSize();
|
|
1571
|
+
|
|
1572
|
+
// 3. 异步模式把字号加大到 60
|
|
1573
|
+
const asyncStr = str.toAsync();
|
|
1574
|
+
asyncStr.setState_FontSize(60);
|
|
1575
|
+
await asyncStr.done();
|
|
1576
|
+
|
|
1577
|
+
// 4. 从画布重新读取,确认修改生效(保留现场供观察)
|
|
1578
|
+
const refetched = await eda.pcb_PrimitiveString.get(str.getState_PrimitiveId());
|
|
1579
|
+
|
|
1580
|
+
console.log('fontSize:', before, '→', refetched.getState_FontSize());
|
|
1581
|
+
```
|
|
1582
|
+
|
|
1583
|
+
### setstate_layer
|
|
1584
|
+
|
|
1585
|
+
# IPCB\_PrimitiveString.setState\_Layer() method
|
|
1586
|
+
|
|
1587
|
+
> 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.
|
|
1588
|
+
|
|
1589
|
+
Set the property state: Layer
|
|
1590
|
+
|
|
1591
|
+
## Signature
|
|
1592
|
+
|
|
1593
|
+
```typescript
|
|
1594
|
+
function setState_Layer(layer: TPCB_LayersOfImage): IPCB_PrimitiveString;
|
|
1595
|
+
```
|
|
1596
|
+
|
|
1597
|
+
## Parameters
|
|
1598
|
+
|
|
1599
|
+
<table><thead><tr><th>
|
|
1600
|
+
|
|
1601
|
+
Parameter
|
|
1602
|
+
|
|
1603
|
+
</th><th>
|
|
1604
|
+
|
|
1605
|
+
Type
|
|
1606
|
+
|
|
1607
|
+
</th><th>
|
|
1608
|
+
|
|
1609
|
+
Description
|
|
1610
|
+
|
|
1611
|
+
</th></tr></thead>
|
|
1612
|
+
<tbody><tr><td>
|
|
1613
|
+
|
|
1614
|
+
layer
|
|
1615
|
+
|
|
1616
|
+
</td><td>
|
|
1617
|
+
|
|
1618
|
+
[TPCB\_LayersOfImage](../types/TPCB_LayersOfImage.md)
|
|
1619
|
+
|
|
1620
|
+
</td><td>
|
|
1621
|
+
|
|
1622
|
+
Layer
|
|
1623
|
+
|
|
1624
|
+
</td></tr>
|
|
1625
|
+
</tbody></table>
|
|
1626
|
+
|
|
1627
|
+
## Returns
|
|
1628
|
+
|
|
1629
|
+
[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)
|
|
1630
|
+
|
|
1631
|
+
Text primitive object
|
|
1632
|
+
|
|
1633
|
+
## Example
|
|
1634
|
+
|
|
1635
|
+
```javascript
|
|
1636
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
|
|
1637
|
+
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
1638
|
+
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
1639
|
+
|
|
1640
|
+
// 2. 在顶层丝印(3)放置一行文本
|
|
1641
|
+
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
1642
|
+
const before = str.getState_Layer();
|
|
1643
|
+
|
|
1644
|
+
// 3. 异步模式把文本挪到底层丝印(4)
|
|
1645
|
+
const asyncStr = str.toAsync();
|
|
1646
|
+
asyncStr.setState_Layer(4);
|
|
1647
|
+
await asyncStr.done();
|
|
1648
|
+
|
|
1649
|
+
// 4. 从画布重新读取,确认层已切换(保留现场供观察)
|
|
1650
|
+
const refetched = await eda.pcb_PrimitiveString.get(str.getState_PrimitiveId());
|
|
1651
|
+
|
|
1652
|
+
console.log('layer:', before, '→', refetched.getState_Layer());
|
|
1653
|
+
```
|
|
1654
|
+
|
|
1655
|
+
### setstate_linewidth
|
|
1656
|
+
|
|
1657
|
+
# IPCB\_PrimitiveString.setState\_LineWidth() method
|
|
1658
|
+
|
|
1659
|
+
> 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.
|
|
1660
|
+
|
|
1661
|
+
Set the property state: Line width
|
|
1662
|
+
|
|
1663
|
+
## Signature
|
|
1664
|
+
|
|
1665
|
+
```typescript
|
|
1666
|
+
function setState_LineWidth(lineWidth: number): IPCB_PrimitiveString;
|
|
1667
|
+
```
|
|
1668
|
+
|
|
1669
|
+
## Parameters
|
|
1670
|
+
|
|
1671
|
+
<table><thead><tr><th>
|
|
1672
|
+
|
|
1673
|
+
Parameter
|
|
1674
|
+
|
|
1675
|
+
</th><th>
|
|
1676
|
+
|
|
1677
|
+
Type
|
|
1678
|
+
|
|
1679
|
+
</th><th>
|
|
1680
|
+
|
|
1681
|
+
Description
|
|
1682
|
+
|
|
1683
|
+
</th></tr></thead>
|
|
1684
|
+
<tbody><tr><td>
|
|
1685
|
+
|
|
1686
|
+
lineWidth
|
|
1687
|
+
|
|
1688
|
+
</td><td>
|
|
1689
|
+
|
|
1690
|
+
number
|
|
1691
|
+
|
|
1692
|
+
</td><td>
|
|
1693
|
+
|
|
1694
|
+
Line width
|
|
1695
|
+
|
|
1696
|
+
</td></tr>
|
|
1697
|
+
</tbody></table>
|
|
1698
|
+
|
|
1699
|
+
## Returns
|
|
1700
|
+
|
|
1701
|
+
[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)
|
|
1702
|
+
|
|
1703
|
+
Text primitive object
|
|
1704
|
+
|
|
1705
|
+
## Example
|
|
1706
|
+
|
|
1707
|
+
```javascript
|
|
1708
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
|
|
1709
|
+
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
1710
|
+
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
1711
|
+
|
|
1712
|
+
// 2. 在顶层丝印(3)放置一行笔画 6mil 的文本
|
|
1713
|
+
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
1714
|
+
const before = str.getState_LineWidth();
|
|
1715
|
+
|
|
1716
|
+
// 3. 异步模式把笔画加粗到 10
|
|
1717
|
+
const asyncStr = str.toAsync();
|
|
1718
|
+
asyncStr.setState_LineWidth(10);
|
|
1719
|
+
await asyncStr.done();
|
|
1720
|
+
|
|
1721
|
+
// 4. 从画布重新读取,确认修改生效(保留现场供观察)
|
|
1722
|
+
const refetched = await eda.pcb_PrimitiveString.get(str.getState_PrimitiveId());
|
|
1723
|
+
|
|
1724
|
+
console.log('lineWidth:', before, '→', refetched.getState_LineWidth());
|
|
1725
|
+
```
|
|
1726
|
+
|
|
1727
|
+
### setstate_mirror
|
|
1728
|
+
|
|
1729
|
+
# IPCB\_PrimitiveString.setState\_Mirror() method
|
|
1730
|
+
|
|
1731
|
+
> 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.
|
|
1732
|
+
|
|
1733
|
+
Set the property state: whether it is mirrored
|
|
1734
|
+
|
|
1735
|
+
## Signature
|
|
1736
|
+
|
|
1737
|
+
```typescript
|
|
1738
|
+
function setState_Mirror(mirror: boolean): IPCB_PrimitiveString;
|
|
1739
|
+
```
|
|
1740
|
+
|
|
1741
|
+
## Parameters
|
|
1742
|
+
|
|
1743
|
+
<table><thead><tr><th>
|
|
1744
|
+
|
|
1745
|
+
Parameter
|
|
1746
|
+
|
|
1747
|
+
</th><th>
|
|
1748
|
+
|
|
1749
|
+
Type
|
|
1750
|
+
|
|
1751
|
+
</th><th>
|
|
1752
|
+
|
|
1753
|
+
Description
|
|
1754
|
+
|
|
1755
|
+
</th></tr></thead>
|
|
1756
|
+
<tbody><tr><td>
|
|
1757
|
+
|
|
1758
|
+
mirror
|
|
1759
|
+
|
|
1760
|
+
</td><td>
|
|
1761
|
+
|
|
1762
|
+
boolean
|
|
1763
|
+
|
|
1764
|
+
</td><td>
|
|
1765
|
+
|
|
1766
|
+
Whether it is mirrored
|
|
1767
|
+
|
|
1768
|
+
</td></tr>
|
|
1769
|
+
</tbody></table>
|
|
1770
|
+
|
|
1771
|
+
## Returns
|
|
1772
|
+
|
|
1773
|
+
[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)
|
|
1774
|
+
|
|
1775
|
+
Text primitive object
|
|
1776
|
+
|
|
1777
|
+
## Example
|
|
1778
|
+
|
|
1779
|
+
```javascript
|
|
1780
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
|
|
1781
|
+
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
1782
|
+
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
1783
|
+
|
|
1784
|
+
// 2. 在顶层丝印(3)放置一行不镜像的文本
|
|
1785
|
+
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
1786
|
+
const before = str.getState_Mirror();
|
|
1787
|
+
|
|
1788
|
+
// 3. 异步模式开启镜像
|
|
1789
|
+
const asyncStr = str.toAsync();
|
|
1790
|
+
asyncStr.setState_Mirror(true);
|
|
1791
|
+
await asyncStr.done();
|
|
1792
|
+
|
|
1793
|
+
// 4. 从画布重新读取,确认修改生效(保留现场供观察)
|
|
1794
|
+
const refetched = await eda.pcb_PrimitiveString.get(str.getState_PrimitiveId());
|
|
1795
|
+
|
|
1796
|
+
console.log('mirror:', before, '→', refetched.getState_Mirror());
|
|
1797
|
+
```
|
|
1798
|
+
|
|
1799
|
+
### setstate_primitivelock
|
|
1800
|
+
|
|
1801
|
+
# IPCB\_PrimitiveString.setState\_PrimitiveLock() method
|
|
1802
|
+
|
|
1803
|
+
> 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.
|
|
1804
|
+
|
|
1805
|
+
Set the property state: whether it is locked
|
|
1806
|
+
|
|
1807
|
+
## Signature
|
|
1808
|
+
|
|
1809
|
+
```typescript
|
|
1810
|
+
function setState_PrimitiveLock(primitiveLock: boolean): IPCB_PrimitiveString;
|
|
1811
|
+
```
|
|
1812
|
+
|
|
1813
|
+
## Parameters
|
|
1814
|
+
|
|
1815
|
+
<table><thead><tr><th>
|
|
1816
|
+
|
|
1817
|
+
Parameter
|
|
1818
|
+
|
|
1819
|
+
</th><th>
|
|
1820
|
+
|
|
1821
|
+
Type
|
|
1822
|
+
|
|
1823
|
+
</th><th>
|
|
1824
|
+
|
|
1825
|
+
Description
|
|
1826
|
+
|
|
1827
|
+
</th></tr></thead>
|
|
1828
|
+
<tbody><tr><td>
|
|
1829
|
+
|
|
1830
|
+
primitiveLock
|
|
1831
|
+
|
|
1832
|
+
</td><td>
|
|
1833
|
+
|
|
1834
|
+
boolean
|
|
1835
|
+
|
|
1836
|
+
</td><td>
|
|
1837
|
+
|
|
1838
|
+
Whether it is locked
|
|
1839
|
+
|
|
1840
|
+
</td></tr>
|
|
1841
|
+
</tbody></table>
|
|
1842
|
+
|
|
1843
|
+
## Returns
|
|
1844
|
+
|
|
1845
|
+
[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)
|
|
1846
|
+
|
|
1847
|
+
Text primitive object
|
|
1848
|
+
|
|
1849
|
+
## Example
|
|
1850
|
+
|
|
1851
|
+
```javascript
|
|
1852
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
|
|
1853
|
+
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
1854
|
+
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
1855
|
+
|
|
1856
|
+
// 2. 在顶层丝印(3)放置一行未锁定的文本
|
|
1857
|
+
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
1858
|
+
const before = str.getState_PrimitiveLock();
|
|
1859
|
+
|
|
1860
|
+
// 3. 异步模式锁定文本
|
|
1861
|
+
const asyncStr = str.toAsync();
|
|
1862
|
+
asyncStr.setState_PrimitiveLock(true);
|
|
1863
|
+
await asyncStr.done();
|
|
1864
|
+
|
|
1865
|
+
// 4. 从画布重新读取,确认修改生效(保留现场供观察)
|
|
1866
|
+
const refetched = await eda.pcb_PrimitiveString.get(str.getState_PrimitiveId());
|
|
1867
|
+
|
|
1868
|
+
console.log('primitiveLock:', before, '→', refetched.getState_PrimitiveLock());
|
|
1869
|
+
```
|
|
1870
|
+
|
|
1871
|
+
### setstate_reverse
|
|
1872
|
+
|
|
1873
|
+
# IPCB\_PrimitiveString.setState\_Reverse() method
|
|
1874
|
+
|
|
1875
|
+
> 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.
|
|
1876
|
+
|
|
1877
|
+
Set the property state: whether it is inverted
|
|
1878
|
+
|
|
1879
|
+
## Signature
|
|
1880
|
+
|
|
1881
|
+
```typescript
|
|
1882
|
+
function setState_Reverse(reverse: boolean): IPCB_PrimitiveString;
|
|
1883
|
+
```
|
|
1884
|
+
|
|
1885
|
+
## Parameters
|
|
1886
|
+
|
|
1887
|
+
<table><thead><tr><th>
|
|
1888
|
+
|
|
1889
|
+
Parameter
|
|
1890
|
+
|
|
1891
|
+
</th><th>
|
|
1892
|
+
|
|
1893
|
+
Type
|
|
1894
|
+
|
|
1895
|
+
</th><th>
|
|
1896
|
+
|
|
1897
|
+
Description
|
|
1898
|
+
|
|
1899
|
+
</th></tr></thead>
|
|
1900
|
+
<tbody><tr><td>
|
|
1901
|
+
|
|
1902
|
+
reverse
|
|
1903
|
+
|
|
1904
|
+
</td><td>
|
|
1905
|
+
|
|
1906
|
+
boolean
|
|
1907
|
+
|
|
1908
|
+
</td><td>
|
|
1909
|
+
|
|
1910
|
+
Whether it is inverted
|
|
1911
|
+
|
|
1912
|
+
</td></tr>
|
|
1913
|
+
</tbody></table>
|
|
1914
|
+
|
|
1915
|
+
## Returns
|
|
1916
|
+
|
|
1917
|
+
[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)
|
|
1918
|
+
|
|
1919
|
+
Text primitive object
|
|
1920
|
+
|
|
1921
|
+
## Remarks
|
|
1922
|
+
|
|
1923
|
+
The default font does not support inversion
|
|
1924
|
+
|
|
1925
|
+
## Example
|
|
1926
|
+
|
|
1927
|
+
```javascript
|
|
1928
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
|
|
1929
|
+
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
1930
|
+
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
1931
|
+
|
|
1932
|
+
// 2. 在顶层丝印(3)放置一行默认字体的文本(默认字体不支持反相)
|
|
1933
|
+
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
1934
|
+
const before = str.getState_Reverse();
|
|
1935
|
+
|
|
1936
|
+
// 3. 异步模式先换 Arial 字体再开启反相,一次 done() 同时提交两个修改
|
|
1937
|
+
const asyncStr = str.toAsync();
|
|
1938
|
+
asyncStr.setState_FontFamily('Arial');
|
|
1939
|
+
asyncStr.setState_Reverse(true);
|
|
1940
|
+
await asyncStr.done();
|
|
1941
|
+
|
|
1942
|
+
// 4. 从画布重新读取,确认修改生效(保留现场供观察)
|
|
1943
|
+
const refetched = await eda.pcb_PrimitiveString.get(str.getState_PrimitiveId());
|
|
1944
|
+
|
|
1945
|
+
console.log('reverse:', before, '→', refetched.getState_Reverse());
|
|
1946
|
+
console.log('fontFamily:', refetched.getState_FontFamily());
|
|
1947
|
+
```
|
|
1948
|
+
|
|
1949
|
+
### setstate_rotation
|
|
1950
|
+
|
|
1951
|
+
# IPCB\_PrimitiveString.setState\_Rotation() method
|
|
1952
|
+
|
|
1953
|
+
> 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.
|
|
1954
|
+
|
|
1955
|
+
Set the property state: rotation angle
|
|
1956
|
+
|
|
1957
|
+
## Signature
|
|
1958
|
+
|
|
1959
|
+
```typescript
|
|
1960
|
+
function setState_Rotation(rotation: number): IPCB_PrimitiveString;
|
|
1961
|
+
```
|
|
1962
|
+
|
|
1963
|
+
## Parameters
|
|
1964
|
+
|
|
1965
|
+
<table><thead><tr><th>
|
|
1966
|
+
|
|
1967
|
+
Parameter
|
|
1968
|
+
|
|
1969
|
+
</th><th>
|
|
1970
|
+
|
|
1971
|
+
Type
|
|
1972
|
+
|
|
1973
|
+
</th><th>
|
|
1974
|
+
|
|
1975
|
+
Description
|
|
1976
|
+
|
|
1977
|
+
</th></tr></thead>
|
|
1978
|
+
<tbody><tr><td>
|
|
1979
|
+
|
|
1980
|
+
rotation
|
|
1981
|
+
|
|
1982
|
+
</td><td>
|
|
1983
|
+
|
|
1984
|
+
number
|
|
1985
|
+
|
|
1986
|
+
</td><td>
|
|
1987
|
+
|
|
1988
|
+
Rotation angle
|
|
1989
|
+
|
|
1990
|
+
</td></tr>
|
|
1991
|
+
</tbody></table>
|
|
1992
|
+
|
|
1993
|
+
## Returns
|
|
1994
|
+
|
|
1995
|
+
[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)
|
|
1996
|
+
|
|
1997
|
+
Text primitive object
|
|
1998
|
+
|
|
1999
|
+
## Example
|
|
2000
|
+
|
|
2001
|
+
```javascript
|
|
2002
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
|
|
2003
|
+
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
2004
|
+
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
2005
|
+
|
|
2006
|
+
// 2. 在顶层丝印(3)放置一行不旋转(0°)的文本
|
|
2007
|
+
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
2008
|
+
const before = str.getState_Rotation();
|
|
2009
|
+
|
|
2010
|
+
// 3. 异步模式把文本旋转 90°(竖排)
|
|
2011
|
+
const asyncStr = str.toAsync();
|
|
2012
|
+
asyncStr.setState_Rotation(90);
|
|
2013
|
+
await asyncStr.done();
|
|
2014
|
+
|
|
2015
|
+
// 4. 从画布重新读取,确认修改生效(保留现场供观察)
|
|
2016
|
+
const refetched = await eda.pcb_PrimitiveString.get(str.getState_PrimitiveId());
|
|
2017
|
+
|
|
2018
|
+
console.log('rotation:', before, '→', refetched.getState_Rotation());
|
|
2019
|
+
```
|
|
2020
|
+
|
|
2021
|
+
### setstate_text
|
|
2022
|
+
|
|
2023
|
+
# IPCB\_PrimitiveString.setState\_Text() method
|
|
2024
|
+
|
|
2025
|
+
> 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.
|
|
2026
|
+
|
|
2027
|
+
Set the property state: text content
|
|
2028
|
+
|
|
2029
|
+
## Signature
|
|
2030
|
+
|
|
2031
|
+
```typescript
|
|
2032
|
+
function setState_Text(text: string): IPCB_PrimitiveString;
|
|
2033
|
+
```
|
|
2034
|
+
|
|
2035
|
+
## Parameters
|
|
2036
|
+
|
|
2037
|
+
<table><thead><tr><th>
|
|
2038
|
+
|
|
2039
|
+
Parameter
|
|
2040
|
+
|
|
2041
|
+
</th><th>
|
|
2042
|
+
|
|
2043
|
+
Type
|
|
2044
|
+
|
|
2045
|
+
</th><th>
|
|
2046
|
+
|
|
2047
|
+
Description
|
|
2048
|
+
|
|
2049
|
+
</th></tr></thead>
|
|
2050
|
+
<tbody><tr><td>
|
|
2051
|
+
|
|
2052
|
+
text
|
|
2053
|
+
|
|
2054
|
+
</td><td>
|
|
2055
|
+
|
|
2056
|
+
string
|
|
2057
|
+
|
|
2058
|
+
</td><td>
|
|
2059
|
+
|
|
2060
|
+
Text content
|
|
2061
|
+
|
|
2062
|
+
</td></tr>
|
|
2063
|
+
</tbody></table>
|
|
2064
|
+
|
|
2065
|
+
## Returns
|
|
2066
|
+
|
|
2067
|
+
[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)
|
|
2068
|
+
|
|
2069
|
+
Text primitive object
|
|
2070
|
+
|
|
2071
|
+
## Example
|
|
2072
|
+
|
|
2073
|
+
```javascript
|
|
2074
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
|
|
2075
|
+
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
2076
|
+
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
2077
|
+
|
|
2078
|
+
// 2. 在顶层丝印(3)放置一行文本
|
|
2079
|
+
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_V1.0', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
2080
|
+
const before = str.getState_Text();
|
|
2081
|
+
|
|
2082
|
+
// 3. 异步模式把内容改为新版本号
|
|
2083
|
+
const asyncStr = str.toAsync();
|
|
2084
|
+
asyncStr.setState_Text('嘉立创示例_V2.0');
|
|
2085
|
+
await asyncStr.done();
|
|
2086
|
+
|
|
2087
|
+
// 4. 从画布重新读取,确认修改生效(保留现场供观察)
|
|
2088
|
+
const refetched = await eda.pcb_PrimitiveString.get(str.getState_PrimitiveId());
|
|
2089
|
+
|
|
2090
|
+
console.log('text:', before, '→', refetched.getState_Text());
|
|
2091
|
+
```
|
|
2092
|
+
|
|
2093
|
+
### setstate_x
|
|
2094
|
+
|
|
2095
|
+
# IPCB\_PrimitiveString.setState\_X() method
|
|
2096
|
+
|
|
2097
|
+
> 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.
|
|
2098
|
+
|
|
2099
|
+
Set the property state: X coordinate
|
|
2100
|
+
|
|
2101
|
+
## Signature
|
|
2102
|
+
|
|
2103
|
+
```typescript
|
|
2104
|
+
function setState_X(x: number): IPCB_PrimitiveString;
|
|
2105
|
+
```
|
|
2106
|
+
|
|
2107
|
+
## Parameters
|
|
2108
|
+
|
|
2109
|
+
<table><thead><tr><th>
|
|
2110
|
+
|
|
2111
|
+
Parameter
|
|
2112
|
+
|
|
2113
|
+
</th><th>
|
|
2114
|
+
|
|
2115
|
+
Type
|
|
2116
|
+
|
|
2117
|
+
</th><th>
|
|
2118
|
+
|
|
2119
|
+
Description
|
|
2120
|
+
|
|
2121
|
+
</th></tr></thead>
|
|
2122
|
+
<tbody><tr><td>
|
|
2123
|
+
|
|
2124
|
+
x
|
|
2125
|
+
|
|
2126
|
+
</td><td>
|
|
2127
|
+
|
|
2128
|
+
number
|
|
2129
|
+
|
|
2130
|
+
</td><td>
|
|
2131
|
+
|
|
2132
|
+
X coordinate
|
|
2133
|
+
|
|
2134
|
+
</td></tr>
|
|
2135
|
+
</tbody></table>
|
|
2136
|
+
|
|
2137
|
+
## Returns
|
|
2138
|
+
|
|
2139
|
+
[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)
|
|
2140
|
+
|
|
2141
|
+
Text primitive object
|
|
2142
|
+
|
|
2143
|
+
## Example
|
|
2144
|
+
|
|
2145
|
+
```javascript
|
|
2146
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
|
|
2147
|
+
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
2148
|
+
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
2149
|
+
|
|
2150
|
+
// 2. 在顶层丝印(3)放置一行文本
|
|
2151
|
+
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
2152
|
+
const before = str.getState_X();
|
|
2153
|
+
|
|
2154
|
+
// 3. 异步模式把锚点向右平移 500mil
|
|
2155
|
+
const asyncStr = str.toAsync();
|
|
2156
|
+
asyncStr.setState_X(before + 500);
|
|
2157
|
+
await asyncStr.done();
|
|
2158
|
+
|
|
2159
|
+
// 4. 从画布重新读取,确认修改生效(保留现场供观察)
|
|
2160
|
+
const refetched = await eda.pcb_PrimitiveString.get(str.getState_PrimitiveId());
|
|
2161
|
+
|
|
2162
|
+
console.log('x:', before, '→', refetched.getState_X());
|
|
2163
|
+
```
|
|
2164
|
+
|
|
2165
|
+
### setstate_y
|
|
2166
|
+
|
|
2167
|
+
# IPCB\_PrimitiveString.setState\_Y() method
|
|
2168
|
+
|
|
2169
|
+
> 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.
|
|
2170
|
+
|
|
2171
|
+
Set the property state: Y coordinate
|
|
2172
|
+
|
|
2173
|
+
## Signature
|
|
2174
|
+
|
|
2175
|
+
```typescript
|
|
2176
|
+
function setState_Y(y: number): IPCB_PrimitiveString;
|
|
2177
|
+
```
|
|
2178
|
+
|
|
2179
|
+
## Parameters
|
|
2180
|
+
|
|
2181
|
+
<table><thead><tr><th>
|
|
2182
|
+
|
|
2183
|
+
Parameter
|
|
2184
|
+
|
|
2185
|
+
</th><th>
|
|
2186
|
+
|
|
2187
|
+
Type
|
|
2188
|
+
|
|
2189
|
+
</th><th>
|
|
2190
|
+
|
|
2191
|
+
Description
|
|
2192
|
+
|
|
2193
|
+
</th></tr></thead>
|
|
2194
|
+
<tbody><tr><td>
|
|
2195
|
+
|
|
2196
|
+
y
|
|
2197
|
+
|
|
2198
|
+
</td><td>
|
|
2199
|
+
|
|
2200
|
+
number
|
|
2201
|
+
|
|
2202
|
+
</td><td>
|
|
2203
|
+
|
|
2204
|
+
Y coordinate
|
|
2205
|
+
|
|
2206
|
+
</td></tr>
|
|
2207
|
+
</tbody></table>
|
|
2208
|
+
|
|
2209
|
+
## Returns
|
|
2210
|
+
|
|
2211
|
+
[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)
|
|
2212
|
+
|
|
2213
|
+
Text primitive object
|
|
2214
|
+
|
|
2215
|
+
## Example
|
|
2216
|
+
|
|
2217
|
+
```javascript
|
|
2218
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
|
|
2219
|
+
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
2220
|
+
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
2221
|
+
|
|
2222
|
+
// 2. 在顶层丝印(3)放置一行文本
|
|
2223
|
+
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
2224
|
+
const before = str.getState_Y();
|
|
2225
|
+
|
|
2226
|
+
// 3. 异步模式把锚点向上平移 500mil
|
|
2227
|
+
const asyncStr = str.toAsync();
|
|
2228
|
+
asyncStr.setState_Y(before + 500);
|
|
2229
|
+
await asyncStr.done();
|
|
2230
|
+
|
|
2231
|
+
// 4. 从画布重新读取,确认修改生效(保留现场供观察)
|
|
2232
|
+
const refetched = await eda.pcb_PrimitiveString.get(str.getState_PrimitiveId());
|
|
2233
|
+
|
|
2234
|
+
console.log('y:', before, '→', refetched.getState_Y());
|
|
2235
|
+
```
|
|
2236
|
+
|
|
2237
|
+
### toasync
|
|
2238
|
+
|
|
2239
|
+
# IPCB\_PrimitiveString.toAsync() method
|
|
2240
|
+
|
|
2241
|
+
Convert Primitive to Async primitive
|
|
2242
|
+
|
|
2243
|
+
## Signature
|
|
2244
|
+
|
|
2245
|
+
```typescript
|
|
2246
|
+
function toAsync(): IPCB_PrimitiveString;
|
|
2247
|
+
```
|
|
2248
|
+
|
|
2249
|
+
## Returns
|
|
2250
|
+
|
|
2251
|
+
[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)
|
|
2252
|
+
|
|
2253
|
+
Text primitive object
|
|
2254
|
+
|
|
2255
|
+
## Example
|
|
2256
|
+
|
|
2257
|
+
```javascript
|
|
2258
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
|
|
2259
|
+
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
2260
|
+
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
2261
|
+
|
|
2262
|
+
// 2. 在顶层丝印(3)放置一行文本
|
|
2263
|
+
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
2264
|
+
|
|
2265
|
+
// 3. 切换异步模式后批量修改:改内容 + 加大字号
|
|
2266
|
+
const asyncStr = str.toAsync();
|
|
2267
|
+
asyncStr.setState_Text('嘉立创示例_批量');
|
|
2268
|
+
asyncStr.setState_FontSize(60);
|
|
2269
|
+
await asyncStr.done();
|
|
2270
|
+
|
|
2271
|
+
// 4. 从画布重新读取,确认批量修改已生效(保留现场供观察)
|
|
2272
|
+
const refetched = await eda.pcb_PrimitiveString.get(str.getState_PrimitiveId());
|
|
2273
|
+
|
|
2274
|
+
console.log('text:', refetched.getState_Text());
|
|
2275
|
+
console.log('fontSize:', refetched.getState_FontSize());
|
|
2276
|
+
```
|
|
2277
|
+
|
|
2278
|
+
### tosync
|
|
2279
|
+
|
|
2280
|
+
# IPCB\_PrimitiveString.toSync() method
|
|
2281
|
+
|
|
2282
|
+
Convert Primitive to Sync primitive
|
|
2283
|
+
|
|
2284
|
+
## Signature
|
|
2285
|
+
|
|
2286
|
+
```typescript
|
|
2287
|
+
function toSync(): IPCB_PrimitiveString;
|
|
2288
|
+
```
|
|
2289
|
+
|
|
2290
|
+
## Returns
|
|
2291
|
+
|
|
2292
|
+
[IPCB\_PrimitiveString](./IPCB_PrimitiveString.md)
|
|
2293
|
+
|
|
2294
|
+
Text primitive object
|
|
2295
|
+
|
|
2296
|
+
## Example
|
|
2297
|
+
|
|
2298
|
+
```javascript
|
|
2299
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试图元重合
|
|
2300
|
+
const x = 2000 + Math.floor(Math.random() * 100000);
|
|
2301
|
+
const y = 2000 + Math.floor(Math.random() * 100000);
|
|
2302
|
+
|
|
2303
|
+
// 2. 在顶层丝印(3)放置一行文本
|
|
2304
|
+
const str = await eda.pcb_PrimitiveString.create(3, x, y, '嘉立创示例_TEXT', 'default', 45, 6, 3, 0, false, 0, false, false);
|
|
2305
|
+
const before = str.isAsync();
|
|
2306
|
+
|
|
2307
|
+
// 3. 转换为同步图元(保留现场供观察)
|
|
2308
|
+
const syncStr = str.toSync();
|
|
2309
|
+
const after = syncStr.isAsync();
|
|
2310
|
+
|
|
2311
|
+
// 4. 同步图元直接读取属性,无需提交
|
|
2312
|
+
console.log('isAsync:', before, '→', after);
|
|
2313
|
+
console.log('primitiveType:', syncStr.getState_PrimitiveType());
|
|
2314
|
+
console.log('layer:', syncStr.getState_Layer());
|
|
2315
|
+
```
|