@windypro-rourou/dsh-eda 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/backend.js +49 -0
- package/lib/capabilities.js +6 -2
- package/lib/client.js +33 -0
- package/lib/index.js +197 -3
- 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,1777 +1,1777 @@
|
|
|
1
|
-
# ISCH\_PrimitiveRectangle class
|
|
2
|
-
|
|
3
|
-
Rectangle primitive
|
|
4
|
-
|
|
5
|
-
## Signature
|
|
6
|
-
|
|
7
|
-
```typescript
|
|
8
|
-
class ISCH_PrimitiveRectangle implements ISCH_Primitive
|
|
9
|
-
```
|
|
10
|
-
**Implements:** [ISCH\_Primitive](../interfaces/ISCH_Primitive.md)
|
|
11
|
-
|
|
12
|
-
## Remarks
|
|
13
|
-
|
|
14
|
-
## Methods
|
|
15
|
-
|
|
16
|
-
<table><thead><tr><th>
|
|
17
|
-
|
|
18
|
-
Method
|
|
19
|
-
|
|
20
|
-
</th><th>
|
|
21
|
-
|
|
22
|
-
Modifiers
|
|
23
|
-
|
|
24
|
-
</th><th>
|
|
25
|
-
|
|
26
|
-
Description
|
|
27
|
-
|
|
28
|
-
</th></tr></thead>
|
|
29
|
-
<tbody><tr><td>
|
|
30
|
-
|
|
31
|
-
[done()](./ISCH_PrimitiveRectangle.md)
|
|
32
|
-
|
|
33
|
-
</td><td>
|
|
34
|
-
|
|
35
|
-
</td><td>
|
|
36
|
-
|
|
37
|
-
**_(BETA)_** Apply the changes to the primitives to the canvas
|
|
38
|
-
|
|
39
|
-
</td></tr>
|
|
40
|
-
<tr><td>
|
|
41
|
-
|
|
42
|
-
[getState\_Color()](./ISCH_PrimitiveRectangle.md)
|
|
43
|
-
|
|
44
|
-
</td><td>
|
|
45
|
-
|
|
46
|
-
</td><td>
|
|
47
|
-
|
|
48
|
-
Get the property state: border color
|
|
49
|
-
|
|
50
|
-
</td></tr>
|
|
51
|
-
<tr><td>
|
|
52
|
-
|
|
53
|
-
[getState\_CornerRadius()](./ISCH_PrimitiveRectangle.md)
|
|
54
|
-
|
|
55
|
-
</td><td>
|
|
56
|
-
|
|
57
|
-
</td><td>
|
|
58
|
-
|
|
59
|
-
Get the property state: corner radius
|
|
60
|
-
|
|
61
|
-
</td></tr>
|
|
62
|
-
<tr><td>
|
|
63
|
-
|
|
64
|
-
[getState\_FillColor()](./ISCH_PrimitiveRectangle.md)
|
|
65
|
-
|
|
66
|
-
</td><td>
|
|
67
|
-
|
|
68
|
-
</td><td>
|
|
69
|
-
|
|
70
|
-
Get the property state: fill color
|
|
71
|
-
|
|
72
|
-
</td></tr>
|
|
73
|
-
<tr><td>
|
|
74
|
-
|
|
75
|
-
[getState\_FillStyle()](./ISCH_PrimitiveRectangle.md)
|
|
76
|
-
|
|
77
|
-
</td><td>
|
|
78
|
-
|
|
79
|
-
</td><td>
|
|
80
|
-
|
|
81
|
-
Get the property state: fill style
|
|
82
|
-
|
|
83
|
-
</td></tr>
|
|
84
|
-
<tr><td>
|
|
85
|
-
|
|
86
|
-
[getState\_Height()](./ISCH_PrimitiveRectangle.md)
|
|
87
|
-
|
|
88
|
-
</td><td>
|
|
89
|
-
|
|
90
|
-
</td><td>
|
|
91
|
-
|
|
92
|
-
Get the property state: height
|
|
93
|
-
|
|
94
|
-
</td></tr>
|
|
95
|
-
<tr><td>
|
|
96
|
-
|
|
97
|
-
[getState\_LineType()](./ISCH_PrimitiveRectangle.md)
|
|
98
|
-
|
|
99
|
-
</td><td>
|
|
100
|
-
|
|
101
|
-
</td><td>
|
|
102
|
-
|
|
103
|
-
Get the property state: line type
|
|
104
|
-
|
|
105
|
-
</td></tr>
|
|
106
|
-
<tr><td>
|
|
107
|
-
|
|
108
|
-
[getState\_LineWidth()](./ISCH_PrimitiveRectangle.md)
|
|
109
|
-
|
|
110
|
-
</td><td>
|
|
111
|
-
|
|
112
|
-
</td><td>
|
|
113
|
-
|
|
114
|
-
Get the property state: Line width
|
|
115
|
-
|
|
116
|
-
</td></tr>
|
|
117
|
-
<tr><td>
|
|
118
|
-
|
|
119
|
-
[getState\_PrimitiveId()](./ISCH_PrimitiveRectangle.md)
|
|
120
|
-
|
|
121
|
-
</td><td>
|
|
122
|
-
|
|
123
|
-
</td><td>
|
|
124
|
-
|
|
125
|
-
Get the property state: primitive ID
|
|
126
|
-
|
|
127
|
-
</td></tr>
|
|
128
|
-
<tr><td>
|
|
129
|
-
|
|
130
|
-
[getState\_PrimitiveType()](./ISCH_PrimitiveRectangle.md)
|
|
131
|
-
|
|
132
|
-
</td><td>
|
|
133
|
-
|
|
134
|
-
</td><td>
|
|
135
|
-
|
|
136
|
-
Get the property state: primitive type
|
|
137
|
-
|
|
138
|
-
</td></tr>
|
|
139
|
-
<tr><td>
|
|
140
|
-
|
|
141
|
-
[getState\_Rotation()](./ISCH_PrimitiveRectangle.md)
|
|
142
|
-
|
|
143
|
-
</td><td>
|
|
144
|
-
|
|
145
|
-
</td><td>
|
|
146
|
-
|
|
147
|
-
Get the property state: rotation angle
|
|
148
|
-
|
|
149
|
-
</td></tr>
|
|
150
|
-
<tr><td>
|
|
151
|
-
|
|
152
|
-
[getState\_TopLeftX()](./ISCH_PrimitiveRectangle.md)
|
|
153
|
-
|
|
154
|
-
</td><td>
|
|
155
|
-
|
|
156
|
-
</td><td>
|
|
157
|
-
|
|
158
|
-
Get the property state: top-left point X
|
|
159
|
-
|
|
160
|
-
</td></tr>
|
|
161
|
-
<tr><td>
|
|
162
|
-
|
|
163
|
-
[getState\_TopLeftY()](./ISCH_PrimitiveRectangle.md)
|
|
164
|
-
|
|
165
|
-
</td><td>
|
|
166
|
-
|
|
167
|
-
</td><td>
|
|
168
|
-
|
|
169
|
-
Get the property state: top-left point Y
|
|
170
|
-
|
|
171
|
-
</td></tr>
|
|
172
|
-
<tr><td>
|
|
173
|
-
|
|
174
|
-
[getState\_Width()](./ISCH_PrimitiveRectangle.md)
|
|
175
|
-
|
|
176
|
-
</td><td>
|
|
177
|
-
|
|
178
|
-
</td><td>
|
|
179
|
-
|
|
180
|
-
Get the property state: width
|
|
181
|
-
|
|
182
|
-
</td></tr>
|
|
183
|
-
<tr><td>
|
|
184
|
-
|
|
185
|
-
[isAsync()](./ISCH_PrimitiveRectangle.md)
|
|
186
|
-
|
|
187
|
-
</td><td>
|
|
188
|
-
|
|
189
|
-
</td><td>
|
|
190
|
-
|
|
191
|
-
Query whether the primitive is an async primitive
|
|
192
|
-
|
|
193
|
-
</td></tr>
|
|
194
|
-
<tr><td>
|
|
195
|
-
|
|
196
|
-
[reset()](./ISCH_PrimitiveRectangle.md)
|
|
197
|
-
|
|
198
|
-
</td><td>
|
|
199
|
-
|
|
200
|
-
</td><td>
|
|
201
|
-
|
|
202
|
-
**_(BETA)_** Reset the async primitive to the current canvas state
|
|
203
|
-
|
|
204
|
-
</td></tr>
|
|
205
|
-
<tr><td>
|
|
206
|
-
|
|
207
|
-
[setState\_Color(color)](./ISCH_PrimitiveRectangle.md)
|
|
208
|
-
|
|
209
|
-
</td><td>
|
|
210
|
-
|
|
211
|
-
</td><td>
|
|
212
|
-
|
|
213
|
-
**_(BETA)_** Set the property state: border color
|
|
214
|
-
|
|
215
|
-
</td></tr>
|
|
216
|
-
<tr><td>
|
|
217
|
-
|
|
218
|
-
[setState\_CornerRadius(cornerRadius)](./ISCH_PrimitiveRectangle.md)
|
|
219
|
-
|
|
220
|
-
</td><td>
|
|
221
|
-
|
|
222
|
-
</td><td>
|
|
223
|
-
|
|
224
|
-
**_(BETA)_** Set the property state: corner radius
|
|
225
|
-
|
|
226
|
-
</td></tr>
|
|
227
|
-
<tr><td>
|
|
228
|
-
|
|
229
|
-
[setState\_FillColor(fillColor)](./ISCH_PrimitiveRectangle.md)
|
|
230
|
-
|
|
231
|
-
</td><td>
|
|
232
|
-
|
|
233
|
-
</td><td>
|
|
234
|
-
|
|
235
|
-
**_(BETA)_** Set the property state: fill color
|
|
236
|
-
|
|
237
|
-
</td></tr>
|
|
238
|
-
<tr><td>
|
|
239
|
-
|
|
240
|
-
[setState\_FillStyle(fillStyle)](./ISCH_PrimitiveRectangle.md)
|
|
241
|
-
|
|
242
|
-
</td><td>
|
|
243
|
-
|
|
244
|
-
</td><td>
|
|
245
|
-
|
|
246
|
-
**_(BETA)_** Set the property state: fill style
|
|
247
|
-
|
|
248
|
-
</td></tr>
|
|
249
|
-
<tr><td>
|
|
250
|
-
|
|
251
|
-
[setState\_Height(height)](./ISCH_PrimitiveRectangle.md)
|
|
252
|
-
|
|
253
|
-
</td><td>
|
|
254
|
-
|
|
255
|
-
</td><td>
|
|
256
|
-
|
|
257
|
-
**_(BETA)_** Set the property state: height
|
|
258
|
-
|
|
259
|
-
</td></tr>
|
|
260
|
-
<tr><td>
|
|
261
|
-
|
|
262
|
-
[setState\_LineType(lineType)](./ISCH_PrimitiveRectangle.md)
|
|
263
|
-
|
|
264
|
-
</td><td>
|
|
265
|
-
|
|
266
|
-
</td><td>
|
|
267
|
-
|
|
268
|
-
**_(BETA)_** Set the property state: line type
|
|
269
|
-
|
|
270
|
-
</td></tr>
|
|
271
|
-
<tr><td>
|
|
272
|
-
|
|
273
|
-
[setState\_LineWidth(lineWidth)](./ISCH_PrimitiveRectangle.md)
|
|
274
|
-
|
|
275
|
-
</td><td>
|
|
276
|
-
|
|
277
|
-
</td><td>
|
|
278
|
-
|
|
279
|
-
**_(BETA)_** Set the property state: Line width
|
|
280
|
-
|
|
281
|
-
</td></tr>
|
|
282
|
-
<tr><td>
|
|
283
|
-
|
|
284
|
-
[setState\_Rotation(rotation)](./ISCH_PrimitiveRectangle.md)
|
|
285
|
-
|
|
286
|
-
</td><td>
|
|
287
|
-
|
|
288
|
-
</td><td>
|
|
289
|
-
|
|
290
|
-
**_(BETA)_** Set the property state: rotation angle
|
|
291
|
-
|
|
292
|
-
</td></tr>
|
|
293
|
-
<tr><td>
|
|
294
|
-
|
|
295
|
-
[setState\_TopLeftX(topLeftX)](./ISCH_PrimitiveRectangle.md)
|
|
296
|
-
|
|
297
|
-
</td><td>
|
|
298
|
-
|
|
299
|
-
</td><td>
|
|
300
|
-
|
|
301
|
-
**_(BETA)_** Set the property state: top-left point X
|
|
302
|
-
|
|
303
|
-
</td></tr>
|
|
304
|
-
<tr><td>
|
|
305
|
-
|
|
306
|
-
[setState\_TopLeftY(topLeftY)](./ISCH_PrimitiveRectangle.md)
|
|
307
|
-
|
|
308
|
-
</td><td>
|
|
309
|
-
|
|
310
|
-
</td><td>
|
|
311
|
-
|
|
312
|
-
**_(BETA)_** Set the property state: top-left point Y
|
|
313
|
-
|
|
314
|
-
</td></tr>
|
|
315
|
-
<tr><td>
|
|
316
|
-
|
|
317
|
-
[setState\_Width(width)](./ISCH_PrimitiveRectangle.md)
|
|
318
|
-
|
|
319
|
-
</td><td>
|
|
320
|
-
|
|
321
|
-
</td><td>
|
|
322
|
-
|
|
323
|
-
**_(BETA)_** Set the property state: width
|
|
324
|
-
|
|
325
|
-
</td></tr>
|
|
326
|
-
<tr><td>
|
|
327
|
-
|
|
328
|
-
[toAsync()](./ISCH_PrimitiveRectangle.md)
|
|
329
|
-
|
|
330
|
-
</td><td>
|
|
331
|
-
|
|
332
|
-
</td><td>
|
|
333
|
-
|
|
334
|
-
Convert Primitive to Async primitive
|
|
335
|
-
|
|
336
|
-
</td></tr>
|
|
337
|
-
<tr><td>
|
|
338
|
-
|
|
339
|
-
[toSync()](./ISCH_PrimitiveRectangle.md)
|
|
340
|
-
|
|
341
|
-
</td><td>
|
|
342
|
-
|
|
343
|
-
</td><td>
|
|
344
|
-
|
|
345
|
-
Convert Primitive to Sync primitive
|
|
346
|
-
|
|
347
|
-
</td></tr>
|
|
348
|
-
</tbody></table>
|
|
349
|
-
|
|
350
|
-
---
|
|
351
|
-
|
|
352
|
-
## 方法详情
|
|
353
|
-
|
|
354
|
-
### done
|
|
355
|
-
|
|
356
|
-
# ISCH\_PrimitiveRectangle.done() method
|
|
357
|
-
|
|
358
|
-
> 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.
|
|
359
|
-
|
|
360
|
-
Apply the changes to the primitives to the canvas
|
|
361
|
-
|
|
362
|
-
## Signature
|
|
363
|
-
|
|
364
|
-
```typescript
|
|
365
|
-
function done(): Promise<ISCH_PrimitiveRectangle>;
|
|
366
|
-
```
|
|
367
|
-
|
|
368
|
-
## Returns
|
|
369
|
-
|
|
370
|
-
Promise<[ISCH\_PrimitiveRectangle](./ISCH_PrimitiveRectangle.md)<!-- -->>
|
|
371
|
-
|
|
372
|
-
Rectangle primitive object
|
|
373
|
-
|
|
374
|
-
## Example
|
|
375
|
-
|
|
376
|
-
```javascript
|
|
377
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试矩形重合
|
|
378
|
-
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
379
|
-
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
380
|
-
|
|
381
|
-
// 2. 创建一个 200×100 的测试矩形(SCH 坐标单位 10mil)
|
|
382
|
-
const rect = await eda.sch_PrimitiveRectangle.create(x, y, 200, 100);
|
|
383
|
-
|
|
384
|
-
// 3. 切换异步模式,累计两处修改(尺寸扩大 + 改边框颜色)
|
|
385
|
-
const asyncRect = rect.toAsync();
|
|
386
|
-
asyncRect.setState_Width(300);
|
|
387
|
-
asyncRect.setState_Color('#00AA00');
|
|
388
|
-
|
|
389
|
-
// 4. 一次性提交到画布
|
|
390
|
-
await asyncRect.done();
|
|
391
|
-
|
|
392
|
-
// 5. 从画布重新读取,确认两处修改都已生效(保留现场供观察)
|
|
393
|
-
const refetched = await eda.sch_PrimitiveRectangle.get(rect.getState_PrimitiveId());
|
|
394
|
-
|
|
395
|
-
console.log('width:', 200, '→', refetched.getState_Width());
|
|
396
|
-
console.log('color:', '#00AA00', '→', refetched.getState_Color());
|
|
397
|
-
```
|
|
398
|
-
|
|
399
|
-
### getstate_color
|
|
400
|
-
|
|
401
|
-
# ISCH\_PrimitiveRectangle.getState\_Color() method
|
|
402
|
-
|
|
403
|
-
Get the property state: border color
|
|
404
|
-
|
|
405
|
-
## Signature
|
|
406
|
-
|
|
407
|
-
```typescript
|
|
408
|
-
function getState_Color(): string | null;
|
|
409
|
-
```
|
|
410
|
-
|
|
411
|
-
## Returns
|
|
412
|
-
|
|
413
|
-
string \| null
|
|
414
|
-
|
|
415
|
-
Border color
|
|
416
|
-
|
|
417
|
-
## Example
|
|
418
|
-
|
|
419
|
-
```javascript
|
|
420
|
-
// 1. 创建一个红色边框的测试矩形(SCH 坐标单位 10mil)
|
|
421
|
-
const rect = await eda.sch_PrimitiveRectangle.create(400, 300, 200, 100, 0, 0, '#FF0000');
|
|
422
|
-
|
|
423
|
-
// 2. 读取边框颜色
|
|
424
|
-
const color = rect.getState_Color();
|
|
425
|
-
|
|
426
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
427
|
-
await eda.sch_PrimitiveRectangle.delete([rect.getState_PrimitiveId()]);
|
|
428
|
-
|
|
429
|
-
console.log('color:', color);
|
|
430
|
-
```
|
|
431
|
-
|
|
432
|
-
### getstate_cornerradius
|
|
433
|
-
|
|
434
|
-
# ISCH\_PrimitiveRectangle.getState\_CornerRadius() method
|
|
435
|
-
|
|
436
|
-
Get the property state: corner radius
|
|
437
|
-
|
|
438
|
-
## Signature
|
|
439
|
-
|
|
440
|
-
```typescript
|
|
441
|
-
function getState_CornerRadius(): number;
|
|
442
|
-
```
|
|
443
|
-
|
|
444
|
-
## Returns
|
|
445
|
-
|
|
446
|
-
number
|
|
447
|
-
|
|
448
|
-
Corner radius
|
|
449
|
-
|
|
450
|
-
## Example
|
|
451
|
-
|
|
452
|
-
```javascript
|
|
453
|
-
// 1. 创建一个圆角半径 10 的测试矩形(SCH 坐标单位 10mil)
|
|
454
|
-
const rect = await eda.sch_PrimitiveRectangle.create(400, 300, 200, 100, 10);
|
|
455
|
-
|
|
456
|
-
// 2. 读取圆角半径
|
|
457
|
-
const cornerRadius = rect.getState_CornerRadius();
|
|
458
|
-
|
|
459
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
460
|
-
await eda.sch_PrimitiveRectangle.delete([rect.getState_PrimitiveId()]);
|
|
461
|
-
|
|
462
|
-
console.log('cornerRadius:', cornerRadius);
|
|
463
|
-
```
|
|
464
|
-
|
|
465
|
-
### getstate_fillcolor
|
|
466
|
-
|
|
467
|
-
# ISCH\_PrimitiveRectangle.getState\_FillColor() method
|
|
468
|
-
|
|
469
|
-
Get the property state: fill color
|
|
470
|
-
|
|
471
|
-
## Signature
|
|
472
|
-
|
|
473
|
-
```typescript
|
|
474
|
-
function getState_FillColor(): string | null;
|
|
475
|
-
```
|
|
476
|
-
|
|
477
|
-
## Returns
|
|
478
|
-
|
|
479
|
-
string \| null
|
|
480
|
-
|
|
481
|
-
Fill color
|
|
482
|
-
|
|
483
|
-
## Example
|
|
484
|
-
|
|
485
|
-
```javascript
|
|
486
|
-
// 1. 创建一个黄色填充的测试矩形(SCH 坐标单位 10mil)
|
|
487
|
-
const rect = await eda.sch_PrimitiveRectangle.create(400, 300, 200, 100, 0, 0, null, '#FFFF00');
|
|
488
|
-
|
|
489
|
-
// 2. 读取填充颜色
|
|
490
|
-
const fillColor = rect.getState_FillColor();
|
|
491
|
-
|
|
492
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
493
|
-
await eda.sch_PrimitiveRectangle.delete([rect.getState_PrimitiveId()]);
|
|
494
|
-
|
|
495
|
-
console.log('fillColor:', fillColor);
|
|
496
|
-
```
|
|
497
|
-
|
|
498
|
-
### getstate_fillstyle
|
|
499
|
-
|
|
500
|
-
# ISCH\_PrimitiveRectangle.getState\_FillStyle() method
|
|
501
|
-
|
|
502
|
-
Get the property state: fill style
|
|
503
|
-
|
|
504
|
-
## Signature
|
|
505
|
-
|
|
506
|
-
```typescript
|
|
507
|
-
function getState_FillStyle(): ESCH_PrimitiveFillStyle | null;
|
|
508
|
-
```
|
|
509
|
-
|
|
510
|
-
## Returns
|
|
511
|
-
|
|
512
|
-
[ESCH\_PrimitiveFillStyle](../enums/ESCH_PrimitiveFillStyle.md) \| null
|
|
513
|
-
|
|
514
|
-
Fill style
|
|
515
|
-
|
|
516
|
-
## Example
|
|
517
|
-
|
|
518
|
-
```javascript
|
|
519
|
-
// 1. 创建一个网格填充的测试矩形(SCH 坐标单位 10mil)
|
|
520
|
-
const rect = await eda.sch_PrimitiveRectangle.create(400, 300, 200, 100, 0, 0, null, null, null, null, 'Grid');
|
|
521
|
-
|
|
522
|
-
// 2. 读取填充样式
|
|
523
|
-
const fillStyle = rect.getState_FillStyle();
|
|
524
|
-
|
|
525
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
526
|
-
await eda.sch_PrimitiveRectangle.delete([rect.getState_PrimitiveId()]);
|
|
527
|
-
|
|
528
|
-
console.log('fillStyle:', fillStyle);
|
|
529
|
-
```
|
|
530
|
-
|
|
531
|
-
### getstate_height
|
|
532
|
-
|
|
533
|
-
# ISCH\_PrimitiveRectangle.getState\_Height() method
|
|
534
|
-
|
|
535
|
-
Get the property state: height
|
|
536
|
-
|
|
537
|
-
## Signature
|
|
538
|
-
|
|
539
|
-
```typescript
|
|
540
|
-
function getState_Height(): number;
|
|
541
|
-
```
|
|
542
|
-
|
|
543
|
-
## Returns
|
|
544
|
-
|
|
545
|
-
number
|
|
546
|
-
|
|
547
|
-
Height
|
|
548
|
-
|
|
549
|
-
## Example
|
|
550
|
-
|
|
551
|
-
```javascript
|
|
552
|
-
// 1. 创建一个 200×100 的测试矩形(SCH 坐标单位 10mil)
|
|
553
|
-
const rect = await eda.sch_PrimitiveRectangle.create(400, 300, 200, 100);
|
|
554
|
-
|
|
555
|
-
// 2. 读取矩形的高
|
|
556
|
-
const height = rect.getState_Height();
|
|
557
|
-
|
|
558
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
559
|
-
await eda.sch_PrimitiveRectangle.delete([rect.getState_PrimitiveId()]);
|
|
560
|
-
|
|
561
|
-
console.log('height:', height);
|
|
562
|
-
```
|
|
563
|
-
|
|
564
|
-
### getstate_linetype
|
|
565
|
-
|
|
566
|
-
# ISCH\_PrimitiveRectangle.getState\_LineType() method
|
|
567
|
-
|
|
568
|
-
Get the property state: line type
|
|
569
|
-
|
|
570
|
-
## Signature
|
|
571
|
-
|
|
572
|
-
```typescript
|
|
573
|
-
function getState_LineType(): ESCH_PrimitiveLineType | null;
|
|
574
|
-
```
|
|
575
|
-
|
|
576
|
-
## Returns
|
|
577
|
-
|
|
578
|
-
[ESCH\_PrimitiveLineType](../enums/ESCH_PrimitiveLineType.md) \| null
|
|
579
|
-
|
|
580
|
-
Line type
|
|
581
|
-
|
|
582
|
-
## Example
|
|
583
|
-
|
|
584
|
-
```javascript
|
|
585
|
-
// 1. 创建一个虚线边框的测试矩形(末参 1 = 虚线,SCH 坐标单位 10mil)
|
|
586
|
-
const rect = await eda.sch_PrimitiveRectangle.create(400, 300, 200, 100, 0, 0, '#FF0000', null, 6, 1);
|
|
587
|
-
|
|
588
|
-
// 2. 读取线型
|
|
589
|
-
const lineType = rect.getState_LineType();
|
|
590
|
-
|
|
591
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
592
|
-
await eda.sch_PrimitiveRectangle.delete([rect.getState_PrimitiveId()]);
|
|
593
|
-
|
|
594
|
-
console.log('lineType:', lineType);
|
|
595
|
-
```
|
|
596
|
-
|
|
597
|
-
### getstate_linewidth
|
|
598
|
-
|
|
599
|
-
# ISCH\_PrimitiveRectangle.getState\_LineWidth() method
|
|
600
|
-
|
|
601
|
-
Get the property state: Line width
|
|
602
|
-
|
|
603
|
-
## Signature
|
|
604
|
-
|
|
605
|
-
```typescript
|
|
606
|
-
function getState_LineWidth(): number | null;
|
|
607
|
-
```
|
|
608
|
-
|
|
609
|
-
## Returns
|
|
610
|
-
|
|
611
|
-
number \| null
|
|
612
|
-
|
|
613
|
-
Line width
|
|
614
|
-
|
|
615
|
-
## Example
|
|
616
|
-
|
|
617
|
-
```javascript
|
|
618
|
-
// 1. 创建一个线宽 6 的测试矩形(SCH 坐标单位 10mil)
|
|
619
|
-
const rect = await eda.sch_PrimitiveRectangle.create(400, 300, 200, 100, 0, 0, '#FF0000', null, 6);
|
|
620
|
-
|
|
621
|
-
// 2. 读取边框线宽
|
|
622
|
-
const lineWidth = rect.getState_LineWidth();
|
|
623
|
-
|
|
624
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
625
|
-
await eda.sch_PrimitiveRectangle.delete([rect.getState_PrimitiveId()]);
|
|
626
|
-
|
|
627
|
-
console.log('lineWidth:', lineWidth);
|
|
628
|
-
```
|
|
629
|
-
|
|
630
|
-
### getstate_primitiveid
|
|
631
|
-
|
|
632
|
-
# ISCH\_PrimitiveRectangle.getState\_PrimitiveId() method
|
|
633
|
-
|
|
634
|
-
Get the property state: primitive ID
|
|
635
|
-
|
|
636
|
-
## Signature
|
|
637
|
-
|
|
638
|
-
```typescript
|
|
639
|
-
function getState_PrimitiveId(): string;
|
|
640
|
-
```
|
|
641
|
-
|
|
642
|
-
## Returns
|
|
643
|
-
|
|
644
|
-
string
|
|
645
|
-
|
|
646
|
-
Primitive ID
|
|
647
|
-
|
|
648
|
-
## Example
|
|
649
|
-
|
|
650
|
-
```javascript
|
|
651
|
-
// 1. 创建一个测试矩形(SCH 坐标单位 10mil)
|
|
652
|
-
const rect = await eda.sch_PrimitiveRectangle.create(400, 300, 200, 100);
|
|
653
|
-
|
|
654
|
-
// 2. 读取图元 ID
|
|
655
|
-
const primitiveId = rect.getState_PrimitiveId();
|
|
656
|
-
|
|
657
|
-
// 3. 用 ID 从画布重取矩形,验证 ID 有效
|
|
658
|
-
const refetched = await eda.sch_PrimitiveRectangle.get(primitiveId);
|
|
659
|
-
|
|
660
|
-
// 4. 清理测试图元(查询类案例不留测试对象)
|
|
661
|
-
await eda.sch_PrimitiveRectangle.delete([primitiveId]);
|
|
662
|
-
|
|
663
|
-
console.log('primitiveId:', primitiveId);
|
|
664
|
-
console.log('refetched width:', refetched.getState_Width());
|
|
665
|
-
```
|
|
666
|
-
|
|
667
|
-
### getstate_primitivetype
|
|
668
|
-
|
|
669
|
-
# ISCH\_PrimitiveRectangle.getState\_PrimitiveType() method
|
|
670
|
-
|
|
671
|
-
Get the property state: primitive type
|
|
672
|
-
|
|
673
|
-
## Signature
|
|
674
|
-
|
|
675
|
-
```typescript
|
|
676
|
-
function getState_PrimitiveType(): ESCH_PrimitiveType;
|
|
677
|
-
```
|
|
678
|
-
|
|
679
|
-
## Returns
|
|
680
|
-
|
|
681
|
-
[ESCH\_PrimitiveType](../enums/ESCH_PrimitiveType.md)
|
|
682
|
-
|
|
683
|
-
Primitive type
|
|
684
|
-
|
|
685
|
-
## Example
|
|
686
|
-
|
|
687
|
-
```javascript
|
|
688
|
-
// 1. 创建一个测试矩形(SCH 坐标单位 10mil)
|
|
689
|
-
const rect = await eda.sch_PrimitiveRectangle.create(400, 300, 200, 100);
|
|
690
|
-
|
|
691
|
-
// 2. 读取图元类型
|
|
692
|
-
const primitiveType = rect.getState_PrimitiveType();
|
|
693
|
-
|
|
694
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
695
|
-
await eda.sch_PrimitiveRectangle.delete([rect.getState_PrimitiveId()]);
|
|
696
|
-
|
|
697
|
-
console.log('primitiveType:', primitiveType);
|
|
698
|
-
```
|
|
699
|
-
|
|
700
|
-
### getstate_rotation
|
|
701
|
-
|
|
702
|
-
# ISCH\_PrimitiveRectangle.getState\_Rotation() method
|
|
703
|
-
|
|
704
|
-
Get the property state: rotation angle
|
|
705
|
-
|
|
706
|
-
## Signature
|
|
707
|
-
|
|
708
|
-
```typescript
|
|
709
|
-
function getState_Rotation(): number;
|
|
710
|
-
```
|
|
711
|
-
|
|
712
|
-
## Returns
|
|
713
|
-
|
|
714
|
-
number
|
|
715
|
-
|
|
716
|
-
Rotation angle
|
|
717
|
-
|
|
718
|
-
## Example
|
|
719
|
-
|
|
720
|
-
```javascript
|
|
721
|
-
// 1. 创建一个旋转 45° 的测试矩形(第 6 参是旋转角,SCH 坐标单位 10mil)
|
|
722
|
-
const rect = await eda.sch_PrimitiveRectangle.create(400, 300, 200, 100, 0, 45);
|
|
723
|
-
|
|
724
|
-
// 2. 读取旋转角度
|
|
725
|
-
const rotation = rect.getState_Rotation();
|
|
726
|
-
|
|
727
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
728
|
-
await eda.sch_PrimitiveRectangle.delete([rect.getState_PrimitiveId()]);
|
|
729
|
-
|
|
730
|
-
console.log('rotation:', rotation);
|
|
731
|
-
```
|
|
732
|
-
|
|
733
|
-
### getstate_topleftx
|
|
734
|
-
|
|
735
|
-
# ISCH\_PrimitiveRectangle.getState\_TopLeftX() method
|
|
736
|
-
|
|
737
|
-
Get the property state: top-left point X
|
|
738
|
-
|
|
739
|
-
## Signature
|
|
740
|
-
|
|
741
|
-
```typescript
|
|
742
|
-
function getState_TopLeftX(): number;
|
|
743
|
-
```
|
|
744
|
-
|
|
745
|
-
## Returns
|
|
746
|
-
|
|
747
|
-
number
|
|
748
|
-
|
|
749
|
-
Top-left point X
|
|
750
|
-
|
|
751
|
-
## Example
|
|
752
|
-
|
|
753
|
-
```javascript
|
|
754
|
-
// 1. 创建一个左上角在 (400, 300) 的测试矩形(SCH 坐标单位 10mil)
|
|
755
|
-
const rect = await eda.sch_PrimitiveRectangle.create(400, 300, 200, 100);
|
|
756
|
-
|
|
757
|
-
// 2. 读取左上角 X 坐标
|
|
758
|
-
const topLeftX = rect.getState_TopLeftX();
|
|
759
|
-
|
|
760
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
761
|
-
await eda.sch_PrimitiveRectangle.delete([rect.getState_PrimitiveId()]);
|
|
762
|
-
|
|
763
|
-
console.log('topLeftX:', topLeftX);
|
|
764
|
-
```
|
|
765
|
-
|
|
766
|
-
### getstate_toplefty
|
|
767
|
-
|
|
768
|
-
# ISCH\_PrimitiveRectangle.getState\_TopLeftY() method
|
|
769
|
-
|
|
770
|
-
Get the property state: top-left point Y
|
|
771
|
-
|
|
772
|
-
## Signature
|
|
773
|
-
|
|
774
|
-
```typescript
|
|
775
|
-
function getState_TopLeftY(): number;
|
|
776
|
-
```
|
|
777
|
-
|
|
778
|
-
## Returns
|
|
779
|
-
|
|
780
|
-
number
|
|
781
|
-
|
|
782
|
-
Top-left point Y
|
|
783
|
-
|
|
784
|
-
## Example
|
|
785
|
-
|
|
786
|
-
```javascript
|
|
787
|
-
// 1. 创建一个左上角在 (400, 300) 的测试矩形(SCH 坐标单位 10mil)
|
|
788
|
-
const rect = await eda.sch_PrimitiveRectangle.create(400, 300, 200, 100);
|
|
789
|
-
|
|
790
|
-
// 2. 读取左上角 Y 坐标
|
|
791
|
-
const topLeftY = rect.getState_TopLeftY();
|
|
792
|
-
|
|
793
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
794
|
-
await eda.sch_PrimitiveRectangle.delete([rect.getState_PrimitiveId()]);
|
|
795
|
-
|
|
796
|
-
console.log('topLeftY:', topLeftY);
|
|
797
|
-
```
|
|
798
|
-
|
|
799
|
-
### getstate_width
|
|
800
|
-
|
|
801
|
-
# ISCH\_PrimitiveRectangle.getState\_Width() method
|
|
802
|
-
|
|
803
|
-
Get the property state: width
|
|
804
|
-
|
|
805
|
-
## Signature
|
|
806
|
-
|
|
807
|
-
```typescript
|
|
808
|
-
function getState_Width(): number;
|
|
809
|
-
```
|
|
810
|
-
|
|
811
|
-
## Returns
|
|
812
|
-
|
|
813
|
-
number
|
|
814
|
-
|
|
815
|
-
Width
|
|
816
|
-
|
|
817
|
-
## Example
|
|
818
|
-
|
|
819
|
-
```javascript
|
|
820
|
-
// 1. 创建一个 200×100 的测试矩形(SCH 坐标单位 10mil)
|
|
821
|
-
const rect = await eda.sch_PrimitiveRectangle.create(400, 300, 200, 100);
|
|
822
|
-
|
|
823
|
-
// 2. 读取矩形的宽
|
|
824
|
-
const width = rect.getState_Width();
|
|
825
|
-
|
|
826
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
827
|
-
await eda.sch_PrimitiveRectangle.delete([rect.getState_PrimitiveId()]);
|
|
828
|
-
|
|
829
|
-
console.log('width:', width);
|
|
830
|
-
```
|
|
831
|
-
|
|
832
|
-
### isasync
|
|
833
|
-
|
|
834
|
-
# ISCH\_PrimitiveRectangle.isAsync() method
|
|
835
|
-
|
|
836
|
-
Query whether the primitive is an async primitive
|
|
837
|
-
|
|
838
|
-
## Signature
|
|
839
|
-
|
|
840
|
-
```typescript
|
|
841
|
-
function isAsync(): boolean;
|
|
842
|
-
```
|
|
843
|
-
|
|
844
|
-
## Returns
|
|
845
|
-
|
|
846
|
-
boolean
|
|
847
|
-
|
|
848
|
-
Whether Is async primitive
|
|
849
|
-
|
|
850
|
-
## Example
|
|
851
|
-
|
|
852
|
-
```javascript
|
|
853
|
-
// 1. 创建一个测试矩形,创建后默认处于异步模式
|
|
854
|
-
const rect = await eda.sch_PrimitiveRectangle.create(400, 300, 200, 100);
|
|
855
|
-
const asyncOnCreate = rect.isAsync();
|
|
856
|
-
|
|
857
|
-
// 2. 切换到同步模式再查询一次,对比两种模式
|
|
858
|
-
rect.toSync();
|
|
859
|
-
const asyncAfterToSync = rect.isAsync();
|
|
860
|
-
|
|
861
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
862
|
-
await eda.sch_PrimitiveRectangle.delete([rect.getState_PrimitiveId()]);
|
|
863
|
-
|
|
864
|
-
console.log('isAsync on create:', asyncOnCreate);
|
|
865
|
-
console.log('isAsync after toSync:', asyncAfterToSync);
|
|
866
|
-
```
|
|
867
|
-
|
|
868
|
-
### reset
|
|
869
|
-
|
|
870
|
-
# ISCH\_PrimitiveRectangle.reset() method
|
|
871
|
-
|
|
872
|
-
> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
|
873
|
-
|
|
874
|
-
Reset the async primitive to the current canvas state
|
|
875
|
-
|
|
876
|
-
## Signature
|
|
877
|
-
|
|
878
|
-
```typescript
|
|
879
|
-
function reset(): Promise<ISCH_PrimitiveRectangle>;
|
|
880
|
-
```
|
|
881
|
-
|
|
882
|
-
## Returns
|
|
883
|
-
|
|
884
|
-
Promise<[ISCH\_PrimitiveRectangle](./ISCH_PrimitiveRectangle.md)<!-- -->>
|
|
885
|
-
|
|
886
|
-
Rectangle primitive object
|
|
887
|
-
|
|
888
|
-
## Example
|
|
889
|
-
|
|
890
|
-
```javascript
|
|
891
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试矩形重合
|
|
892
|
-
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
893
|
-
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
894
|
-
|
|
895
|
-
// 2. 创建一个线宽 6 的测试矩形(SCH 坐标单位 10mil)
|
|
896
|
-
const rect = await eda.sch_PrimitiveRectangle.create(x, y, 200, 100, 0, 0, '#FF0000', null, 6);
|
|
897
|
-
|
|
898
|
-
// 3. 切换异步模式,累计一处未提交的线宽修改(6 → 99)
|
|
899
|
-
const asyncRect = rect.toAsync();
|
|
900
|
-
asyncRect.setState_LineWidth(99);
|
|
901
|
-
|
|
902
|
-
// 4. 重置:丢弃未提交的修改,回到画布当前状态
|
|
903
|
-
await asyncRect.reset();
|
|
904
|
-
|
|
905
|
-
// 5. 从画布重新读取,线宽仍是 6(保留现场供观察)
|
|
906
|
-
const refetched = await eda.sch_PrimitiveRectangle.get(rect.getState_PrimitiveId());
|
|
907
|
-
|
|
908
|
-
console.log('lineWidth after reset:', refetched.getState_LineWidth());
|
|
909
|
-
```
|
|
910
|
-
|
|
911
|
-
### setstate_color
|
|
912
|
-
|
|
913
|
-
# ISCH\_PrimitiveRectangle.setState\_Color() method
|
|
914
|
-
|
|
915
|
-
> 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.
|
|
916
|
-
|
|
917
|
-
Set the property state: border color
|
|
918
|
-
|
|
919
|
-
## Signature
|
|
920
|
-
|
|
921
|
-
```typescript
|
|
922
|
-
function setState_Color(color: string | null): ISCH_PrimitiveRectangle;
|
|
923
|
-
```
|
|
924
|
-
|
|
925
|
-
## Parameters
|
|
926
|
-
|
|
927
|
-
<table><thead><tr><th>
|
|
928
|
-
|
|
929
|
-
Parameter
|
|
930
|
-
|
|
931
|
-
</th><th>
|
|
932
|
-
|
|
933
|
-
Type
|
|
934
|
-
|
|
935
|
-
</th><th>
|
|
936
|
-
|
|
937
|
-
Description
|
|
938
|
-
|
|
939
|
-
</th></tr></thead>
|
|
940
|
-
<tbody><tr><td>
|
|
941
|
-
|
|
942
|
-
color
|
|
943
|
-
|
|
944
|
-
</td><td>
|
|
945
|
-
|
|
946
|
-
string \| null
|
|
947
|
-
|
|
948
|
-
</td><td>
|
|
949
|
-
|
|
950
|
-
Border color
|
|
951
|
-
|
|
952
|
-
</td></tr>
|
|
953
|
-
</tbody></table>
|
|
954
|
-
|
|
955
|
-
## Returns
|
|
956
|
-
|
|
957
|
-
[ISCH\_PrimitiveRectangle](./ISCH_PrimitiveRectangle.md)
|
|
958
|
-
|
|
959
|
-
Rectangle primitive object
|
|
960
|
-
|
|
961
|
-
## Example
|
|
962
|
-
|
|
963
|
-
```javascript
|
|
964
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试矩形重合
|
|
965
|
-
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
966
|
-
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
967
|
-
|
|
968
|
-
// 2. 创建一个红色边框的测试矩形(SCH 坐标单位 10mil)
|
|
969
|
-
const rect = await eda.sch_PrimitiveRectangle.create(x, y, 200, 100, 0, 0, '#FF0000');
|
|
970
|
-
|
|
971
|
-
// 3. 切换异步模式,把边框换成绿色
|
|
972
|
-
const asyncRect = rect.toAsync();
|
|
973
|
-
asyncRect.setState_Color('#00AA00');
|
|
974
|
-
await asyncRect.done();
|
|
975
|
-
|
|
976
|
-
// 4. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
977
|
-
const refetched = await eda.sch_PrimitiveRectangle.get(rect.getState_PrimitiveId());
|
|
978
|
-
|
|
979
|
-
console.log('color:', '#FF0000', '→', refetched.getState_Color());
|
|
980
|
-
```
|
|
981
|
-
|
|
982
|
-
### setstate_cornerradius
|
|
983
|
-
|
|
984
|
-
# ISCH\_PrimitiveRectangle.setState\_CornerRadius() method
|
|
985
|
-
|
|
986
|
-
> 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.
|
|
987
|
-
|
|
988
|
-
Set the property state: corner radius
|
|
989
|
-
|
|
990
|
-
## Signature
|
|
991
|
-
|
|
992
|
-
```typescript
|
|
993
|
-
function setState_CornerRadius(cornerRadius: number): ISCH_PrimitiveRectangle;
|
|
994
|
-
```
|
|
995
|
-
|
|
996
|
-
## Parameters
|
|
997
|
-
|
|
998
|
-
<table><thead><tr><th>
|
|
999
|
-
|
|
1000
|
-
Parameter
|
|
1001
|
-
|
|
1002
|
-
</th><th>
|
|
1003
|
-
|
|
1004
|
-
Type
|
|
1005
|
-
|
|
1006
|
-
</th><th>
|
|
1007
|
-
|
|
1008
|
-
Description
|
|
1009
|
-
|
|
1010
|
-
</th></tr></thead>
|
|
1011
|
-
<tbody><tr><td>
|
|
1012
|
-
|
|
1013
|
-
cornerRadius
|
|
1014
|
-
|
|
1015
|
-
</td><td>
|
|
1016
|
-
|
|
1017
|
-
number
|
|
1018
|
-
|
|
1019
|
-
</td><td>
|
|
1020
|
-
|
|
1021
|
-
Corner radius
|
|
1022
|
-
|
|
1023
|
-
</td></tr>
|
|
1024
|
-
</tbody></table>
|
|
1025
|
-
|
|
1026
|
-
## Returns
|
|
1027
|
-
|
|
1028
|
-
[ISCH\_PrimitiveRectangle](./ISCH_PrimitiveRectangle.md)
|
|
1029
|
-
|
|
1030
|
-
Rectangle primitive object
|
|
1031
|
-
|
|
1032
|
-
## Example
|
|
1033
|
-
|
|
1034
|
-
```javascript
|
|
1035
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试矩形重合
|
|
1036
|
-
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
1037
|
-
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
1038
|
-
|
|
1039
|
-
// 2. 创建一个直角测试矩形(SCH 坐标单位 10mil)
|
|
1040
|
-
const rect = await eda.sch_PrimitiveRectangle.create(x, y, 200, 100);
|
|
1041
|
-
|
|
1042
|
-
// 3. 切换异步模式,把圆角半径调到 20
|
|
1043
|
-
const asyncRect = rect.toAsync();
|
|
1044
|
-
asyncRect.setState_CornerRadius(20);
|
|
1045
|
-
await asyncRect.done();
|
|
1046
|
-
|
|
1047
|
-
// 4. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1048
|
-
const refetched = await eda.sch_PrimitiveRectangle.get(rect.getState_PrimitiveId());
|
|
1049
|
-
|
|
1050
|
-
console.log('cornerRadius:', 0, '→', refetched.getState_CornerRadius());
|
|
1051
|
-
```
|
|
1052
|
-
|
|
1053
|
-
### setstate_fillcolor
|
|
1054
|
-
|
|
1055
|
-
# ISCH\_PrimitiveRectangle.setState\_FillColor() method
|
|
1056
|
-
|
|
1057
|
-
> 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.
|
|
1058
|
-
|
|
1059
|
-
Set the property state: fill color
|
|
1060
|
-
|
|
1061
|
-
## Signature
|
|
1062
|
-
|
|
1063
|
-
```typescript
|
|
1064
|
-
function setState_FillColor(fillColor: string | null): ISCH_PrimitiveRectangle;
|
|
1065
|
-
```
|
|
1066
|
-
|
|
1067
|
-
## Parameters
|
|
1068
|
-
|
|
1069
|
-
<table><thead><tr><th>
|
|
1070
|
-
|
|
1071
|
-
Parameter
|
|
1072
|
-
|
|
1073
|
-
</th><th>
|
|
1074
|
-
|
|
1075
|
-
Type
|
|
1076
|
-
|
|
1077
|
-
</th><th>
|
|
1078
|
-
|
|
1079
|
-
Description
|
|
1080
|
-
|
|
1081
|
-
</th></tr></thead>
|
|
1082
|
-
<tbody><tr><td>
|
|
1083
|
-
|
|
1084
|
-
fillColor
|
|
1085
|
-
|
|
1086
|
-
</td><td>
|
|
1087
|
-
|
|
1088
|
-
string \| null
|
|
1089
|
-
|
|
1090
|
-
</td><td>
|
|
1091
|
-
|
|
1092
|
-
Fill color
|
|
1093
|
-
|
|
1094
|
-
</td></tr>
|
|
1095
|
-
</tbody></table>
|
|
1096
|
-
|
|
1097
|
-
## Returns
|
|
1098
|
-
|
|
1099
|
-
[ISCH\_PrimitiveRectangle](./ISCH_PrimitiveRectangle.md)
|
|
1100
|
-
|
|
1101
|
-
Rectangle primitive object
|
|
1102
|
-
|
|
1103
|
-
## Example
|
|
1104
|
-
|
|
1105
|
-
```javascript
|
|
1106
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试矩形重合
|
|
1107
|
-
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
1108
|
-
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
1109
|
-
|
|
1110
|
-
// 2. 创建一个无填充的测试矩形(SCH 坐标单位 10mil)
|
|
1111
|
-
const rect = await eda.sch_PrimitiveRectangle.create(x, y, 200, 100);
|
|
1112
|
-
|
|
1113
|
-
// 3. 切换异步模式,设置浅黄填充
|
|
1114
|
-
const asyncRect = rect.toAsync();
|
|
1115
|
-
asyncRect.setState_FillColor('#FFEC8B');
|
|
1116
|
-
await asyncRect.done();
|
|
1117
|
-
|
|
1118
|
-
// 4. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1119
|
-
const refetched = await eda.sch_PrimitiveRectangle.get(rect.getState_PrimitiveId());
|
|
1120
|
-
|
|
1121
|
-
console.log('fillColor:', null, '→', refetched.getState_FillColor());
|
|
1122
|
-
```
|
|
1123
|
-
|
|
1124
|
-
### setstate_fillstyle
|
|
1125
|
-
|
|
1126
|
-
# ISCH\_PrimitiveRectangle.setState\_FillStyle() method
|
|
1127
|
-
|
|
1128
|
-
> 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.
|
|
1129
|
-
|
|
1130
|
-
Set the property state: fill style
|
|
1131
|
-
|
|
1132
|
-
## Signature
|
|
1133
|
-
|
|
1134
|
-
```typescript
|
|
1135
|
-
function setState_FillStyle(fillStyle: ESCH_PrimitiveFillStyle | null): ISCH_PrimitiveRectangle;
|
|
1136
|
-
```
|
|
1137
|
-
|
|
1138
|
-
## Parameters
|
|
1139
|
-
|
|
1140
|
-
<table><thead><tr><th>
|
|
1141
|
-
|
|
1142
|
-
Parameter
|
|
1143
|
-
|
|
1144
|
-
</th><th>
|
|
1145
|
-
|
|
1146
|
-
Type
|
|
1147
|
-
|
|
1148
|
-
</th><th>
|
|
1149
|
-
|
|
1150
|
-
Description
|
|
1151
|
-
|
|
1152
|
-
</th></tr></thead>
|
|
1153
|
-
<tbody><tr><td>
|
|
1154
|
-
|
|
1155
|
-
fillStyle
|
|
1156
|
-
|
|
1157
|
-
</td><td>
|
|
1158
|
-
|
|
1159
|
-
[ESCH\_PrimitiveFillStyle](../enums/ESCH_PrimitiveFillStyle.md) \| null
|
|
1160
|
-
|
|
1161
|
-
</td><td>
|
|
1162
|
-
|
|
1163
|
-
Fill style
|
|
1164
|
-
|
|
1165
|
-
</td></tr>
|
|
1166
|
-
</tbody></table>
|
|
1167
|
-
|
|
1168
|
-
## Returns
|
|
1169
|
-
|
|
1170
|
-
[ISCH\_PrimitiveRectangle](./ISCH_PrimitiveRectangle.md)
|
|
1171
|
-
|
|
1172
|
-
Rectangle primitive object
|
|
1173
|
-
|
|
1174
|
-
## Example
|
|
1175
|
-
|
|
1176
|
-
```javascript
|
|
1177
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试矩形重合
|
|
1178
|
-
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
1179
|
-
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
1180
|
-
|
|
1181
|
-
// 2. 创建一个无填充的测试矩形(SCH 坐标单位 10mil)
|
|
1182
|
-
const rect = await eda.sch_PrimitiveRectangle.create(x, y, 200, 100);
|
|
1183
|
-
|
|
1184
|
-
// 3. 切换异步模式,设置网格填充样式
|
|
1185
|
-
const asyncRect = rect.toAsync();
|
|
1186
|
-
asyncRect.setState_FillStyle('Grid');
|
|
1187
|
-
await asyncRect.done();
|
|
1188
|
-
|
|
1189
|
-
// 4. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1190
|
-
const refetched = await eda.sch_PrimitiveRectangle.get(rect.getState_PrimitiveId());
|
|
1191
|
-
|
|
1192
|
-
console.log('fillStyle:', null, '→', refetched.getState_FillStyle());
|
|
1193
|
-
```
|
|
1194
|
-
|
|
1195
|
-
### setstate_height
|
|
1196
|
-
|
|
1197
|
-
# ISCH\_PrimitiveRectangle.setState\_Height() method
|
|
1198
|
-
|
|
1199
|
-
> 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.
|
|
1200
|
-
|
|
1201
|
-
Set the property state: height
|
|
1202
|
-
|
|
1203
|
-
## Signature
|
|
1204
|
-
|
|
1205
|
-
```typescript
|
|
1206
|
-
function setState_Height(height: number): ISCH_PrimitiveRectangle;
|
|
1207
|
-
```
|
|
1208
|
-
|
|
1209
|
-
## Parameters
|
|
1210
|
-
|
|
1211
|
-
<table><thead><tr><th>
|
|
1212
|
-
|
|
1213
|
-
Parameter
|
|
1214
|
-
|
|
1215
|
-
</th><th>
|
|
1216
|
-
|
|
1217
|
-
Type
|
|
1218
|
-
|
|
1219
|
-
</th><th>
|
|
1220
|
-
|
|
1221
|
-
Description
|
|
1222
|
-
|
|
1223
|
-
</th></tr></thead>
|
|
1224
|
-
<tbody><tr><td>
|
|
1225
|
-
|
|
1226
|
-
height
|
|
1227
|
-
|
|
1228
|
-
</td><td>
|
|
1229
|
-
|
|
1230
|
-
number
|
|
1231
|
-
|
|
1232
|
-
</td><td>
|
|
1233
|
-
|
|
1234
|
-
Height
|
|
1235
|
-
|
|
1236
|
-
</td></tr>
|
|
1237
|
-
</tbody></table>
|
|
1238
|
-
|
|
1239
|
-
## Returns
|
|
1240
|
-
|
|
1241
|
-
[ISCH\_PrimitiveRectangle](./ISCH_PrimitiveRectangle.md)
|
|
1242
|
-
|
|
1243
|
-
Rectangle primitive object
|
|
1244
|
-
|
|
1245
|
-
## Example
|
|
1246
|
-
|
|
1247
|
-
```javascript
|
|
1248
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试矩形重合
|
|
1249
|
-
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
1250
|
-
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
1251
|
-
|
|
1252
|
-
// 2. 创建一个 200×100 的测试矩形(SCH 坐标单位 10mil)
|
|
1253
|
-
const rect = await eda.sch_PrimitiveRectangle.create(x, y, 200, 100);
|
|
1254
|
-
|
|
1255
|
-
// 3. 切换异步模式,把高扩大到 150
|
|
1256
|
-
const asyncRect = rect.toAsync();
|
|
1257
|
-
asyncRect.setState_Height(150);
|
|
1258
|
-
await asyncRect.done();
|
|
1259
|
-
|
|
1260
|
-
// 4. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1261
|
-
const refetched = await eda.sch_PrimitiveRectangle.get(rect.getState_PrimitiveId());
|
|
1262
|
-
|
|
1263
|
-
console.log('height:', 100, '→', refetched.getState_Height());
|
|
1264
|
-
```
|
|
1265
|
-
|
|
1266
|
-
### setstate_linetype
|
|
1267
|
-
|
|
1268
|
-
# ISCH\_PrimitiveRectangle.setState\_LineType() method
|
|
1269
|
-
|
|
1270
|
-
> 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.
|
|
1271
|
-
|
|
1272
|
-
Set the property state: line type
|
|
1273
|
-
|
|
1274
|
-
## Signature
|
|
1275
|
-
|
|
1276
|
-
```typescript
|
|
1277
|
-
function setState_LineType(lineType: ESCH_PrimitiveLineType | null): ISCH_PrimitiveRectangle;
|
|
1278
|
-
```
|
|
1279
|
-
|
|
1280
|
-
## Parameters
|
|
1281
|
-
|
|
1282
|
-
<table><thead><tr><th>
|
|
1283
|
-
|
|
1284
|
-
Parameter
|
|
1285
|
-
|
|
1286
|
-
</th><th>
|
|
1287
|
-
|
|
1288
|
-
Type
|
|
1289
|
-
|
|
1290
|
-
</th><th>
|
|
1291
|
-
|
|
1292
|
-
Description
|
|
1293
|
-
|
|
1294
|
-
</th></tr></thead>
|
|
1295
|
-
<tbody><tr><td>
|
|
1296
|
-
|
|
1297
|
-
lineType
|
|
1298
|
-
|
|
1299
|
-
</td><td>
|
|
1300
|
-
|
|
1301
|
-
[ESCH\_PrimitiveLineType](../enums/ESCH_PrimitiveLineType.md) \| null
|
|
1302
|
-
|
|
1303
|
-
</td><td>
|
|
1304
|
-
|
|
1305
|
-
Line type
|
|
1306
|
-
|
|
1307
|
-
</td></tr>
|
|
1308
|
-
</tbody></table>
|
|
1309
|
-
|
|
1310
|
-
## Returns
|
|
1311
|
-
|
|
1312
|
-
[ISCH\_PrimitiveRectangle](./ISCH_PrimitiveRectangle.md)
|
|
1313
|
-
|
|
1314
|
-
Rectangle primitive object
|
|
1315
|
-
|
|
1316
|
-
## Example
|
|
1317
|
-
|
|
1318
|
-
```javascript
|
|
1319
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试矩形重合
|
|
1320
|
-
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
1321
|
-
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
1322
|
-
|
|
1323
|
-
// 2. 创建一个实线边框的测试矩形(末参 0 = 实线,SCH 坐标单位 10mil)
|
|
1324
|
-
const rect = await eda.sch_PrimitiveRectangle.create(x, y, 200, 100, 0, 0, '#FF0000', null, 6, 0);
|
|
1325
|
-
|
|
1326
|
-
// 3. 切换异步模式,把线型改为虚线(1)
|
|
1327
|
-
const asyncRect = rect.toAsync();
|
|
1328
|
-
asyncRect.setState_LineType(1);
|
|
1329
|
-
await asyncRect.done();
|
|
1330
|
-
|
|
1331
|
-
// 4. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1332
|
-
const refetched = await eda.sch_PrimitiveRectangle.get(rect.getState_PrimitiveId());
|
|
1333
|
-
|
|
1334
|
-
console.log('lineType:', 0, '→', refetched.getState_LineType());
|
|
1335
|
-
```
|
|
1336
|
-
|
|
1337
|
-
### setstate_linewidth
|
|
1338
|
-
|
|
1339
|
-
# ISCH\_PrimitiveRectangle.setState\_LineWidth() method
|
|
1340
|
-
|
|
1341
|
-
> 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.
|
|
1342
|
-
|
|
1343
|
-
Set the property state: Line width
|
|
1344
|
-
|
|
1345
|
-
## Signature
|
|
1346
|
-
|
|
1347
|
-
```typescript
|
|
1348
|
-
function setState_LineWidth(lineWidth: number | null): ISCH_PrimitiveRectangle;
|
|
1349
|
-
```
|
|
1350
|
-
|
|
1351
|
-
## Parameters
|
|
1352
|
-
|
|
1353
|
-
<table><thead><tr><th>
|
|
1354
|
-
|
|
1355
|
-
Parameter
|
|
1356
|
-
|
|
1357
|
-
</th><th>
|
|
1358
|
-
|
|
1359
|
-
Type
|
|
1360
|
-
|
|
1361
|
-
</th><th>
|
|
1362
|
-
|
|
1363
|
-
Description
|
|
1364
|
-
|
|
1365
|
-
</th></tr></thead>
|
|
1366
|
-
<tbody><tr><td>
|
|
1367
|
-
|
|
1368
|
-
lineWidth
|
|
1369
|
-
|
|
1370
|
-
</td><td>
|
|
1371
|
-
|
|
1372
|
-
number \| null
|
|
1373
|
-
|
|
1374
|
-
</td><td>
|
|
1375
|
-
|
|
1376
|
-
Line width
|
|
1377
|
-
|
|
1378
|
-
</td></tr>
|
|
1379
|
-
</tbody></table>
|
|
1380
|
-
|
|
1381
|
-
## Returns
|
|
1382
|
-
|
|
1383
|
-
[ISCH\_PrimitiveRectangle](./ISCH_PrimitiveRectangle.md)
|
|
1384
|
-
|
|
1385
|
-
Rectangle primitive object
|
|
1386
|
-
|
|
1387
|
-
## Example
|
|
1388
|
-
|
|
1389
|
-
```javascript
|
|
1390
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试矩形重合
|
|
1391
|
-
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
1392
|
-
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
1393
|
-
|
|
1394
|
-
// 2. 创建一个线宽 6 的测试矩形(SCH 坐标单位 10mil)
|
|
1395
|
-
const rect = await eda.sch_PrimitiveRectangle.create(x, y, 200, 100, 0, 0, '#FF0000', null, 6);
|
|
1396
|
-
|
|
1397
|
-
// 3. 切换异步模式,把线宽加粗到 15
|
|
1398
|
-
const asyncRect = rect.toAsync();
|
|
1399
|
-
asyncRect.setState_LineWidth(15);
|
|
1400
|
-
await asyncRect.done();
|
|
1401
|
-
|
|
1402
|
-
// 4. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1403
|
-
const refetched = await eda.sch_PrimitiveRectangle.get(rect.getState_PrimitiveId());
|
|
1404
|
-
|
|
1405
|
-
console.log('lineWidth:', 6, '→', refetched.getState_LineWidth());
|
|
1406
|
-
```
|
|
1407
|
-
|
|
1408
|
-
### setstate_rotation
|
|
1409
|
-
|
|
1410
|
-
# ISCH\_PrimitiveRectangle.setState\_Rotation() method
|
|
1411
|
-
|
|
1412
|
-
> 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.
|
|
1413
|
-
|
|
1414
|
-
Set the property state: rotation angle
|
|
1415
|
-
|
|
1416
|
-
## Signature
|
|
1417
|
-
|
|
1418
|
-
```typescript
|
|
1419
|
-
function setState_Rotation(rotation: number): ISCH_PrimitiveRectangle;
|
|
1420
|
-
```
|
|
1421
|
-
|
|
1422
|
-
## Parameters
|
|
1423
|
-
|
|
1424
|
-
<table><thead><tr><th>
|
|
1425
|
-
|
|
1426
|
-
Parameter
|
|
1427
|
-
|
|
1428
|
-
</th><th>
|
|
1429
|
-
|
|
1430
|
-
Type
|
|
1431
|
-
|
|
1432
|
-
</th><th>
|
|
1433
|
-
|
|
1434
|
-
Description
|
|
1435
|
-
|
|
1436
|
-
</th></tr></thead>
|
|
1437
|
-
<tbody><tr><td>
|
|
1438
|
-
|
|
1439
|
-
rotation
|
|
1440
|
-
|
|
1441
|
-
</td><td>
|
|
1442
|
-
|
|
1443
|
-
number
|
|
1444
|
-
|
|
1445
|
-
</td><td>
|
|
1446
|
-
|
|
1447
|
-
Rotation angle
|
|
1448
|
-
|
|
1449
|
-
</td></tr>
|
|
1450
|
-
</tbody></table>
|
|
1451
|
-
|
|
1452
|
-
## Returns
|
|
1453
|
-
|
|
1454
|
-
[ISCH\_PrimitiveRectangle](./ISCH_PrimitiveRectangle.md)
|
|
1455
|
-
|
|
1456
|
-
Rectangle primitive object
|
|
1457
|
-
|
|
1458
|
-
## Example
|
|
1459
|
-
|
|
1460
|
-
```javascript
|
|
1461
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试矩形重合
|
|
1462
|
-
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
1463
|
-
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
1464
|
-
|
|
1465
|
-
// 2. 创建一个未旋转的测试矩形(SCH 坐标单位 10mil)
|
|
1466
|
-
const rect = await eda.sch_PrimitiveRectangle.create(x, y, 200, 100);
|
|
1467
|
-
|
|
1468
|
-
// 3. 切换异步模式,提交旋转 30°
|
|
1469
|
-
const asyncRect = rect.toAsync();
|
|
1470
|
-
asyncRect.setState_Rotation(30);
|
|
1471
|
-
await asyncRect.done();
|
|
1472
|
-
|
|
1473
|
-
// 4. 从画布重新读取:形状已旋转(左上角坐标变化),角度读数仍为 0
|
|
1474
|
-
const refetched = await eda.sch_PrimitiveRectangle.get(rect.getState_PrimitiveId());
|
|
1475
|
-
|
|
1476
|
-
console.log('rotation:', 0, '→', refetched.getState_Rotation());
|
|
1477
|
-
console.log('topLeft moved by rotate:', x, '→', refetched.getState_TopLeftX());
|
|
1478
|
-
```
|
|
1479
|
-
|
|
1480
|
-
### setstate_topleftx
|
|
1481
|
-
|
|
1482
|
-
# ISCH\_PrimitiveRectangle.setState\_TopLeftX() method
|
|
1483
|
-
|
|
1484
|
-
> 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.
|
|
1485
|
-
|
|
1486
|
-
Set the property state: top-left point X
|
|
1487
|
-
|
|
1488
|
-
## Signature
|
|
1489
|
-
|
|
1490
|
-
```typescript
|
|
1491
|
-
function setState_TopLeftX(topLeftX: number): ISCH_PrimitiveRectangle;
|
|
1492
|
-
```
|
|
1493
|
-
|
|
1494
|
-
## Parameters
|
|
1495
|
-
|
|
1496
|
-
<table><thead><tr><th>
|
|
1497
|
-
|
|
1498
|
-
Parameter
|
|
1499
|
-
|
|
1500
|
-
</th><th>
|
|
1501
|
-
|
|
1502
|
-
Type
|
|
1503
|
-
|
|
1504
|
-
</th><th>
|
|
1505
|
-
|
|
1506
|
-
Description
|
|
1507
|
-
|
|
1508
|
-
</th></tr></thead>
|
|
1509
|
-
<tbody><tr><td>
|
|
1510
|
-
|
|
1511
|
-
topLeftX
|
|
1512
|
-
|
|
1513
|
-
</td><td>
|
|
1514
|
-
|
|
1515
|
-
number
|
|
1516
|
-
|
|
1517
|
-
</td><td>
|
|
1518
|
-
|
|
1519
|
-
Top-left point X
|
|
1520
|
-
|
|
1521
|
-
</td></tr>
|
|
1522
|
-
</tbody></table>
|
|
1523
|
-
|
|
1524
|
-
## Returns
|
|
1525
|
-
|
|
1526
|
-
[ISCH\_PrimitiveRectangle](./ISCH_PrimitiveRectangle.md)
|
|
1527
|
-
|
|
1528
|
-
Rectangle primitive object
|
|
1529
|
-
|
|
1530
|
-
## Example
|
|
1531
|
-
|
|
1532
|
-
```javascript
|
|
1533
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试矩形重合
|
|
1534
|
-
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
1535
|
-
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
1536
|
-
|
|
1537
|
-
// 2. 创建一个测试矩形(SCH 坐标单位 10mil)
|
|
1538
|
-
const rect = await eda.sch_PrimitiveRectangle.create(x, y, 200, 100);
|
|
1539
|
-
|
|
1540
|
-
// 3. 切换异步模式,把左上角 X 移到 x + 300
|
|
1541
|
-
const asyncRect = rect.toAsync();
|
|
1542
|
-
asyncRect.setState_TopLeftX(x + 300);
|
|
1543
|
-
await asyncRect.done();
|
|
1544
|
-
|
|
1545
|
-
// 4. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1546
|
-
const refetched = await eda.sch_PrimitiveRectangle.get(rect.getState_PrimitiveId());
|
|
1547
|
-
|
|
1548
|
-
console.log('topLeftX:', x, '→', refetched.getState_TopLeftX());
|
|
1549
|
-
```
|
|
1550
|
-
|
|
1551
|
-
### setstate_toplefty
|
|
1552
|
-
|
|
1553
|
-
# ISCH\_PrimitiveRectangle.setState\_TopLeftY() method
|
|
1554
|
-
|
|
1555
|
-
> 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.
|
|
1556
|
-
|
|
1557
|
-
Set the property state: top-left point Y
|
|
1558
|
-
|
|
1559
|
-
## Signature
|
|
1560
|
-
|
|
1561
|
-
```typescript
|
|
1562
|
-
function setState_TopLeftY(topLeftY: number): ISCH_PrimitiveRectangle;
|
|
1563
|
-
```
|
|
1564
|
-
|
|
1565
|
-
## Parameters
|
|
1566
|
-
|
|
1567
|
-
<table><thead><tr><th>
|
|
1568
|
-
|
|
1569
|
-
Parameter
|
|
1570
|
-
|
|
1571
|
-
</th><th>
|
|
1572
|
-
|
|
1573
|
-
Type
|
|
1574
|
-
|
|
1575
|
-
</th><th>
|
|
1576
|
-
|
|
1577
|
-
Description
|
|
1578
|
-
|
|
1579
|
-
</th></tr></thead>
|
|
1580
|
-
<tbody><tr><td>
|
|
1581
|
-
|
|
1582
|
-
topLeftY
|
|
1583
|
-
|
|
1584
|
-
</td><td>
|
|
1585
|
-
|
|
1586
|
-
number
|
|
1587
|
-
|
|
1588
|
-
</td><td>
|
|
1589
|
-
|
|
1590
|
-
Top-left point Y
|
|
1591
|
-
|
|
1592
|
-
</td></tr>
|
|
1593
|
-
</tbody></table>
|
|
1594
|
-
|
|
1595
|
-
## Returns
|
|
1596
|
-
|
|
1597
|
-
[ISCH\_PrimitiveRectangle](./ISCH_PrimitiveRectangle.md)
|
|
1598
|
-
|
|
1599
|
-
Rectangle primitive object
|
|
1600
|
-
|
|
1601
|
-
## Example
|
|
1602
|
-
|
|
1603
|
-
```javascript
|
|
1604
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试矩形重合
|
|
1605
|
-
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
1606
|
-
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
1607
|
-
|
|
1608
|
-
// 2. 创建一个测试矩形(SCH 坐标单位 10mil)
|
|
1609
|
-
const rect = await eda.sch_PrimitiveRectangle.create(x, y, 200, 100);
|
|
1610
|
-
|
|
1611
|
-
// 3. 切换异步模式,把左上角 Y 移到 y + 200
|
|
1612
|
-
const asyncRect = rect.toAsync();
|
|
1613
|
-
asyncRect.setState_TopLeftY(y + 200);
|
|
1614
|
-
await asyncRect.done();
|
|
1615
|
-
|
|
1616
|
-
// 4. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1617
|
-
const refetched = await eda.sch_PrimitiveRectangle.get(rect.getState_PrimitiveId());
|
|
1618
|
-
|
|
1619
|
-
console.log('topLeftY:', y, '→', refetched.getState_TopLeftY());
|
|
1620
|
-
```
|
|
1621
|
-
|
|
1622
|
-
### setstate_width
|
|
1623
|
-
|
|
1624
|
-
# ISCH\_PrimitiveRectangle.setState\_Width() method
|
|
1625
|
-
|
|
1626
|
-
> 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.
|
|
1627
|
-
|
|
1628
|
-
Set the property state: width
|
|
1629
|
-
|
|
1630
|
-
## Signature
|
|
1631
|
-
|
|
1632
|
-
```typescript
|
|
1633
|
-
function setState_Width(width: number): ISCH_PrimitiveRectangle;
|
|
1634
|
-
```
|
|
1635
|
-
|
|
1636
|
-
## Parameters
|
|
1637
|
-
|
|
1638
|
-
<table><thead><tr><th>
|
|
1639
|
-
|
|
1640
|
-
Parameter
|
|
1641
|
-
|
|
1642
|
-
</th><th>
|
|
1643
|
-
|
|
1644
|
-
Type
|
|
1645
|
-
|
|
1646
|
-
</th><th>
|
|
1647
|
-
|
|
1648
|
-
Description
|
|
1649
|
-
|
|
1650
|
-
</th></tr></thead>
|
|
1651
|
-
<tbody><tr><td>
|
|
1652
|
-
|
|
1653
|
-
width
|
|
1654
|
-
|
|
1655
|
-
</td><td>
|
|
1656
|
-
|
|
1657
|
-
number
|
|
1658
|
-
|
|
1659
|
-
</td><td>
|
|
1660
|
-
|
|
1661
|
-
Width
|
|
1662
|
-
|
|
1663
|
-
</td></tr>
|
|
1664
|
-
</tbody></table>
|
|
1665
|
-
|
|
1666
|
-
## Returns
|
|
1667
|
-
|
|
1668
|
-
[ISCH\_PrimitiveRectangle](./ISCH_PrimitiveRectangle.md)
|
|
1669
|
-
|
|
1670
|
-
Rectangle primitive object
|
|
1671
|
-
|
|
1672
|
-
## Example
|
|
1673
|
-
|
|
1674
|
-
```javascript
|
|
1675
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试矩形重合
|
|
1676
|
-
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
1677
|
-
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
1678
|
-
|
|
1679
|
-
// 2. 创建一个 200×100 的测试矩形(SCH 坐标单位 10mil)
|
|
1680
|
-
const rect = await eda.sch_PrimitiveRectangle.create(x, y, 200, 100);
|
|
1681
|
-
|
|
1682
|
-
// 3. 切换异步模式,把宽扩大到 300
|
|
1683
|
-
const asyncRect = rect.toAsync();
|
|
1684
|
-
asyncRect.setState_Width(300);
|
|
1685
|
-
await asyncRect.done();
|
|
1686
|
-
|
|
1687
|
-
// 4. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1688
|
-
const refetched = await eda.sch_PrimitiveRectangle.get(rect.getState_PrimitiveId());
|
|
1689
|
-
|
|
1690
|
-
console.log('width:', 200, '→', refetched.getState_Width());
|
|
1691
|
-
```
|
|
1692
|
-
|
|
1693
|
-
### toasync
|
|
1694
|
-
|
|
1695
|
-
# ISCH\_PrimitiveRectangle.toAsync() method
|
|
1696
|
-
|
|
1697
|
-
Convert Primitive to Async primitive
|
|
1698
|
-
|
|
1699
|
-
## Signature
|
|
1700
|
-
|
|
1701
|
-
```typescript
|
|
1702
|
-
function toAsync(): ISCH_PrimitiveRectangle;
|
|
1703
|
-
```
|
|
1704
|
-
|
|
1705
|
-
## Returns
|
|
1706
|
-
|
|
1707
|
-
[ISCH\_PrimitiveRectangle](./ISCH_PrimitiveRectangle.md)
|
|
1708
|
-
|
|
1709
|
-
Rectangle primitive object
|
|
1710
|
-
|
|
1711
|
-
## Example
|
|
1712
|
-
|
|
1713
|
-
```javascript
|
|
1714
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试矩形重合
|
|
1715
|
-
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
1716
|
-
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
1717
|
-
|
|
1718
|
-
// 2. 创建一个测试矩形(创建后默认处于异步模式)
|
|
1719
|
-
const rect = await eda.sch_PrimitiveRectangle.create(x, y, 200, 100);
|
|
1720
|
-
|
|
1721
|
-
// 3. 先切换到同步模式,再转回异步模式,确认可来回切换
|
|
1722
|
-
rect.toSync();
|
|
1723
|
-
const asyncRect = rect.toAsync();
|
|
1724
|
-
|
|
1725
|
-
// 4. 异步模式下批量修改尺寸,一次提交
|
|
1726
|
-
asyncRect.setState_Width(300);
|
|
1727
|
-
asyncRect.setState_Height(150);
|
|
1728
|
-
await asyncRect.done();
|
|
1729
|
-
|
|
1730
|
-
// 5. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1731
|
-
const refetched = await eda.sch_PrimitiveRectangle.get(rect.getState_PrimitiveId());
|
|
1732
|
-
|
|
1733
|
-
console.log('isAsync after toAsync:', rect.isAsync());
|
|
1734
|
-
console.log('width:', 200, '→', refetched.getState_Width());
|
|
1735
|
-
console.log('height:', 100, '→', refetched.getState_Height());
|
|
1736
|
-
```
|
|
1737
|
-
|
|
1738
|
-
### tosync
|
|
1739
|
-
|
|
1740
|
-
# ISCH\_PrimitiveRectangle.toSync() method
|
|
1741
|
-
|
|
1742
|
-
Convert Primitive to Sync primitive
|
|
1743
|
-
|
|
1744
|
-
## Signature
|
|
1745
|
-
|
|
1746
|
-
```typescript
|
|
1747
|
-
function toSync(): ISCH_PrimitiveRectangle;
|
|
1748
|
-
```
|
|
1749
|
-
|
|
1750
|
-
## Returns
|
|
1751
|
-
|
|
1752
|
-
[ISCH\_PrimitiveRectangle](./ISCH_PrimitiveRectangle.md)
|
|
1753
|
-
|
|
1754
|
-
Rectangle primitive object
|
|
1755
|
-
|
|
1756
|
-
## Example
|
|
1757
|
-
|
|
1758
|
-
```javascript
|
|
1759
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试矩形重合
|
|
1760
|
-
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
1761
|
-
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
1762
|
-
|
|
1763
|
-
// 2. 创建一个测试矩形(创建后默认处于异步模式)
|
|
1764
|
-
const rect = await eda.sch_PrimitiveRectangle.create(x, y, 200, 100);
|
|
1765
|
-
|
|
1766
|
-
// 3. 转换为同步图元
|
|
1767
|
-
const syncRect = rect.toSync();
|
|
1768
|
-
|
|
1769
|
-
// 4. 同步模式下把宽扩大到 300,立即生效,无需 done()
|
|
1770
|
-
syncRect.setState_Width(300);
|
|
1771
|
-
|
|
1772
|
-
// 5. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1773
|
-
const refetched = await eda.sch_PrimitiveRectangle.get(rect.getState_PrimitiveId());
|
|
1774
|
-
|
|
1775
|
-
console.log('isAsync after toSync:', rect.isAsync());
|
|
1776
|
-
console.log('width:', 200, '→', refetched.getState_Width());
|
|
1777
|
-
```
|
|
1
|
+
# ISCH\_PrimitiveRectangle class
|
|
2
|
+
|
|
3
|
+
Rectangle primitive
|
|
4
|
+
|
|
5
|
+
## Signature
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
class ISCH_PrimitiveRectangle implements ISCH_Primitive
|
|
9
|
+
```
|
|
10
|
+
**Implements:** [ISCH\_Primitive](../interfaces/ISCH_Primitive.md)
|
|
11
|
+
|
|
12
|
+
## Remarks
|
|
13
|
+
|
|
14
|
+
## Methods
|
|
15
|
+
|
|
16
|
+
<table><thead><tr><th>
|
|
17
|
+
|
|
18
|
+
Method
|
|
19
|
+
|
|
20
|
+
</th><th>
|
|
21
|
+
|
|
22
|
+
Modifiers
|
|
23
|
+
|
|
24
|
+
</th><th>
|
|
25
|
+
|
|
26
|
+
Description
|
|
27
|
+
|
|
28
|
+
</th></tr></thead>
|
|
29
|
+
<tbody><tr><td>
|
|
30
|
+
|
|
31
|
+
[done()](./ISCH_PrimitiveRectangle.md)
|
|
32
|
+
|
|
33
|
+
</td><td>
|
|
34
|
+
|
|
35
|
+
</td><td>
|
|
36
|
+
|
|
37
|
+
**_(BETA)_** Apply the changes to the primitives to the canvas
|
|
38
|
+
|
|
39
|
+
</td></tr>
|
|
40
|
+
<tr><td>
|
|
41
|
+
|
|
42
|
+
[getState\_Color()](./ISCH_PrimitiveRectangle.md)
|
|
43
|
+
|
|
44
|
+
</td><td>
|
|
45
|
+
|
|
46
|
+
</td><td>
|
|
47
|
+
|
|
48
|
+
Get the property state: border color
|
|
49
|
+
|
|
50
|
+
</td></tr>
|
|
51
|
+
<tr><td>
|
|
52
|
+
|
|
53
|
+
[getState\_CornerRadius()](./ISCH_PrimitiveRectangle.md)
|
|
54
|
+
|
|
55
|
+
</td><td>
|
|
56
|
+
|
|
57
|
+
</td><td>
|
|
58
|
+
|
|
59
|
+
Get the property state: corner radius
|
|
60
|
+
|
|
61
|
+
</td></tr>
|
|
62
|
+
<tr><td>
|
|
63
|
+
|
|
64
|
+
[getState\_FillColor()](./ISCH_PrimitiveRectangle.md)
|
|
65
|
+
|
|
66
|
+
</td><td>
|
|
67
|
+
|
|
68
|
+
</td><td>
|
|
69
|
+
|
|
70
|
+
Get the property state: fill color
|
|
71
|
+
|
|
72
|
+
</td></tr>
|
|
73
|
+
<tr><td>
|
|
74
|
+
|
|
75
|
+
[getState\_FillStyle()](./ISCH_PrimitiveRectangle.md)
|
|
76
|
+
|
|
77
|
+
</td><td>
|
|
78
|
+
|
|
79
|
+
</td><td>
|
|
80
|
+
|
|
81
|
+
Get the property state: fill style
|
|
82
|
+
|
|
83
|
+
</td></tr>
|
|
84
|
+
<tr><td>
|
|
85
|
+
|
|
86
|
+
[getState\_Height()](./ISCH_PrimitiveRectangle.md)
|
|
87
|
+
|
|
88
|
+
</td><td>
|
|
89
|
+
|
|
90
|
+
</td><td>
|
|
91
|
+
|
|
92
|
+
Get the property state: height
|
|
93
|
+
|
|
94
|
+
</td></tr>
|
|
95
|
+
<tr><td>
|
|
96
|
+
|
|
97
|
+
[getState\_LineType()](./ISCH_PrimitiveRectangle.md)
|
|
98
|
+
|
|
99
|
+
</td><td>
|
|
100
|
+
|
|
101
|
+
</td><td>
|
|
102
|
+
|
|
103
|
+
Get the property state: line type
|
|
104
|
+
|
|
105
|
+
</td></tr>
|
|
106
|
+
<tr><td>
|
|
107
|
+
|
|
108
|
+
[getState\_LineWidth()](./ISCH_PrimitiveRectangle.md)
|
|
109
|
+
|
|
110
|
+
</td><td>
|
|
111
|
+
|
|
112
|
+
</td><td>
|
|
113
|
+
|
|
114
|
+
Get the property state: Line width
|
|
115
|
+
|
|
116
|
+
</td></tr>
|
|
117
|
+
<tr><td>
|
|
118
|
+
|
|
119
|
+
[getState\_PrimitiveId()](./ISCH_PrimitiveRectangle.md)
|
|
120
|
+
|
|
121
|
+
</td><td>
|
|
122
|
+
|
|
123
|
+
</td><td>
|
|
124
|
+
|
|
125
|
+
Get the property state: primitive ID
|
|
126
|
+
|
|
127
|
+
</td></tr>
|
|
128
|
+
<tr><td>
|
|
129
|
+
|
|
130
|
+
[getState\_PrimitiveType()](./ISCH_PrimitiveRectangle.md)
|
|
131
|
+
|
|
132
|
+
</td><td>
|
|
133
|
+
|
|
134
|
+
</td><td>
|
|
135
|
+
|
|
136
|
+
Get the property state: primitive type
|
|
137
|
+
|
|
138
|
+
</td></tr>
|
|
139
|
+
<tr><td>
|
|
140
|
+
|
|
141
|
+
[getState\_Rotation()](./ISCH_PrimitiveRectangle.md)
|
|
142
|
+
|
|
143
|
+
</td><td>
|
|
144
|
+
|
|
145
|
+
</td><td>
|
|
146
|
+
|
|
147
|
+
Get the property state: rotation angle
|
|
148
|
+
|
|
149
|
+
</td></tr>
|
|
150
|
+
<tr><td>
|
|
151
|
+
|
|
152
|
+
[getState\_TopLeftX()](./ISCH_PrimitiveRectangle.md)
|
|
153
|
+
|
|
154
|
+
</td><td>
|
|
155
|
+
|
|
156
|
+
</td><td>
|
|
157
|
+
|
|
158
|
+
Get the property state: top-left point X
|
|
159
|
+
|
|
160
|
+
</td></tr>
|
|
161
|
+
<tr><td>
|
|
162
|
+
|
|
163
|
+
[getState\_TopLeftY()](./ISCH_PrimitiveRectangle.md)
|
|
164
|
+
|
|
165
|
+
</td><td>
|
|
166
|
+
|
|
167
|
+
</td><td>
|
|
168
|
+
|
|
169
|
+
Get the property state: top-left point Y
|
|
170
|
+
|
|
171
|
+
</td></tr>
|
|
172
|
+
<tr><td>
|
|
173
|
+
|
|
174
|
+
[getState\_Width()](./ISCH_PrimitiveRectangle.md)
|
|
175
|
+
|
|
176
|
+
</td><td>
|
|
177
|
+
|
|
178
|
+
</td><td>
|
|
179
|
+
|
|
180
|
+
Get the property state: width
|
|
181
|
+
|
|
182
|
+
</td></tr>
|
|
183
|
+
<tr><td>
|
|
184
|
+
|
|
185
|
+
[isAsync()](./ISCH_PrimitiveRectangle.md)
|
|
186
|
+
|
|
187
|
+
</td><td>
|
|
188
|
+
|
|
189
|
+
</td><td>
|
|
190
|
+
|
|
191
|
+
Query whether the primitive is an async primitive
|
|
192
|
+
|
|
193
|
+
</td></tr>
|
|
194
|
+
<tr><td>
|
|
195
|
+
|
|
196
|
+
[reset()](./ISCH_PrimitiveRectangle.md)
|
|
197
|
+
|
|
198
|
+
</td><td>
|
|
199
|
+
|
|
200
|
+
</td><td>
|
|
201
|
+
|
|
202
|
+
**_(BETA)_** Reset the async primitive to the current canvas state
|
|
203
|
+
|
|
204
|
+
</td></tr>
|
|
205
|
+
<tr><td>
|
|
206
|
+
|
|
207
|
+
[setState\_Color(color)](./ISCH_PrimitiveRectangle.md)
|
|
208
|
+
|
|
209
|
+
</td><td>
|
|
210
|
+
|
|
211
|
+
</td><td>
|
|
212
|
+
|
|
213
|
+
**_(BETA)_** Set the property state: border color
|
|
214
|
+
|
|
215
|
+
</td></tr>
|
|
216
|
+
<tr><td>
|
|
217
|
+
|
|
218
|
+
[setState\_CornerRadius(cornerRadius)](./ISCH_PrimitiveRectangle.md)
|
|
219
|
+
|
|
220
|
+
</td><td>
|
|
221
|
+
|
|
222
|
+
</td><td>
|
|
223
|
+
|
|
224
|
+
**_(BETA)_** Set the property state: corner radius
|
|
225
|
+
|
|
226
|
+
</td></tr>
|
|
227
|
+
<tr><td>
|
|
228
|
+
|
|
229
|
+
[setState\_FillColor(fillColor)](./ISCH_PrimitiveRectangle.md)
|
|
230
|
+
|
|
231
|
+
</td><td>
|
|
232
|
+
|
|
233
|
+
</td><td>
|
|
234
|
+
|
|
235
|
+
**_(BETA)_** Set the property state: fill color
|
|
236
|
+
|
|
237
|
+
</td></tr>
|
|
238
|
+
<tr><td>
|
|
239
|
+
|
|
240
|
+
[setState\_FillStyle(fillStyle)](./ISCH_PrimitiveRectangle.md)
|
|
241
|
+
|
|
242
|
+
</td><td>
|
|
243
|
+
|
|
244
|
+
</td><td>
|
|
245
|
+
|
|
246
|
+
**_(BETA)_** Set the property state: fill style
|
|
247
|
+
|
|
248
|
+
</td></tr>
|
|
249
|
+
<tr><td>
|
|
250
|
+
|
|
251
|
+
[setState\_Height(height)](./ISCH_PrimitiveRectangle.md)
|
|
252
|
+
|
|
253
|
+
</td><td>
|
|
254
|
+
|
|
255
|
+
</td><td>
|
|
256
|
+
|
|
257
|
+
**_(BETA)_** Set the property state: height
|
|
258
|
+
|
|
259
|
+
</td></tr>
|
|
260
|
+
<tr><td>
|
|
261
|
+
|
|
262
|
+
[setState\_LineType(lineType)](./ISCH_PrimitiveRectangle.md)
|
|
263
|
+
|
|
264
|
+
</td><td>
|
|
265
|
+
|
|
266
|
+
</td><td>
|
|
267
|
+
|
|
268
|
+
**_(BETA)_** Set the property state: line type
|
|
269
|
+
|
|
270
|
+
</td></tr>
|
|
271
|
+
<tr><td>
|
|
272
|
+
|
|
273
|
+
[setState\_LineWidth(lineWidth)](./ISCH_PrimitiveRectangle.md)
|
|
274
|
+
|
|
275
|
+
</td><td>
|
|
276
|
+
|
|
277
|
+
</td><td>
|
|
278
|
+
|
|
279
|
+
**_(BETA)_** Set the property state: Line width
|
|
280
|
+
|
|
281
|
+
</td></tr>
|
|
282
|
+
<tr><td>
|
|
283
|
+
|
|
284
|
+
[setState\_Rotation(rotation)](./ISCH_PrimitiveRectangle.md)
|
|
285
|
+
|
|
286
|
+
</td><td>
|
|
287
|
+
|
|
288
|
+
</td><td>
|
|
289
|
+
|
|
290
|
+
**_(BETA)_** Set the property state: rotation angle
|
|
291
|
+
|
|
292
|
+
</td></tr>
|
|
293
|
+
<tr><td>
|
|
294
|
+
|
|
295
|
+
[setState\_TopLeftX(topLeftX)](./ISCH_PrimitiveRectangle.md)
|
|
296
|
+
|
|
297
|
+
</td><td>
|
|
298
|
+
|
|
299
|
+
</td><td>
|
|
300
|
+
|
|
301
|
+
**_(BETA)_** Set the property state: top-left point X
|
|
302
|
+
|
|
303
|
+
</td></tr>
|
|
304
|
+
<tr><td>
|
|
305
|
+
|
|
306
|
+
[setState\_TopLeftY(topLeftY)](./ISCH_PrimitiveRectangle.md)
|
|
307
|
+
|
|
308
|
+
</td><td>
|
|
309
|
+
|
|
310
|
+
</td><td>
|
|
311
|
+
|
|
312
|
+
**_(BETA)_** Set the property state: top-left point Y
|
|
313
|
+
|
|
314
|
+
</td></tr>
|
|
315
|
+
<tr><td>
|
|
316
|
+
|
|
317
|
+
[setState\_Width(width)](./ISCH_PrimitiveRectangle.md)
|
|
318
|
+
|
|
319
|
+
</td><td>
|
|
320
|
+
|
|
321
|
+
</td><td>
|
|
322
|
+
|
|
323
|
+
**_(BETA)_** Set the property state: width
|
|
324
|
+
|
|
325
|
+
</td></tr>
|
|
326
|
+
<tr><td>
|
|
327
|
+
|
|
328
|
+
[toAsync()](./ISCH_PrimitiveRectangle.md)
|
|
329
|
+
|
|
330
|
+
</td><td>
|
|
331
|
+
|
|
332
|
+
</td><td>
|
|
333
|
+
|
|
334
|
+
Convert Primitive to Async primitive
|
|
335
|
+
|
|
336
|
+
</td></tr>
|
|
337
|
+
<tr><td>
|
|
338
|
+
|
|
339
|
+
[toSync()](./ISCH_PrimitiveRectangle.md)
|
|
340
|
+
|
|
341
|
+
</td><td>
|
|
342
|
+
|
|
343
|
+
</td><td>
|
|
344
|
+
|
|
345
|
+
Convert Primitive to Sync primitive
|
|
346
|
+
|
|
347
|
+
</td></tr>
|
|
348
|
+
</tbody></table>
|
|
349
|
+
|
|
350
|
+
---
|
|
351
|
+
|
|
352
|
+
## 方法详情
|
|
353
|
+
|
|
354
|
+
### done
|
|
355
|
+
|
|
356
|
+
# ISCH\_PrimitiveRectangle.done() method
|
|
357
|
+
|
|
358
|
+
> 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.
|
|
359
|
+
|
|
360
|
+
Apply the changes to the primitives to the canvas
|
|
361
|
+
|
|
362
|
+
## Signature
|
|
363
|
+
|
|
364
|
+
```typescript
|
|
365
|
+
function done(): Promise<ISCH_PrimitiveRectangle>;
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
## Returns
|
|
369
|
+
|
|
370
|
+
Promise<[ISCH\_PrimitiveRectangle](./ISCH_PrimitiveRectangle.md)<!-- -->>
|
|
371
|
+
|
|
372
|
+
Rectangle primitive object
|
|
373
|
+
|
|
374
|
+
## Example
|
|
375
|
+
|
|
376
|
+
```javascript
|
|
377
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试矩形重合
|
|
378
|
+
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
379
|
+
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
380
|
+
|
|
381
|
+
// 2. 创建一个 200×100 的测试矩形(SCH 坐标单位 10mil)
|
|
382
|
+
const rect = await eda.sch_PrimitiveRectangle.create(x, y, 200, 100);
|
|
383
|
+
|
|
384
|
+
// 3. 切换异步模式,累计两处修改(尺寸扩大 + 改边框颜色)
|
|
385
|
+
const asyncRect = rect.toAsync();
|
|
386
|
+
asyncRect.setState_Width(300);
|
|
387
|
+
asyncRect.setState_Color('#00AA00');
|
|
388
|
+
|
|
389
|
+
// 4. 一次性提交到画布
|
|
390
|
+
await asyncRect.done();
|
|
391
|
+
|
|
392
|
+
// 5. 从画布重新读取,确认两处修改都已生效(保留现场供观察)
|
|
393
|
+
const refetched = await eda.sch_PrimitiveRectangle.get(rect.getState_PrimitiveId());
|
|
394
|
+
|
|
395
|
+
console.log('width:', 200, '→', refetched.getState_Width());
|
|
396
|
+
console.log('color:', '#00AA00', '→', refetched.getState_Color());
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
### getstate_color
|
|
400
|
+
|
|
401
|
+
# ISCH\_PrimitiveRectangle.getState\_Color() method
|
|
402
|
+
|
|
403
|
+
Get the property state: border color
|
|
404
|
+
|
|
405
|
+
## Signature
|
|
406
|
+
|
|
407
|
+
```typescript
|
|
408
|
+
function getState_Color(): string | null;
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
## Returns
|
|
412
|
+
|
|
413
|
+
string \| null
|
|
414
|
+
|
|
415
|
+
Border color
|
|
416
|
+
|
|
417
|
+
## Example
|
|
418
|
+
|
|
419
|
+
```javascript
|
|
420
|
+
// 1. 创建一个红色边框的测试矩形(SCH 坐标单位 10mil)
|
|
421
|
+
const rect = await eda.sch_PrimitiveRectangle.create(400, 300, 200, 100, 0, 0, '#FF0000');
|
|
422
|
+
|
|
423
|
+
// 2. 读取边框颜色
|
|
424
|
+
const color = rect.getState_Color();
|
|
425
|
+
|
|
426
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
427
|
+
await eda.sch_PrimitiveRectangle.delete([rect.getState_PrimitiveId()]);
|
|
428
|
+
|
|
429
|
+
console.log('color:', color);
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
### getstate_cornerradius
|
|
433
|
+
|
|
434
|
+
# ISCH\_PrimitiveRectangle.getState\_CornerRadius() method
|
|
435
|
+
|
|
436
|
+
Get the property state: corner radius
|
|
437
|
+
|
|
438
|
+
## Signature
|
|
439
|
+
|
|
440
|
+
```typescript
|
|
441
|
+
function getState_CornerRadius(): number;
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
## Returns
|
|
445
|
+
|
|
446
|
+
number
|
|
447
|
+
|
|
448
|
+
Corner radius
|
|
449
|
+
|
|
450
|
+
## Example
|
|
451
|
+
|
|
452
|
+
```javascript
|
|
453
|
+
// 1. 创建一个圆角半径 10 的测试矩形(SCH 坐标单位 10mil)
|
|
454
|
+
const rect = await eda.sch_PrimitiveRectangle.create(400, 300, 200, 100, 10);
|
|
455
|
+
|
|
456
|
+
// 2. 读取圆角半径
|
|
457
|
+
const cornerRadius = rect.getState_CornerRadius();
|
|
458
|
+
|
|
459
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
460
|
+
await eda.sch_PrimitiveRectangle.delete([rect.getState_PrimitiveId()]);
|
|
461
|
+
|
|
462
|
+
console.log('cornerRadius:', cornerRadius);
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
### getstate_fillcolor
|
|
466
|
+
|
|
467
|
+
# ISCH\_PrimitiveRectangle.getState\_FillColor() method
|
|
468
|
+
|
|
469
|
+
Get the property state: fill color
|
|
470
|
+
|
|
471
|
+
## Signature
|
|
472
|
+
|
|
473
|
+
```typescript
|
|
474
|
+
function getState_FillColor(): string | null;
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
## Returns
|
|
478
|
+
|
|
479
|
+
string \| null
|
|
480
|
+
|
|
481
|
+
Fill color
|
|
482
|
+
|
|
483
|
+
## Example
|
|
484
|
+
|
|
485
|
+
```javascript
|
|
486
|
+
// 1. 创建一个黄色填充的测试矩形(SCH 坐标单位 10mil)
|
|
487
|
+
const rect = await eda.sch_PrimitiveRectangle.create(400, 300, 200, 100, 0, 0, null, '#FFFF00');
|
|
488
|
+
|
|
489
|
+
// 2. 读取填充颜色
|
|
490
|
+
const fillColor = rect.getState_FillColor();
|
|
491
|
+
|
|
492
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
493
|
+
await eda.sch_PrimitiveRectangle.delete([rect.getState_PrimitiveId()]);
|
|
494
|
+
|
|
495
|
+
console.log('fillColor:', fillColor);
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
### getstate_fillstyle
|
|
499
|
+
|
|
500
|
+
# ISCH\_PrimitiveRectangle.getState\_FillStyle() method
|
|
501
|
+
|
|
502
|
+
Get the property state: fill style
|
|
503
|
+
|
|
504
|
+
## Signature
|
|
505
|
+
|
|
506
|
+
```typescript
|
|
507
|
+
function getState_FillStyle(): ESCH_PrimitiveFillStyle | null;
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
## Returns
|
|
511
|
+
|
|
512
|
+
[ESCH\_PrimitiveFillStyle](../enums/ESCH_PrimitiveFillStyle.md) \| null
|
|
513
|
+
|
|
514
|
+
Fill style
|
|
515
|
+
|
|
516
|
+
## Example
|
|
517
|
+
|
|
518
|
+
```javascript
|
|
519
|
+
// 1. 创建一个网格填充的测试矩形(SCH 坐标单位 10mil)
|
|
520
|
+
const rect = await eda.sch_PrimitiveRectangle.create(400, 300, 200, 100, 0, 0, null, null, null, null, 'Grid');
|
|
521
|
+
|
|
522
|
+
// 2. 读取填充样式
|
|
523
|
+
const fillStyle = rect.getState_FillStyle();
|
|
524
|
+
|
|
525
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
526
|
+
await eda.sch_PrimitiveRectangle.delete([rect.getState_PrimitiveId()]);
|
|
527
|
+
|
|
528
|
+
console.log('fillStyle:', fillStyle);
|
|
529
|
+
```
|
|
530
|
+
|
|
531
|
+
### getstate_height
|
|
532
|
+
|
|
533
|
+
# ISCH\_PrimitiveRectangle.getState\_Height() method
|
|
534
|
+
|
|
535
|
+
Get the property state: height
|
|
536
|
+
|
|
537
|
+
## Signature
|
|
538
|
+
|
|
539
|
+
```typescript
|
|
540
|
+
function getState_Height(): number;
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
## Returns
|
|
544
|
+
|
|
545
|
+
number
|
|
546
|
+
|
|
547
|
+
Height
|
|
548
|
+
|
|
549
|
+
## Example
|
|
550
|
+
|
|
551
|
+
```javascript
|
|
552
|
+
// 1. 创建一个 200×100 的测试矩形(SCH 坐标单位 10mil)
|
|
553
|
+
const rect = await eda.sch_PrimitiveRectangle.create(400, 300, 200, 100);
|
|
554
|
+
|
|
555
|
+
// 2. 读取矩形的高
|
|
556
|
+
const height = rect.getState_Height();
|
|
557
|
+
|
|
558
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
559
|
+
await eda.sch_PrimitiveRectangle.delete([rect.getState_PrimitiveId()]);
|
|
560
|
+
|
|
561
|
+
console.log('height:', height);
|
|
562
|
+
```
|
|
563
|
+
|
|
564
|
+
### getstate_linetype
|
|
565
|
+
|
|
566
|
+
# ISCH\_PrimitiveRectangle.getState\_LineType() method
|
|
567
|
+
|
|
568
|
+
Get the property state: line type
|
|
569
|
+
|
|
570
|
+
## Signature
|
|
571
|
+
|
|
572
|
+
```typescript
|
|
573
|
+
function getState_LineType(): ESCH_PrimitiveLineType | null;
|
|
574
|
+
```
|
|
575
|
+
|
|
576
|
+
## Returns
|
|
577
|
+
|
|
578
|
+
[ESCH\_PrimitiveLineType](../enums/ESCH_PrimitiveLineType.md) \| null
|
|
579
|
+
|
|
580
|
+
Line type
|
|
581
|
+
|
|
582
|
+
## Example
|
|
583
|
+
|
|
584
|
+
```javascript
|
|
585
|
+
// 1. 创建一个虚线边框的测试矩形(末参 1 = 虚线,SCH 坐标单位 10mil)
|
|
586
|
+
const rect = await eda.sch_PrimitiveRectangle.create(400, 300, 200, 100, 0, 0, '#FF0000', null, 6, 1);
|
|
587
|
+
|
|
588
|
+
// 2. 读取线型
|
|
589
|
+
const lineType = rect.getState_LineType();
|
|
590
|
+
|
|
591
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
592
|
+
await eda.sch_PrimitiveRectangle.delete([rect.getState_PrimitiveId()]);
|
|
593
|
+
|
|
594
|
+
console.log('lineType:', lineType);
|
|
595
|
+
```
|
|
596
|
+
|
|
597
|
+
### getstate_linewidth
|
|
598
|
+
|
|
599
|
+
# ISCH\_PrimitiveRectangle.getState\_LineWidth() method
|
|
600
|
+
|
|
601
|
+
Get the property state: Line width
|
|
602
|
+
|
|
603
|
+
## Signature
|
|
604
|
+
|
|
605
|
+
```typescript
|
|
606
|
+
function getState_LineWidth(): number | null;
|
|
607
|
+
```
|
|
608
|
+
|
|
609
|
+
## Returns
|
|
610
|
+
|
|
611
|
+
number \| null
|
|
612
|
+
|
|
613
|
+
Line width
|
|
614
|
+
|
|
615
|
+
## Example
|
|
616
|
+
|
|
617
|
+
```javascript
|
|
618
|
+
// 1. 创建一个线宽 6 的测试矩形(SCH 坐标单位 10mil)
|
|
619
|
+
const rect = await eda.sch_PrimitiveRectangle.create(400, 300, 200, 100, 0, 0, '#FF0000', null, 6);
|
|
620
|
+
|
|
621
|
+
// 2. 读取边框线宽
|
|
622
|
+
const lineWidth = rect.getState_LineWidth();
|
|
623
|
+
|
|
624
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
625
|
+
await eda.sch_PrimitiveRectangle.delete([rect.getState_PrimitiveId()]);
|
|
626
|
+
|
|
627
|
+
console.log('lineWidth:', lineWidth);
|
|
628
|
+
```
|
|
629
|
+
|
|
630
|
+
### getstate_primitiveid
|
|
631
|
+
|
|
632
|
+
# ISCH\_PrimitiveRectangle.getState\_PrimitiveId() method
|
|
633
|
+
|
|
634
|
+
Get the property state: primitive ID
|
|
635
|
+
|
|
636
|
+
## Signature
|
|
637
|
+
|
|
638
|
+
```typescript
|
|
639
|
+
function getState_PrimitiveId(): string;
|
|
640
|
+
```
|
|
641
|
+
|
|
642
|
+
## Returns
|
|
643
|
+
|
|
644
|
+
string
|
|
645
|
+
|
|
646
|
+
Primitive ID
|
|
647
|
+
|
|
648
|
+
## Example
|
|
649
|
+
|
|
650
|
+
```javascript
|
|
651
|
+
// 1. 创建一个测试矩形(SCH 坐标单位 10mil)
|
|
652
|
+
const rect = await eda.sch_PrimitiveRectangle.create(400, 300, 200, 100);
|
|
653
|
+
|
|
654
|
+
// 2. 读取图元 ID
|
|
655
|
+
const primitiveId = rect.getState_PrimitiveId();
|
|
656
|
+
|
|
657
|
+
// 3. 用 ID 从画布重取矩形,验证 ID 有效
|
|
658
|
+
const refetched = await eda.sch_PrimitiveRectangle.get(primitiveId);
|
|
659
|
+
|
|
660
|
+
// 4. 清理测试图元(查询类案例不留测试对象)
|
|
661
|
+
await eda.sch_PrimitiveRectangle.delete([primitiveId]);
|
|
662
|
+
|
|
663
|
+
console.log('primitiveId:', primitiveId);
|
|
664
|
+
console.log('refetched width:', refetched.getState_Width());
|
|
665
|
+
```
|
|
666
|
+
|
|
667
|
+
### getstate_primitivetype
|
|
668
|
+
|
|
669
|
+
# ISCH\_PrimitiveRectangle.getState\_PrimitiveType() method
|
|
670
|
+
|
|
671
|
+
Get the property state: primitive type
|
|
672
|
+
|
|
673
|
+
## Signature
|
|
674
|
+
|
|
675
|
+
```typescript
|
|
676
|
+
function getState_PrimitiveType(): ESCH_PrimitiveType;
|
|
677
|
+
```
|
|
678
|
+
|
|
679
|
+
## Returns
|
|
680
|
+
|
|
681
|
+
[ESCH\_PrimitiveType](../enums/ESCH_PrimitiveType.md)
|
|
682
|
+
|
|
683
|
+
Primitive type
|
|
684
|
+
|
|
685
|
+
## Example
|
|
686
|
+
|
|
687
|
+
```javascript
|
|
688
|
+
// 1. 创建一个测试矩形(SCH 坐标单位 10mil)
|
|
689
|
+
const rect = await eda.sch_PrimitiveRectangle.create(400, 300, 200, 100);
|
|
690
|
+
|
|
691
|
+
// 2. 读取图元类型
|
|
692
|
+
const primitiveType = rect.getState_PrimitiveType();
|
|
693
|
+
|
|
694
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
695
|
+
await eda.sch_PrimitiveRectangle.delete([rect.getState_PrimitiveId()]);
|
|
696
|
+
|
|
697
|
+
console.log('primitiveType:', primitiveType);
|
|
698
|
+
```
|
|
699
|
+
|
|
700
|
+
### getstate_rotation
|
|
701
|
+
|
|
702
|
+
# ISCH\_PrimitiveRectangle.getState\_Rotation() method
|
|
703
|
+
|
|
704
|
+
Get the property state: rotation angle
|
|
705
|
+
|
|
706
|
+
## Signature
|
|
707
|
+
|
|
708
|
+
```typescript
|
|
709
|
+
function getState_Rotation(): number;
|
|
710
|
+
```
|
|
711
|
+
|
|
712
|
+
## Returns
|
|
713
|
+
|
|
714
|
+
number
|
|
715
|
+
|
|
716
|
+
Rotation angle
|
|
717
|
+
|
|
718
|
+
## Example
|
|
719
|
+
|
|
720
|
+
```javascript
|
|
721
|
+
// 1. 创建一个旋转 45° 的测试矩形(第 6 参是旋转角,SCH 坐标单位 10mil)
|
|
722
|
+
const rect = await eda.sch_PrimitiveRectangle.create(400, 300, 200, 100, 0, 45);
|
|
723
|
+
|
|
724
|
+
// 2. 读取旋转角度
|
|
725
|
+
const rotation = rect.getState_Rotation();
|
|
726
|
+
|
|
727
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
728
|
+
await eda.sch_PrimitiveRectangle.delete([rect.getState_PrimitiveId()]);
|
|
729
|
+
|
|
730
|
+
console.log('rotation:', rotation);
|
|
731
|
+
```
|
|
732
|
+
|
|
733
|
+
### getstate_topleftx
|
|
734
|
+
|
|
735
|
+
# ISCH\_PrimitiveRectangle.getState\_TopLeftX() method
|
|
736
|
+
|
|
737
|
+
Get the property state: top-left point X
|
|
738
|
+
|
|
739
|
+
## Signature
|
|
740
|
+
|
|
741
|
+
```typescript
|
|
742
|
+
function getState_TopLeftX(): number;
|
|
743
|
+
```
|
|
744
|
+
|
|
745
|
+
## Returns
|
|
746
|
+
|
|
747
|
+
number
|
|
748
|
+
|
|
749
|
+
Top-left point X
|
|
750
|
+
|
|
751
|
+
## Example
|
|
752
|
+
|
|
753
|
+
```javascript
|
|
754
|
+
// 1. 创建一个左上角在 (400, 300) 的测试矩形(SCH 坐标单位 10mil)
|
|
755
|
+
const rect = await eda.sch_PrimitiveRectangle.create(400, 300, 200, 100);
|
|
756
|
+
|
|
757
|
+
// 2. 读取左上角 X 坐标
|
|
758
|
+
const topLeftX = rect.getState_TopLeftX();
|
|
759
|
+
|
|
760
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
761
|
+
await eda.sch_PrimitiveRectangle.delete([rect.getState_PrimitiveId()]);
|
|
762
|
+
|
|
763
|
+
console.log('topLeftX:', topLeftX);
|
|
764
|
+
```
|
|
765
|
+
|
|
766
|
+
### getstate_toplefty
|
|
767
|
+
|
|
768
|
+
# ISCH\_PrimitiveRectangle.getState\_TopLeftY() method
|
|
769
|
+
|
|
770
|
+
Get the property state: top-left point Y
|
|
771
|
+
|
|
772
|
+
## Signature
|
|
773
|
+
|
|
774
|
+
```typescript
|
|
775
|
+
function getState_TopLeftY(): number;
|
|
776
|
+
```
|
|
777
|
+
|
|
778
|
+
## Returns
|
|
779
|
+
|
|
780
|
+
number
|
|
781
|
+
|
|
782
|
+
Top-left point Y
|
|
783
|
+
|
|
784
|
+
## Example
|
|
785
|
+
|
|
786
|
+
```javascript
|
|
787
|
+
// 1. 创建一个左上角在 (400, 300) 的测试矩形(SCH 坐标单位 10mil)
|
|
788
|
+
const rect = await eda.sch_PrimitiveRectangle.create(400, 300, 200, 100);
|
|
789
|
+
|
|
790
|
+
// 2. 读取左上角 Y 坐标
|
|
791
|
+
const topLeftY = rect.getState_TopLeftY();
|
|
792
|
+
|
|
793
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
794
|
+
await eda.sch_PrimitiveRectangle.delete([rect.getState_PrimitiveId()]);
|
|
795
|
+
|
|
796
|
+
console.log('topLeftY:', topLeftY);
|
|
797
|
+
```
|
|
798
|
+
|
|
799
|
+
### getstate_width
|
|
800
|
+
|
|
801
|
+
# ISCH\_PrimitiveRectangle.getState\_Width() method
|
|
802
|
+
|
|
803
|
+
Get the property state: width
|
|
804
|
+
|
|
805
|
+
## Signature
|
|
806
|
+
|
|
807
|
+
```typescript
|
|
808
|
+
function getState_Width(): number;
|
|
809
|
+
```
|
|
810
|
+
|
|
811
|
+
## Returns
|
|
812
|
+
|
|
813
|
+
number
|
|
814
|
+
|
|
815
|
+
Width
|
|
816
|
+
|
|
817
|
+
## Example
|
|
818
|
+
|
|
819
|
+
```javascript
|
|
820
|
+
// 1. 创建一个 200×100 的测试矩形(SCH 坐标单位 10mil)
|
|
821
|
+
const rect = await eda.sch_PrimitiveRectangle.create(400, 300, 200, 100);
|
|
822
|
+
|
|
823
|
+
// 2. 读取矩形的宽
|
|
824
|
+
const width = rect.getState_Width();
|
|
825
|
+
|
|
826
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
827
|
+
await eda.sch_PrimitiveRectangle.delete([rect.getState_PrimitiveId()]);
|
|
828
|
+
|
|
829
|
+
console.log('width:', width);
|
|
830
|
+
```
|
|
831
|
+
|
|
832
|
+
### isasync
|
|
833
|
+
|
|
834
|
+
# ISCH\_PrimitiveRectangle.isAsync() method
|
|
835
|
+
|
|
836
|
+
Query whether the primitive is an async primitive
|
|
837
|
+
|
|
838
|
+
## Signature
|
|
839
|
+
|
|
840
|
+
```typescript
|
|
841
|
+
function isAsync(): boolean;
|
|
842
|
+
```
|
|
843
|
+
|
|
844
|
+
## Returns
|
|
845
|
+
|
|
846
|
+
boolean
|
|
847
|
+
|
|
848
|
+
Whether Is async primitive
|
|
849
|
+
|
|
850
|
+
## Example
|
|
851
|
+
|
|
852
|
+
```javascript
|
|
853
|
+
// 1. 创建一个测试矩形,创建后默认处于异步模式
|
|
854
|
+
const rect = await eda.sch_PrimitiveRectangle.create(400, 300, 200, 100);
|
|
855
|
+
const asyncOnCreate = rect.isAsync();
|
|
856
|
+
|
|
857
|
+
// 2. 切换到同步模式再查询一次,对比两种模式
|
|
858
|
+
rect.toSync();
|
|
859
|
+
const asyncAfterToSync = rect.isAsync();
|
|
860
|
+
|
|
861
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
862
|
+
await eda.sch_PrimitiveRectangle.delete([rect.getState_PrimitiveId()]);
|
|
863
|
+
|
|
864
|
+
console.log('isAsync on create:', asyncOnCreate);
|
|
865
|
+
console.log('isAsync after toSync:', asyncAfterToSync);
|
|
866
|
+
```
|
|
867
|
+
|
|
868
|
+
### reset
|
|
869
|
+
|
|
870
|
+
# ISCH\_PrimitiveRectangle.reset() method
|
|
871
|
+
|
|
872
|
+
> This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
|
|
873
|
+
|
|
874
|
+
Reset the async primitive to the current canvas state
|
|
875
|
+
|
|
876
|
+
## Signature
|
|
877
|
+
|
|
878
|
+
```typescript
|
|
879
|
+
function reset(): Promise<ISCH_PrimitiveRectangle>;
|
|
880
|
+
```
|
|
881
|
+
|
|
882
|
+
## Returns
|
|
883
|
+
|
|
884
|
+
Promise<[ISCH\_PrimitiveRectangle](./ISCH_PrimitiveRectangle.md)<!-- -->>
|
|
885
|
+
|
|
886
|
+
Rectangle primitive object
|
|
887
|
+
|
|
888
|
+
## Example
|
|
889
|
+
|
|
890
|
+
```javascript
|
|
891
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试矩形重合
|
|
892
|
+
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
893
|
+
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
894
|
+
|
|
895
|
+
// 2. 创建一个线宽 6 的测试矩形(SCH 坐标单位 10mil)
|
|
896
|
+
const rect = await eda.sch_PrimitiveRectangle.create(x, y, 200, 100, 0, 0, '#FF0000', null, 6);
|
|
897
|
+
|
|
898
|
+
// 3. 切换异步模式,累计一处未提交的线宽修改(6 → 99)
|
|
899
|
+
const asyncRect = rect.toAsync();
|
|
900
|
+
asyncRect.setState_LineWidth(99);
|
|
901
|
+
|
|
902
|
+
// 4. 重置:丢弃未提交的修改,回到画布当前状态
|
|
903
|
+
await asyncRect.reset();
|
|
904
|
+
|
|
905
|
+
// 5. 从画布重新读取,线宽仍是 6(保留现场供观察)
|
|
906
|
+
const refetched = await eda.sch_PrimitiveRectangle.get(rect.getState_PrimitiveId());
|
|
907
|
+
|
|
908
|
+
console.log('lineWidth after reset:', refetched.getState_LineWidth());
|
|
909
|
+
```
|
|
910
|
+
|
|
911
|
+
### setstate_color
|
|
912
|
+
|
|
913
|
+
# ISCH\_PrimitiveRectangle.setState\_Color() method
|
|
914
|
+
|
|
915
|
+
> 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.
|
|
916
|
+
|
|
917
|
+
Set the property state: border color
|
|
918
|
+
|
|
919
|
+
## Signature
|
|
920
|
+
|
|
921
|
+
```typescript
|
|
922
|
+
function setState_Color(color: string | null): ISCH_PrimitiveRectangle;
|
|
923
|
+
```
|
|
924
|
+
|
|
925
|
+
## Parameters
|
|
926
|
+
|
|
927
|
+
<table><thead><tr><th>
|
|
928
|
+
|
|
929
|
+
Parameter
|
|
930
|
+
|
|
931
|
+
</th><th>
|
|
932
|
+
|
|
933
|
+
Type
|
|
934
|
+
|
|
935
|
+
</th><th>
|
|
936
|
+
|
|
937
|
+
Description
|
|
938
|
+
|
|
939
|
+
</th></tr></thead>
|
|
940
|
+
<tbody><tr><td>
|
|
941
|
+
|
|
942
|
+
color
|
|
943
|
+
|
|
944
|
+
</td><td>
|
|
945
|
+
|
|
946
|
+
string \| null
|
|
947
|
+
|
|
948
|
+
</td><td>
|
|
949
|
+
|
|
950
|
+
Border color
|
|
951
|
+
|
|
952
|
+
</td></tr>
|
|
953
|
+
</tbody></table>
|
|
954
|
+
|
|
955
|
+
## Returns
|
|
956
|
+
|
|
957
|
+
[ISCH\_PrimitiveRectangle](./ISCH_PrimitiveRectangle.md)
|
|
958
|
+
|
|
959
|
+
Rectangle primitive object
|
|
960
|
+
|
|
961
|
+
## Example
|
|
962
|
+
|
|
963
|
+
```javascript
|
|
964
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试矩形重合
|
|
965
|
+
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
966
|
+
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
967
|
+
|
|
968
|
+
// 2. 创建一个红色边框的测试矩形(SCH 坐标单位 10mil)
|
|
969
|
+
const rect = await eda.sch_PrimitiveRectangle.create(x, y, 200, 100, 0, 0, '#FF0000');
|
|
970
|
+
|
|
971
|
+
// 3. 切换异步模式,把边框换成绿色
|
|
972
|
+
const asyncRect = rect.toAsync();
|
|
973
|
+
asyncRect.setState_Color('#00AA00');
|
|
974
|
+
await asyncRect.done();
|
|
975
|
+
|
|
976
|
+
// 4. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
977
|
+
const refetched = await eda.sch_PrimitiveRectangle.get(rect.getState_PrimitiveId());
|
|
978
|
+
|
|
979
|
+
console.log('color:', '#FF0000', '→', refetched.getState_Color());
|
|
980
|
+
```
|
|
981
|
+
|
|
982
|
+
### setstate_cornerradius
|
|
983
|
+
|
|
984
|
+
# ISCH\_PrimitiveRectangle.setState\_CornerRadius() method
|
|
985
|
+
|
|
986
|
+
> 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.
|
|
987
|
+
|
|
988
|
+
Set the property state: corner radius
|
|
989
|
+
|
|
990
|
+
## Signature
|
|
991
|
+
|
|
992
|
+
```typescript
|
|
993
|
+
function setState_CornerRadius(cornerRadius: number): ISCH_PrimitiveRectangle;
|
|
994
|
+
```
|
|
995
|
+
|
|
996
|
+
## Parameters
|
|
997
|
+
|
|
998
|
+
<table><thead><tr><th>
|
|
999
|
+
|
|
1000
|
+
Parameter
|
|
1001
|
+
|
|
1002
|
+
</th><th>
|
|
1003
|
+
|
|
1004
|
+
Type
|
|
1005
|
+
|
|
1006
|
+
</th><th>
|
|
1007
|
+
|
|
1008
|
+
Description
|
|
1009
|
+
|
|
1010
|
+
</th></tr></thead>
|
|
1011
|
+
<tbody><tr><td>
|
|
1012
|
+
|
|
1013
|
+
cornerRadius
|
|
1014
|
+
|
|
1015
|
+
</td><td>
|
|
1016
|
+
|
|
1017
|
+
number
|
|
1018
|
+
|
|
1019
|
+
</td><td>
|
|
1020
|
+
|
|
1021
|
+
Corner radius
|
|
1022
|
+
|
|
1023
|
+
</td></tr>
|
|
1024
|
+
</tbody></table>
|
|
1025
|
+
|
|
1026
|
+
## Returns
|
|
1027
|
+
|
|
1028
|
+
[ISCH\_PrimitiveRectangle](./ISCH_PrimitiveRectangle.md)
|
|
1029
|
+
|
|
1030
|
+
Rectangle primitive object
|
|
1031
|
+
|
|
1032
|
+
## Example
|
|
1033
|
+
|
|
1034
|
+
```javascript
|
|
1035
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试矩形重合
|
|
1036
|
+
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
1037
|
+
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
1038
|
+
|
|
1039
|
+
// 2. 创建一个直角测试矩形(SCH 坐标单位 10mil)
|
|
1040
|
+
const rect = await eda.sch_PrimitiveRectangle.create(x, y, 200, 100);
|
|
1041
|
+
|
|
1042
|
+
// 3. 切换异步模式,把圆角半径调到 20
|
|
1043
|
+
const asyncRect = rect.toAsync();
|
|
1044
|
+
asyncRect.setState_CornerRadius(20);
|
|
1045
|
+
await asyncRect.done();
|
|
1046
|
+
|
|
1047
|
+
// 4. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1048
|
+
const refetched = await eda.sch_PrimitiveRectangle.get(rect.getState_PrimitiveId());
|
|
1049
|
+
|
|
1050
|
+
console.log('cornerRadius:', 0, '→', refetched.getState_CornerRadius());
|
|
1051
|
+
```
|
|
1052
|
+
|
|
1053
|
+
### setstate_fillcolor
|
|
1054
|
+
|
|
1055
|
+
# ISCH\_PrimitiveRectangle.setState\_FillColor() method
|
|
1056
|
+
|
|
1057
|
+
> 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.
|
|
1058
|
+
|
|
1059
|
+
Set the property state: fill color
|
|
1060
|
+
|
|
1061
|
+
## Signature
|
|
1062
|
+
|
|
1063
|
+
```typescript
|
|
1064
|
+
function setState_FillColor(fillColor: string | null): ISCH_PrimitiveRectangle;
|
|
1065
|
+
```
|
|
1066
|
+
|
|
1067
|
+
## Parameters
|
|
1068
|
+
|
|
1069
|
+
<table><thead><tr><th>
|
|
1070
|
+
|
|
1071
|
+
Parameter
|
|
1072
|
+
|
|
1073
|
+
</th><th>
|
|
1074
|
+
|
|
1075
|
+
Type
|
|
1076
|
+
|
|
1077
|
+
</th><th>
|
|
1078
|
+
|
|
1079
|
+
Description
|
|
1080
|
+
|
|
1081
|
+
</th></tr></thead>
|
|
1082
|
+
<tbody><tr><td>
|
|
1083
|
+
|
|
1084
|
+
fillColor
|
|
1085
|
+
|
|
1086
|
+
</td><td>
|
|
1087
|
+
|
|
1088
|
+
string \| null
|
|
1089
|
+
|
|
1090
|
+
</td><td>
|
|
1091
|
+
|
|
1092
|
+
Fill color
|
|
1093
|
+
|
|
1094
|
+
</td></tr>
|
|
1095
|
+
</tbody></table>
|
|
1096
|
+
|
|
1097
|
+
## Returns
|
|
1098
|
+
|
|
1099
|
+
[ISCH\_PrimitiveRectangle](./ISCH_PrimitiveRectangle.md)
|
|
1100
|
+
|
|
1101
|
+
Rectangle primitive object
|
|
1102
|
+
|
|
1103
|
+
## Example
|
|
1104
|
+
|
|
1105
|
+
```javascript
|
|
1106
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试矩形重合
|
|
1107
|
+
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
1108
|
+
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
1109
|
+
|
|
1110
|
+
// 2. 创建一个无填充的测试矩形(SCH 坐标单位 10mil)
|
|
1111
|
+
const rect = await eda.sch_PrimitiveRectangle.create(x, y, 200, 100);
|
|
1112
|
+
|
|
1113
|
+
// 3. 切换异步模式,设置浅黄填充
|
|
1114
|
+
const asyncRect = rect.toAsync();
|
|
1115
|
+
asyncRect.setState_FillColor('#FFEC8B');
|
|
1116
|
+
await asyncRect.done();
|
|
1117
|
+
|
|
1118
|
+
// 4. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1119
|
+
const refetched = await eda.sch_PrimitiveRectangle.get(rect.getState_PrimitiveId());
|
|
1120
|
+
|
|
1121
|
+
console.log('fillColor:', null, '→', refetched.getState_FillColor());
|
|
1122
|
+
```
|
|
1123
|
+
|
|
1124
|
+
### setstate_fillstyle
|
|
1125
|
+
|
|
1126
|
+
# ISCH\_PrimitiveRectangle.setState\_FillStyle() method
|
|
1127
|
+
|
|
1128
|
+
> 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.
|
|
1129
|
+
|
|
1130
|
+
Set the property state: fill style
|
|
1131
|
+
|
|
1132
|
+
## Signature
|
|
1133
|
+
|
|
1134
|
+
```typescript
|
|
1135
|
+
function setState_FillStyle(fillStyle: ESCH_PrimitiveFillStyle | null): ISCH_PrimitiveRectangle;
|
|
1136
|
+
```
|
|
1137
|
+
|
|
1138
|
+
## Parameters
|
|
1139
|
+
|
|
1140
|
+
<table><thead><tr><th>
|
|
1141
|
+
|
|
1142
|
+
Parameter
|
|
1143
|
+
|
|
1144
|
+
</th><th>
|
|
1145
|
+
|
|
1146
|
+
Type
|
|
1147
|
+
|
|
1148
|
+
</th><th>
|
|
1149
|
+
|
|
1150
|
+
Description
|
|
1151
|
+
|
|
1152
|
+
</th></tr></thead>
|
|
1153
|
+
<tbody><tr><td>
|
|
1154
|
+
|
|
1155
|
+
fillStyle
|
|
1156
|
+
|
|
1157
|
+
</td><td>
|
|
1158
|
+
|
|
1159
|
+
[ESCH\_PrimitiveFillStyle](../enums/ESCH_PrimitiveFillStyle.md) \| null
|
|
1160
|
+
|
|
1161
|
+
</td><td>
|
|
1162
|
+
|
|
1163
|
+
Fill style
|
|
1164
|
+
|
|
1165
|
+
</td></tr>
|
|
1166
|
+
</tbody></table>
|
|
1167
|
+
|
|
1168
|
+
## Returns
|
|
1169
|
+
|
|
1170
|
+
[ISCH\_PrimitiveRectangle](./ISCH_PrimitiveRectangle.md)
|
|
1171
|
+
|
|
1172
|
+
Rectangle primitive object
|
|
1173
|
+
|
|
1174
|
+
## Example
|
|
1175
|
+
|
|
1176
|
+
```javascript
|
|
1177
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试矩形重合
|
|
1178
|
+
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
1179
|
+
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
1180
|
+
|
|
1181
|
+
// 2. 创建一个无填充的测试矩形(SCH 坐标单位 10mil)
|
|
1182
|
+
const rect = await eda.sch_PrimitiveRectangle.create(x, y, 200, 100);
|
|
1183
|
+
|
|
1184
|
+
// 3. 切换异步模式,设置网格填充样式
|
|
1185
|
+
const asyncRect = rect.toAsync();
|
|
1186
|
+
asyncRect.setState_FillStyle('Grid');
|
|
1187
|
+
await asyncRect.done();
|
|
1188
|
+
|
|
1189
|
+
// 4. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1190
|
+
const refetched = await eda.sch_PrimitiveRectangle.get(rect.getState_PrimitiveId());
|
|
1191
|
+
|
|
1192
|
+
console.log('fillStyle:', null, '→', refetched.getState_FillStyle());
|
|
1193
|
+
```
|
|
1194
|
+
|
|
1195
|
+
### setstate_height
|
|
1196
|
+
|
|
1197
|
+
# ISCH\_PrimitiveRectangle.setState\_Height() method
|
|
1198
|
+
|
|
1199
|
+
> 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.
|
|
1200
|
+
|
|
1201
|
+
Set the property state: height
|
|
1202
|
+
|
|
1203
|
+
## Signature
|
|
1204
|
+
|
|
1205
|
+
```typescript
|
|
1206
|
+
function setState_Height(height: number): ISCH_PrimitiveRectangle;
|
|
1207
|
+
```
|
|
1208
|
+
|
|
1209
|
+
## Parameters
|
|
1210
|
+
|
|
1211
|
+
<table><thead><tr><th>
|
|
1212
|
+
|
|
1213
|
+
Parameter
|
|
1214
|
+
|
|
1215
|
+
</th><th>
|
|
1216
|
+
|
|
1217
|
+
Type
|
|
1218
|
+
|
|
1219
|
+
</th><th>
|
|
1220
|
+
|
|
1221
|
+
Description
|
|
1222
|
+
|
|
1223
|
+
</th></tr></thead>
|
|
1224
|
+
<tbody><tr><td>
|
|
1225
|
+
|
|
1226
|
+
height
|
|
1227
|
+
|
|
1228
|
+
</td><td>
|
|
1229
|
+
|
|
1230
|
+
number
|
|
1231
|
+
|
|
1232
|
+
</td><td>
|
|
1233
|
+
|
|
1234
|
+
Height
|
|
1235
|
+
|
|
1236
|
+
</td></tr>
|
|
1237
|
+
</tbody></table>
|
|
1238
|
+
|
|
1239
|
+
## Returns
|
|
1240
|
+
|
|
1241
|
+
[ISCH\_PrimitiveRectangle](./ISCH_PrimitiveRectangle.md)
|
|
1242
|
+
|
|
1243
|
+
Rectangle primitive object
|
|
1244
|
+
|
|
1245
|
+
## Example
|
|
1246
|
+
|
|
1247
|
+
```javascript
|
|
1248
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试矩形重合
|
|
1249
|
+
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
1250
|
+
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
1251
|
+
|
|
1252
|
+
// 2. 创建一个 200×100 的测试矩形(SCH 坐标单位 10mil)
|
|
1253
|
+
const rect = await eda.sch_PrimitiveRectangle.create(x, y, 200, 100);
|
|
1254
|
+
|
|
1255
|
+
// 3. 切换异步模式,把高扩大到 150
|
|
1256
|
+
const asyncRect = rect.toAsync();
|
|
1257
|
+
asyncRect.setState_Height(150);
|
|
1258
|
+
await asyncRect.done();
|
|
1259
|
+
|
|
1260
|
+
// 4. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1261
|
+
const refetched = await eda.sch_PrimitiveRectangle.get(rect.getState_PrimitiveId());
|
|
1262
|
+
|
|
1263
|
+
console.log('height:', 100, '→', refetched.getState_Height());
|
|
1264
|
+
```
|
|
1265
|
+
|
|
1266
|
+
### setstate_linetype
|
|
1267
|
+
|
|
1268
|
+
# ISCH\_PrimitiveRectangle.setState\_LineType() method
|
|
1269
|
+
|
|
1270
|
+
> 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.
|
|
1271
|
+
|
|
1272
|
+
Set the property state: line type
|
|
1273
|
+
|
|
1274
|
+
## Signature
|
|
1275
|
+
|
|
1276
|
+
```typescript
|
|
1277
|
+
function setState_LineType(lineType: ESCH_PrimitiveLineType | null): ISCH_PrimitiveRectangle;
|
|
1278
|
+
```
|
|
1279
|
+
|
|
1280
|
+
## Parameters
|
|
1281
|
+
|
|
1282
|
+
<table><thead><tr><th>
|
|
1283
|
+
|
|
1284
|
+
Parameter
|
|
1285
|
+
|
|
1286
|
+
</th><th>
|
|
1287
|
+
|
|
1288
|
+
Type
|
|
1289
|
+
|
|
1290
|
+
</th><th>
|
|
1291
|
+
|
|
1292
|
+
Description
|
|
1293
|
+
|
|
1294
|
+
</th></tr></thead>
|
|
1295
|
+
<tbody><tr><td>
|
|
1296
|
+
|
|
1297
|
+
lineType
|
|
1298
|
+
|
|
1299
|
+
</td><td>
|
|
1300
|
+
|
|
1301
|
+
[ESCH\_PrimitiveLineType](../enums/ESCH_PrimitiveLineType.md) \| null
|
|
1302
|
+
|
|
1303
|
+
</td><td>
|
|
1304
|
+
|
|
1305
|
+
Line type
|
|
1306
|
+
|
|
1307
|
+
</td></tr>
|
|
1308
|
+
</tbody></table>
|
|
1309
|
+
|
|
1310
|
+
## Returns
|
|
1311
|
+
|
|
1312
|
+
[ISCH\_PrimitiveRectangle](./ISCH_PrimitiveRectangle.md)
|
|
1313
|
+
|
|
1314
|
+
Rectangle primitive object
|
|
1315
|
+
|
|
1316
|
+
## Example
|
|
1317
|
+
|
|
1318
|
+
```javascript
|
|
1319
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试矩形重合
|
|
1320
|
+
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
1321
|
+
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
1322
|
+
|
|
1323
|
+
// 2. 创建一个实线边框的测试矩形(末参 0 = 实线,SCH 坐标单位 10mil)
|
|
1324
|
+
const rect = await eda.sch_PrimitiveRectangle.create(x, y, 200, 100, 0, 0, '#FF0000', null, 6, 0);
|
|
1325
|
+
|
|
1326
|
+
// 3. 切换异步模式,把线型改为虚线(1)
|
|
1327
|
+
const asyncRect = rect.toAsync();
|
|
1328
|
+
asyncRect.setState_LineType(1);
|
|
1329
|
+
await asyncRect.done();
|
|
1330
|
+
|
|
1331
|
+
// 4. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1332
|
+
const refetched = await eda.sch_PrimitiveRectangle.get(rect.getState_PrimitiveId());
|
|
1333
|
+
|
|
1334
|
+
console.log('lineType:', 0, '→', refetched.getState_LineType());
|
|
1335
|
+
```
|
|
1336
|
+
|
|
1337
|
+
### setstate_linewidth
|
|
1338
|
+
|
|
1339
|
+
# ISCH\_PrimitiveRectangle.setState\_LineWidth() method
|
|
1340
|
+
|
|
1341
|
+
> 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.
|
|
1342
|
+
|
|
1343
|
+
Set the property state: Line width
|
|
1344
|
+
|
|
1345
|
+
## Signature
|
|
1346
|
+
|
|
1347
|
+
```typescript
|
|
1348
|
+
function setState_LineWidth(lineWidth: number | null): ISCH_PrimitiveRectangle;
|
|
1349
|
+
```
|
|
1350
|
+
|
|
1351
|
+
## Parameters
|
|
1352
|
+
|
|
1353
|
+
<table><thead><tr><th>
|
|
1354
|
+
|
|
1355
|
+
Parameter
|
|
1356
|
+
|
|
1357
|
+
</th><th>
|
|
1358
|
+
|
|
1359
|
+
Type
|
|
1360
|
+
|
|
1361
|
+
</th><th>
|
|
1362
|
+
|
|
1363
|
+
Description
|
|
1364
|
+
|
|
1365
|
+
</th></tr></thead>
|
|
1366
|
+
<tbody><tr><td>
|
|
1367
|
+
|
|
1368
|
+
lineWidth
|
|
1369
|
+
|
|
1370
|
+
</td><td>
|
|
1371
|
+
|
|
1372
|
+
number \| null
|
|
1373
|
+
|
|
1374
|
+
</td><td>
|
|
1375
|
+
|
|
1376
|
+
Line width
|
|
1377
|
+
|
|
1378
|
+
</td></tr>
|
|
1379
|
+
</tbody></table>
|
|
1380
|
+
|
|
1381
|
+
## Returns
|
|
1382
|
+
|
|
1383
|
+
[ISCH\_PrimitiveRectangle](./ISCH_PrimitiveRectangle.md)
|
|
1384
|
+
|
|
1385
|
+
Rectangle primitive object
|
|
1386
|
+
|
|
1387
|
+
## Example
|
|
1388
|
+
|
|
1389
|
+
```javascript
|
|
1390
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试矩形重合
|
|
1391
|
+
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
1392
|
+
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
1393
|
+
|
|
1394
|
+
// 2. 创建一个线宽 6 的测试矩形(SCH 坐标单位 10mil)
|
|
1395
|
+
const rect = await eda.sch_PrimitiveRectangle.create(x, y, 200, 100, 0, 0, '#FF0000', null, 6);
|
|
1396
|
+
|
|
1397
|
+
// 3. 切换异步模式,把线宽加粗到 15
|
|
1398
|
+
const asyncRect = rect.toAsync();
|
|
1399
|
+
asyncRect.setState_LineWidth(15);
|
|
1400
|
+
await asyncRect.done();
|
|
1401
|
+
|
|
1402
|
+
// 4. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1403
|
+
const refetched = await eda.sch_PrimitiveRectangle.get(rect.getState_PrimitiveId());
|
|
1404
|
+
|
|
1405
|
+
console.log('lineWidth:', 6, '→', refetched.getState_LineWidth());
|
|
1406
|
+
```
|
|
1407
|
+
|
|
1408
|
+
### setstate_rotation
|
|
1409
|
+
|
|
1410
|
+
# ISCH\_PrimitiveRectangle.setState\_Rotation() method
|
|
1411
|
+
|
|
1412
|
+
> 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.
|
|
1413
|
+
|
|
1414
|
+
Set the property state: rotation angle
|
|
1415
|
+
|
|
1416
|
+
## Signature
|
|
1417
|
+
|
|
1418
|
+
```typescript
|
|
1419
|
+
function setState_Rotation(rotation: number): ISCH_PrimitiveRectangle;
|
|
1420
|
+
```
|
|
1421
|
+
|
|
1422
|
+
## Parameters
|
|
1423
|
+
|
|
1424
|
+
<table><thead><tr><th>
|
|
1425
|
+
|
|
1426
|
+
Parameter
|
|
1427
|
+
|
|
1428
|
+
</th><th>
|
|
1429
|
+
|
|
1430
|
+
Type
|
|
1431
|
+
|
|
1432
|
+
</th><th>
|
|
1433
|
+
|
|
1434
|
+
Description
|
|
1435
|
+
|
|
1436
|
+
</th></tr></thead>
|
|
1437
|
+
<tbody><tr><td>
|
|
1438
|
+
|
|
1439
|
+
rotation
|
|
1440
|
+
|
|
1441
|
+
</td><td>
|
|
1442
|
+
|
|
1443
|
+
number
|
|
1444
|
+
|
|
1445
|
+
</td><td>
|
|
1446
|
+
|
|
1447
|
+
Rotation angle
|
|
1448
|
+
|
|
1449
|
+
</td></tr>
|
|
1450
|
+
</tbody></table>
|
|
1451
|
+
|
|
1452
|
+
## Returns
|
|
1453
|
+
|
|
1454
|
+
[ISCH\_PrimitiveRectangle](./ISCH_PrimitiveRectangle.md)
|
|
1455
|
+
|
|
1456
|
+
Rectangle primitive object
|
|
1457
|
+
|
|
1458
|
+
## Example
|
|
1459
|
+
|
|
1460
|
+
```javascript
|
|
1461
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试矩形重合
|
|
1462
|
+
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
1463
|
+
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
1464
|
+
|
|
1465
|
+
// 2. 创建一个未旋转的测试矩形(SCH 坐标单位 10mil)
|
|
1466
|
+
const rect = await eda.sch_PrimitiveRectangle.create(x, y, 200, 100);
|
|
1467
|
+
|
|
1468
|
+
// 3. 切换异步模式,提交旋转 30°
|
|
1469
|
+
const asyncRect = rect.toAsync();
|
|
1470
|
+
asyncRect.setState_Rotation(30);
|
|
1471
|
+
await asyncRect.done();
|
|
1472
|
+
|
|
1473
|
+
// 4. 从画布重新读取:形状已旋转(左上角坐标变化),角度读数仍为 0
|
|
1474
|
+
const refetched = await eda.sch_PrimitiveRectangle.get(rect.getState_PrimitiveId());
|
|
1475
|
+
|
|
1476
|
+
console.log('rotation:', 0, '→', refetched.getState_Rotation());
|
|
1477
|
+
console.log('topLeft moved by rotate:', x, '→', refetched.getState_TopLeftX());
|
|
1478
|
+
```
|
|
1479
|
+
|
|
1480
|
+
### setstate_topleftx
|
|
1481
|
+
|
|
1482
|
+
# ISCH\_PrimitiveRectangle.setState\_TopLeftX() method
|
|
1483
|
+
|
|
1484
|
+
> 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.
|
|
1485
|
+
|
|
1486
|
+
Set the property state: top-left point X
|
|
1487
|
+
|
|
1488
|
+
## Signature
|
|
1489
|
+
|
|
1490
|
+
```typescript
|
|
1491
|
+
function setState_TopLeftX(topLeftX: number): ISCH_PrimitiveRectangle;
|
|
1492
|
+
```
|
|
1493
|
+
|
|
1494
|
+
## Parameters
|
|
1495
|
+
|
|
1496
|
+
<table><thead><tr><th>
|
|
1497
|
+
|
|
1498
|
+
Parameter
|
|
1499
|
+
|
|
1500
|
+
</th><th>
|
|
1501
|
+
|
|
1502
|
+
Type
|
|
1503
|
+
|
|
1504
|
+
</th><th>
|
|
1505
|
+
|
|
1506
|
+
Description
|
|
1507
|
+
|
|
1508
|
+
</th></tr></thead>
|
|
1509
|
+
<tbody><tr><td>
|
|
1510
|
+
|
|
1511
|
+
topLeftX
|
|
1512
|
+
|
|
1513
|
+
</td><td>
|
|
1514
|
+
|
|
1515
|
+
number
|
|
1516
|
+
|
|
1517
|
+
</td><td>
|
|
1518
|
+
|
|
1519
|
+
Top-left point X
|
|
1520
|
+
|
|
1521
|
+
</td></tr>
|
|
1522
|
+
</tbody></table>
|
|
1523
|
+
|
|
1524
|
+
## Returns
|
|
1525
|
+
|
|
1526
|
+
[ISCH\_PrimitiveRectangle](./ISCH_PrimitiveRectangle.md)
|
|
1527
|
+
|
|
1528
|
+
Rectangle primitive object
|
|
1529
|
+
|
|
1530
|
+
## Example
|
|
1531
|
+
|
|
1532
|
+
```javascript
|
|
1533
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试矩形重合
|
|
1534
|
+
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
1535
|
+
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
1536
|
+
|
|
1537
|
+
// 2. 创建一个测试矩形(SCH 坐标单位 10mil)
|
|
1538
|
+
const rect = await eda.sch_PrimitiveRectangle.create(x, y, 200, 100);
|
|
1539
|
+
|
|
1540
|
+
// 3. 切换异步模式,把左上角 X 移到 x + 300
|
|
1541
|
+
const asyncRect = rect.toAsync();
|
|
1542
|
+
asyncRect.setState_TopLeftX(x + 300);
|
|
1543
|
+
await asyncRect.done();
|
|
1544
|
+
|
|
1545
|
+
// 4. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1546
|
+
const refetched = await eda.sch_PrimitiveRectangle.get(rect.getState_PrimitiveId());
|
|
1547
|
+
|
|
1548
|
+
console.log('topLeftX:', x, '→', refetched.getState_TopLeftX());
|
|
1549
|
+
```
|
|
1550
|
+
|
|
1551
|
+
### setstate_toplefty
|
|
1552
|
+
|
|
1553
|
+
# ISCH\_PrimitiveRectangle.setState\_TopLeftY() method
|
|
1554
|
+
|
|
1555
|
+
> 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.
|
|
1556
|
+
|
|
1557
|
+
Set the property state: top-left point Y
|
|
1558
|
+
|
|
1559
|
+
## Signature
|
|
1560
|
+
|
|
1561
|
+
```typescript
|
|
1562
|
+
function setState_TopLeftY(topLeftY: number): ISCH_PrimitiveRectangle;
|
|
1563
|
+
```
|
|
1564
|
+
|
|
1565
|
+
## Parameters
|
|
1566
|
+
|
|
1567
|
+
<table><thead><tr><th>
|
|
1568
|
+
|
|
1569
|
+
Parameter
|
|
1570
|
+
|
|
1571
|
+
</th><th>
|
|
1572
|
+
|
|
1573
|
+
Type
|
|
1574
|
+
|
|
1575
|
+
</th><th>
|
|
1576
|
+
|
|
1577
|
+
Description
|
|
1578
|
+
|
|
1579
|
+
</th></tr></thead>
|
|
1580
|
+
<tbody><tr><td>
|
|
1581
|
+
|
|
1582
|
+
topLeftY
|
|
1583
|
+
|
|
1584
|
+
</td><td>
|
|
1585
|
+
|
|
1586
|
+
number
|
|
1587
|
+
|
|
1588
|
+
</td><td>
|
|
1589
|
+
|
|
1590
|
+
Top-left point Y
|
|
1591
|
+
|
|
1592
|
+
</td></tr>
|
|
1593
|
+
</tbody></table>
|
|
1594
|
+
|
|
1595
|
+
## Returns
|
|
1596
|
+
|
|
1597
|
+
[ISCH\_PrimitiveRectangle](./ISCH_PrimitiveRectangle.md)
|
|
1598
|
+
|
|
1599
|
+
Rectangle primitive object
|
|
1600
|
+
|
|
1601
|
+
## Example
|
|
1602
|
+
|
|
1603
|
+
```javascript
|
|
1604
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试矩形重合
|
|
1605
|
+
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
1606
|
+
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
1607
|
+
|
|
1608
|
+
// 2. 创建一个测试矩形(SCH 坐标单位 10mil)
|
|
1609
|
+
const rect = await eda.sch_PrimitiveRectangle.create(x, y, 200, 100);
|
|
1610
|
+
|
|
1611
|
+
// 3. 切换异步模式,把左上角 Y 移到 y + 200
|
|
1612
|
+
const asyncRect = rect.toAsync();
|
|
1613
|
+
asyncRect.setState_TopLeftY(y + 200);
|
|
1614
|
+
await asyncRect.done();
|
|
1615
|
+
|
|
1616
|
+
// 4. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1617
|
+
const refetched = await eda.sch_PrimitiveRectangle.get(rect.getState_PrimitiveId());
|
|
1618
|
+
|
|
1619
|
+
console.log('topLeftY:', y, '→', refetched.getState_TopLeftY());
|
|
1620
|
+
```
|
|
1621
|
+
|
|
1622
|
+
### setstate_width
|
|
1623
|
+
|
|
1624
|
+
# ISCH\_PrimitiveRectangle.setState\_Width() method
|
|
1625
|
+
|
|
1626
|
+
> 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.
|
|
1627
|
+
|
|
1628
|
+
Set the property state: width
|
|
1629
|
+
|
|
1630
|
+
## Signature
|
|
1631
|
+
|
|
1632
|
+
```typescript
|
|
1633
|
+
function setState_Width(width: number): ISCH_PrimitiveRectangle;
|
|
1634
|
+
```
|
|
1635
|
+
|
|
1636
|
+
## Parameters
|
|
1637
|
+
|
|
1638
|
+
<table><thead><tr><th>
|
|
1639
|
+
|
|
1640
|
+
Parameter
|
|
1641
|
+
|
|
1642
|
+
</th><th>
|
|
1643
|
+
|
|
1644
|
+
Type
|
|
1645
|
+
|
|
1646
|
+
</th><th>
|
|
1647
|
+
|
|
1648
|
+
Description
|
|
1649
|
+
|
|
1650
|
+
</th></tr></thead>
|
|
1651
|
+
<tbody><tr><td>
|
|
1652
|
+
|
|
1653
|
+
width
|
|
1654
|
+
|
|
1655
|
+
</td><td>
|
|
1656
|
+
|
|
1657
|
+
number
|
|
1658
|
+
|
|
1659
|
+
</td><td>
|
|
1660
|
+
|
|
1661
|
+
Width
|
|
1662
|
+
|
|
1663
|
+
</td></tr>
|
|
1664
|
+
</tbody></table>
|
|
1665
|
+
|
|
1666
|
+
## Returns
|
|
1667
|
+
|
|
1668
|
+
[ISCH\_PrimitiveRectangle](./ISCH_PrimitiveRectangle.md)
|
|
1669
|
+
|
|
1670
|
+
Rectangle primitive object
|
|
1671
|
+
|
|
1672
|
+
## Example
|
|
1673
|
+
|
|
1674
|
+
```javascript
|
|
1675
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试矩形重合
|
|
1676
|
+
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
1677
|
+
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
1678
|
+
|
|
1679
|
+
// 2. 创建一个 200×100 的测试矩形(SCH 坐标单位 10mil)
|
|
1680
|
+
const rect = await eda.sch_PrimitiveRectangle.create(x, y, 200, 100);
|
|
1681
|
+
|
|
1682
|
+
// 3. 切换异步模式,把宽扩大到 300
|
|
1683
|
+
const asyncRect = rect.toAsync();
|
|
1684
|
+
asyncRect.setState_Width(300);
|
|
1685
|
+
await asyncRect.done();
|
|
1686
|
+
|
|
1687
|
+
// 4. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1688
|
+
const refetched = await eda.sch_PrimitiveRectangle.get(rect.getState_PrimitiveId());
|
|
1689
|
+
|
|
1690
|
+
console.log('width:', 200, '→', refetched.getState_Width());
|
|
1691
|
+
```
|
|
1692
|
+
|
|
1693
|
+
### toasync
|
|
1694
|
+
|
|
1695
|
+
# ISCH\_PrimitiveRectangle.toAsync() method
|
|
1696
|
+
|
|
1697
|
+
Convert Primitive to Async primitive
|
|
1698
|
+
|
|
1699
|
+
## Signature
|
|
1700
|
+
|
|
1701
|
+
```typescript
|
|
1702
|
+
function toAsync(): ISCH_PrimitiveRectangle;
|
|
1703
|
+
```
|
|
1704
|
+
|
|
1705
|
+
## Returns
|
|
1706
|
+
|
|
1707
|
+
[ISCH\_PrimitiveRectangle](./ISCH_PrimitiveRectangle.md)
|
|
1708
|
+
|
|
1709
|
+
Rectangle primitive object
|
|
1710
|
+
|
|
1711
|
+
## Example
|
|
1712
|
+
|
|
1713
|
+
```javascript
|
|
1714
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试矩形重合
|
|
1715
|
+
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
1716
|
+
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
1717
|
+
|
|
1718
|
+
// 2. 创建一个测试矩形(创建后默认处于异步模式)
|
|
1719
|
+
const rect = await eda.sch_PrimitiveRectangle.create(x, y, 200, 100);
|
|
1720
|
+
|
|
1721
|
+
// 3. 先切换到同步模式,再转回异步模式,确认可来回切换
|
|
1722
|
+
rect.toSync();
|
|
1723
|
+
const asyncRect = rect.toAsync();
|
|
1724
|
+
|
|
1725
|
+
// 4. 异步模式下批量修改尺寸,一次提交
|
|
1726
|
+
asyncRect.setState_Width(300);
|
|
1727
|
+
asyncRect.setState_Height(150);
|
|
1728
|
+
await asyncRect.done();
|
|
1729
|
+
|
|
1730
|
+
// 5. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1731
|
+
const refetched = await eda.sch_PrimitiveRectangle.get(rect.getState_PrimitiveId());
|
|
1732
|
+
|
|
1733
|
+
console.log('isAsync after toAsync:', rect.isAsync());
|
|
1734
|
+
console.log('width:', 200, '→', refetched.getState_Width());
|
|
1735
|
+
console.log('height:', 100, '→', refetched.getState_Height());
|
|
1736
|
+
```
|
|
1737
|
+
|
|
1738
|
+
### tosync
|
|
1739
|
+
|
|
1740
|
+
# ISCH\_PrimitiveRectangle.toSync() method
|
|
1741
|
+
|
|
1742
|
+
Convert Primitive to Sync primitive
|
|
1743
|
+
|
|
1744
|
+
## Signature
|
|
1745
|
+
|
|
1746
|
+
```typescript
|
|
1747
|
+
function toSync(): ISCH_PrimitiveRectangle;
|
|
1748
|
+
```
|
|
1749
|
+
|
|
1750
|
+
## Returns
|
|
1751
|
+
|
|
1752
|
+
[ISCH\_PrimitiveRectangle](./ISCH_PrimitiveRectangle.md)
|
|
1753
|
+
|
|
1754
|
+
Rectangle primitive object
|
|
1755
|
+
|
|
1756
|
+
## Example
|
|
1757
|
+
|
|
1758
|
+
```javascript
|
|
1759
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试矩形重合
|
|
1760
|
+
const x = 2000 + Math.floor(Math.random() * 8000);
|
|
1761
|
+
const y = 2000 + Math.floor(Math.random() * 8000);
|
|
1762
|
+
|
|
1763
|
+
// 2. 创建一个测试矩形(创建后默认处于异步模式)
|
|
1764
|
+
const rect = await eda.sch_PrimitiveRectangle.create(x, y, 200, 100);
|
|
1765
|
+
|
|
1766
|
+
// 3. 转换为同步图元
|
|
1767
|
+
const syncRect = rect.toSync();
|
|
1768
|
+
|
|
1769
|
+
// 4. 同步模式下把宽扩大到 300,立即生效,无需 done()
|
|
1770
|
+
syncRect.setState_Width(300);
|
|
1771
|
+
|
|
1772
|
+
// 5. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1773
|
+
const refetched = await eda.sch_PrimitiveRectangle.get(rect.getState_PrimitiveId());
|
|
1774
|
+
|
|
1775
|
+
console.log('isAsync after toSync:', rect.isAsync());
|
|
1776
|
+
console.log('width:', 200, '→', refetched.getState_Width());
|
|
1777
|
+
```
|