@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,1901 +1,1901 @@
|
|
|
1
|
-
# IPCB\_PrimitiveArc class
|
|
2
|
-
|
|
3
|
-
Arc line primitive
|
|
4
|
-
|
|
5
|
-
## Signature
|
|
6
|
-
|
|
7
|
-
```typescript
|
|
8
|
-
class IPCB_PrimitiveArc implements IPCB_Primitive
|
|
9
|
-
```
|
|
10
|
-
**Implements:** [IPCB\_Primitive](../interfaces/IPCB_Primitive.md)
|
|
11
|
-
|
|
12
|
-
## Remarks
|
|
13
|
-
|
|
14
|
-
Both lines and arc lines are wires, corresponding to the line traces and arc traces on the canvas
|
|
15
|
-
|
|
16
|
-
## Methods
|
|
17
|
-
|
|
18
|
-
<table><thead><tr><th>
|
|
19
|
-
|
|
20
|
-
Method
|
|
21
|
-
|
|
22
|
-
</th><th>
|
|
23
|
-
|
|
24
|
-
Modifiers
|
|
25
|
-
|
|
26
|
-
</th><th>
|
|
27
|
-
|
|
28
|
-
Description
|
|
29
|
-
|
|
30
|
-
</th></tr></thead>
|
|
31
|
-
<tbody><tr><td>
|
|
32
|
-
|
|
33
|
-
[done()](./IPCB_PrimitiveArc.md)
|
|
34
|
-
|
|
35
|
-
</td><td>
|
|
36
|
-
|
|
37
|
-
</td><td>
|
|
38
|
-
|
|
39
|
-
**_(BETA)_** Apply the changes to the primitives to the canvas
|
|
40
|
-
|
|
41
|
-
</td></tr>
|
|
42
|
-
<tr><td>
|
|
43
|
-
|
|
44
|
-
[getAdjacentPrimitives()](./IPCB_PrimitiveArc.md)
|
|
45
|
-
|
|
46
|
-
</td><td>
|
|
47
|
-
|
|
48
|
-
</td><td>
|
|
49
|
-
|
|
50
|
-
**_(BETA)_** Get Adjacent primitive objects
|
|
51
|
-
|
|
52
|
-
</td></tr>
|
|
53
|
-
<tr><td>
|
|
54
|
-
|
|
55
|
-
[getEntireTrack(includeVias)](./IPCB_PrimitiveArc.md)
|
|
56
|
-
|
|
57
|
-
</td><td>
|
|
58
|
-
|
|
59
|
-
</td><td>
|
|
60
|
-
|
|
61
|
-
**_(BETA)_** Get the entire wire
|
|
62
|
-
|
|
63
|
-
</td></tr>
|
|
64
|
-
<tr><td>
|
|
65
|
-
|
|
66
|
-
[getEntireTrack(includeVias)](./IPCB_PrimitiveArc.md)
|
|
67
|
-
|
|
68
|
-
</td><td>
|
|
69
|
-
|
|
70
|
-
</td><td>
|
|
71
|
-
|
|
72
|
-
**_(BETA)_** Get the entire wire
|
|
73
|
-
|
|
74
|
-
</td></tr>
|
|
75
|
-
<tr><td>
|
|
76
|
-
|
|
77
|
-
[getState\_ArcAngle()](./IPCB_PrimitiveArc.md)
|
|
78
|
-
|
|
79
|
-
</td><td>
|
|
80
|
-
|
|
81
|
-
</td><td>
|
|
82
|
-
|
|
83
|
-
Get the property state: arc angle
|
|
84
|
-
|
|
85
|
-
</td></tr>
|
|
86
|
-
<tr><td>
|
|
87
|
-
|
|
88
|
-
[getState\_EndX()](./IPCB_PrimitiveArc.md)
|
|
89
|
-
|
|
90
|
-
</td><td>
|
|
91
|
-
|
|
92
|
-
</td><td>
|
|
93
|
-
|
|
94
|
-
Get the property state: end position X
|
|
95
|
-
|
|
96
|
-
</td></tr>
|
|
97
|
-
<tr><td>
|
|
98
|
-
|
|
99
|
-
[getState\_EndY()](./IPCB_PrimitiveArc.md)
|
|
100
|
-
|
|
101
|
-
</td><td>
|
|
102
|
-
|
|
103
|
-
</td><td>
|
|
104
|
-
|
|
105
|
-
Get the property state: end position Y
|
|
106
|
-
|
|
107
|
-
</td></tr>
|
|
108
|
-
<tr><td>
|
|
109
|
-
|
|
110
|
-
[getState\_InteractiveMode()](./IPCB_PrimitiveArc.md)
|
|
111
|
-
|
|
112
|
-
</td><td>
|
|
113
|
-
|
|
114
|
-
</td><td>
|
|
115
|
-
|
|
116
|
-
Get the property state: interaction mode
|
|
117
|
-
|
|
118
|
-
</td></tr>
|
|
119
|
-
<tr><td>
|
|
120
|
-
|
|
121
|
-
[getState\_Layer()](./IPCB_PrimitiveArc.md)
|
|
122
|
-
|
|
123
|
-
</td><td>
|
|
124
|
-
|
|
125
|
-
</td><td>
|
|
126
|
-
|
|
127
|
-
Get the property state: Layer
|
|
128
|
-
|
|
129
|
-
</td></tr>
|
|
130
|
-
<tr><td>
|
|
131
|
-
|
|
132
|
-
[getState\_LineWidth()](./IPCB_PrimitiveArc.md)
|
|
133
|
-
|
|
134
|
-
</td><td>
|
|
135
|
-
|
|
136
|
-
</td><td>
|
|
137
|
-
|
|
138
|
-
Get the property state: Line width
|
|
139
|
-
|
|
140
|
-
</td></tr>
|
|
141
|
-
<tr><td>
|
|
142
|
-
|
|
143
|
-
[getState\_Net()](./IPCB_PrimitiveArc.md)
|
|
144
|
-
|
|
145
|
-
</td><td>
|
|
146
|
-
|
|
147
|
-
</td><td>
|
|
148
|
-
|
|
149
|
-
Get the property state: net name
|
|
150
|
-
|
|
151
|
-
</td></tr>
|
|
152
|
-
<tr><td>
|
|
153
|
-
|
|
154
|
-
[getState\_PrimitiveId()](./IPCB_PrimitiveArc.md)
|
|
155
|
-
|
|
156
|
-
</td><td>
|
|
157
|
-
|
|
158
|
-
</td><td>
|
|
159
|
-
|
|
160
|
-
Get the property state: primitive ID
|
|
161
|
-
|
|
162
|
-
</td></tr>
|
|
163
|
-
<tr><td>
|
|
164
|
-
|
|
165
|
-
[getState\_PrimitiveLock()](./IPCB_PrimitiveArc.md)
|
|
166
|
-
|
|
167
|
-
</td><td>
|
|
168
|
-
|
|
169
|
-
</td><td>
|
|
170
|
-
|
|
171
|
-
Get the property state: whether it is locked
|
|
172
|
-
|
|
173
|
-
</td></tr>
|
|
174
|
-
<tr><td>
|
|
175
|
-
|
|
176
|
-
[getState\_PrimitiveType()](./IPCB_PrimitiveArc.md)
|
|
177
|
-
|
|
178
|
-
</td><td>
|
|
179
|
-
|
|
180
|
-
</td><td>
|
|
181
|
-
|
|
182
|
-
Get the property state: primitive type
|
|
183
|
-
|
|
184
|
-
</td></tr>
|
|
185
|
-
<tr><td>
|
|
186
|
-
|
|
187
|
-
[getState\_StartX()](./IPCB_PrimitiveArc.md)
|
|
188
|
-
|
|
189
|
-
</td><td>
|
|
190
|
-
|
|
191
|
-
</td><td>
|
|
192
|
-
|
|
193
|
-
Get the property state: start position X
|
|
194
|
-
|
|
195
|
-
</td></tr>
|
|
196
|
-
<tr><td>
|
|
197
|
-
|
|
198
|
-
[getState\_StartY()](./IPCB_PrimitiveArc.md)
|
|
199
|
-
|
|
200
|
-
</td><td>
|
|
201
|
-
|
|
202
|
-
</td><td>
|
|
203
|
-
|
|
204
|
-
Get the property state: start position Y
|
|
205
|
-
|
|
206
|
-
</td></tr>
|
|
207
|
-
<tr><td>
|
|
208
|
-
|
|
209
|
-
[isAsync()](./IPCB_PrimitiveArc.md)
|
|
210
|
-
|
|
211
|
-
</td><td>
|
|
212
|
-
|
|
213
|
-
</td><td>
|
|
214
|
-
|
|
215
|
-
Query whether the primitive is an async primitive
|
|
216
|
-
|
|
217
|
-
</td></tr>
|
|
218
|
-
<tr><td>
|
|
219
|
-
|
|
220
|
-
[reset()](./IPCB_PrimitiveArc.md)
|
|
221
|
-
|
|
222
|
-
</td><td>
|
|
223
|
-
|
|
224
|
-
</td><td>
|
|
225
|
-
|
|
226
|
-
**_(BETA)_** Reset the async primitive to the current canvas state
|
|
227
|
-
|
|
228
|
-
</td></tr>
|
|
229
|
-
<tr><td>
|
|
230
|
-
|
|
231
|
-
[setState\_ArcAngle(arcAngle)](./IPCB_PrimitiveArc.md)
|
|
232
|
-
|
|
233
|
-
</td><td>
|
|
234
|
-
|
|
235
|
-
</td><td>
|
|
236
|
-
|
|
237
|
-
**_(BETA)_** Set the property state: arc angle
|
|
238
|
-
|
|
239
|
-
</td></tr>
|
|
240
|
-
<tr><td>
|
|
241
|
-
|
|
242
|
-
[setState\_EndX(endX)](./IPCB_PrimitiveArc.md)
|
|
243
|
-
|
|
244
|
-
</td><td>
|
|
245
|
-
|
|
246
|
-
</td><td>
|
|
247
|
-
|
|
248
|
-
**_(BETA)_** Set the property state: end position X
|
|
249
|
-
|
|
250
|
-
</td></tr>
|
|
251
|
-
<tr><td>
|
|
252
|
-
|
|
253
|
-
[setState\_EndY(endY)](./IPCB_PrimitiveArc.md)
|
|
254
|
-
|
|
255
|
-
</td><td>
|
|
256
|
-
|
|
257
|
-
</td><td>
|
|
258
|
-
|
|
259
|
-
**_(BETA)_** Set the property state: end position Y
|
|
260
|
-
|
|
261
|
-
</td></tr>
|
|
262
|
-
<tr><td>
|
|
263
|
-
|
|
264
|
-
[setState\_InteractiveMode(interactiveMode)](./IPCB_PrimitiveArc.md)
|
|
265
|
-
|
|
266
|
-
</td><td>
|
|
267
|
-
|
|
268
|
-
</td><td>
|
|
269
|
-
|
|
270
|
-
**_(BETA)_** Set the property state: interaction mode
|
|
271
|
-
|
|
272
|
-
</td></tr>
|
|
273
|
-
<tr><td>
|
|
274
|
-
|
|
275
|
-
[setState\_Layer(layer)](./IPCB_PrimitiveArc.md)
|
|
276
|
-
|
|
277
|
-
</td><td>
|
|
278
|
-
|
|
279
|
-
</td><td>
|
|
280
|
-
|
|
281
|
-
**_(BETA)_** Set the property state: Layer
|
|
282
|
-
|
|
283
|
-
</td></tr>
|
|
284
|
-
<tr><td>
|
|
285
|
-
|
|
286
|
-
[setState\_LineWidth(lineWidth)](./IPCB_PrimitiveArc.md)
|
|
287
|
-
|
|
288
|
-
</td><td>
|
|
289
|
-
|
|
290
|
-
</td><td>
|
|
291
|
-
|
|
292
|
-
**_(BETA)_** Set the property state: Line width
|
|
293
|
-
|
|
294
|
-
</td></tr>
|
|
295
|
-
<tr><td>
|
|
296
|
-
|
|
297
|
-
[setState\_Net(net)](./IPCB_PrimitiveArc.md)
|
|
298
|
-
|
|
299
|
-
</td><td>
|
|
300
|
-
|
|
301
|
-
</td><td>
|
|
302
|
-
|
|
303
|
-
**_(BETA)_** Set the property state: net name
|
|
304
|
-
|
|
305
|
-
</td></tr>
|
|
306
|
-
<tr><td>
|
|
307
|
-
|
|
308
|
-
[setState\_PrimitiveLock(primitiveLock)](./IPCB_PrimitiveArc.md)
|
|
309
|
-
|
|
310
|
-
</td><td>
|
|
311
|
-
|
|
312
|
-
</td><td>
|
|
313
|
-
|
|
314
|
-
**_(BETA)_** Set the property state: whether it is locked
|
|
315
|
-
|
|
316
|
-
</td></tr>
|
|
317
|
-
<tr><td>
|
|
318
|
-
|
|
319
|
-
[setState\_StartX(startX)](./IPCB_PrimitiveArc.md)
|
|
320
|
-
|
|
321
|
-
</td><td>
|
|
322
|
-
|
|
323
|
-
</td><td>
|
|
324
|
-
|
|
325
|
-
**_(BETA)_** Set the property state: start position X
|
|
326
|
-
|
|
327
|
-
</td></tr>
|
|
328
|
-
<tr><td>
|
|
329
|
-
|
|
330
|
-
[setState\_StartY(startY)](./IPCB_PrimitiveArc.md)
|
|
331
|
-
|
|
332
|
-
</td><td>
|
|
333
|
-
|
|
334
|
-
</td><td>
|
|
335
|
-
|
|
336
|
-
**_(BETA)_** Set the property state: start position Y
|
|
337
|
-
|
|
338
|
-
</td></tr>
|
|
339
|
-
<tr><td>
|
|
340
|
-
|
|
341
|
-
[toAsync()](./IPCB_PrimitiveArc.md)
|
|
342
|
-
|
|
343
|
-
</td><td>
|
|
344
|
-
|
|
345
|
-
</td><td>
|
|
346
|
-
|
|
347
|
-
Convert Primitive to Async primitive
|
|
348
|
-
|
|
349
|
-
</td></tr>
|
|
350
|
-
<tr><td>
|
|
351
|
-
|
|
352
|
-
[toSync()](./IPCB_PrimitiveArc.md)
|
|
353
|
-
|
|
354
|
-
</td><td>
|
|
355
|
-
|
|
356
|
-
</td><td>
|
|
357
|
-
|
|
358
|
-
Convert Primitive to Sync primitive
|
|
359
|
-
|
|
360
|
-
</td></tr>
|
|
361
|
-
</tbody></table>
|
|
362
|
-
|
|
363
|
-
---
|
|
364
|
-
|
|
365
|
-
## 方法详情
|
|
366
|
-
|
|
367
|
-
### done
|
|
368
|
-
|
|
369
|
-
# IPCB\_PrimitiveArc.done() method
|
|
370
|
-
|
|
371
|
-
> 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.
|
|
372
|
-
|
|
373
|
-
Apply the changes to the primitives to the canvas
|
|
374
|
-
|
|
375
|
-
## Signature
|
|
376
|
-
|
|
377
|
-
```typescript
|
|
378
|
-
function done(): Promise<IPCB_PrimitiveArc>;
|
|
379
|
-
```
|
|
380
|
-
|
|
381
|
-
## Returns
|
|
382
|
-
|
|
383
|
-
Promise<[IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md)<!-- -->>
|
|
384
|
-
|
|
385
|
-
Arc line primitive object
|
|
386
|
-
|
|
387
|
-
## Example
|
|
388
|
-
|
|
389
|
-
```javascript
|
|
390
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试圆弧重合
|
|
391
|
-
const x = 42000 + (Math.floor(Math.random() * 100000));
|
|
392
|
-
const y = 2000 + (Math.floor(Math.random() * 100000));
|
|
393
|
-
|
|
394
|
-
// 2. 创建一段测试圆弧
|
|
395
|
-
const arc = await eda.pcb_PrimitiveArc.create('', 1, x, y, x + 500, y + 300, 90, 10, 1, false);
|
|
396
|
-
|
|
397
|
-
// 3. 切换异步模式,连续累计两处修改(线宽 + 换层)
|
|
398
|
-
const asyncArc = arc.toAsync();
|
|
399
|
-
asyncArc.setState_LineWidth(24);
|
|
400
|
-
asyncArc.setState_Layer(2);
|
|
401
|
-
|
|
402
|
-
// 4. 一次性提交到画布
|
|
403
|
-
await asyncArc.done();
|
|
404
|
-
|
|
405
|
-
// 5. 从画布重新读取,确认两处修改都已生效(保留现场供观察)
|
|
406
|
-
const refetched = await eda.pcb_PrimitiveArc.get(arc.getState_PrimitiveId());
|
|
407
|
-
|
|
408
|
-
console.log('lineWidth:', 10, '→', refetched.getState_LineWidth());
|
|
409
|
-
console.log('layer:', 1, '→', refetched.getState_Layer());
|
|
410
|
-
```
|
|
411
|
-
|
|
412
|
-
### getadjacentprimitives
|
|
413
|
-
|
|
414
|
-
# IPCB\_PrimitiveArc.getAdjacentPrimitives() method
|
|
415
|
-
|
|
416
|
-
> 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.
|
|
417
|
-
|
|
418
|
-
Get Adjacent primitive objects
|
|
419
|
-
|
|
420
|
-
## Signature
|
|
421
|
-
|
|
422
|
-
```typescript
|
|
423
|
-
function getAdjacentPrimitives(): Promise<
|
|
424
|
-
Array<IPCB_PrimitiveLine | IPCB_PrimitiveVia | IPCB_PrimitiveArc>
|
|
425
|
-
>;
|
|
426
|
-
```
|
|
427
|
-
|
|
428
|
-
## Returns
|
|
429
|
-
|
|
430
|
-
Promise<Array<[IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md) \| [IPCB\_PrimitiveVia](./IPCB_PrimitiveVia.md) \| [IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md)<!-- -->>>
|
|
431
|
-
|
|
432
|
-
Adjacent line, via, and arc-line primitive objects
|
|
433
|
-
|
|
434
|
-
## Remarks
|
|
435
|
-
|
|
436
|
-
It will get the line, via, and arc-line primitive objects directly connected to the arc line
|
|
437
|
-
|
|
438
|
-
## Example
|
|
439
|
-
|
|
440
|
-
```javascript
|
|
441
|
-
// 1. 创建一条直线走线,终点落在 (7500, 7000)
|
|
442
|
-
const line = await eda.pcb_PrimitiveLine.create('', 1, 7000, 7000, 7500, 7000, 10);
|
|
443
|
-
|
|
444
|
-
// 2. 创建一段圆弧,起点与直线终点重合,两段构成一整段导线
|
|
445
|
-
const arc = await eda.pcb_PrimitiveArc.create('', 1, 7500, 7000, 7800, 7300, 90, 10, 1, false);
|
|
446
|
-
|
|
447
|
-
// 3. 获取与圆弧直接相连的图元,并读出各自的类型
|
|
448
|
-
const adjacent = await arc.getAdjacentPrimitives();
|
|
449
|
-
|
|
450
|
-
// 4. 清理测试图元(查询类案例不留测试对象)
|
|
451
|
-
await eda.pcb_PrimitiveLine.delete([line]);
|
|
452
|
-
await eda.pcb_PrimitiveArc.delete([arc]);
|
|
453
|
-
|
|
454
|
-
console.log('adjacent count:', adjacent.length);
|
|
455
|
-
adjacent.forEach((p, i) => {
|
|
456
|
-
console.log(`adjacent[${i}] type:`, p.getState_PrimitiveType());
|
|
457
|
-
});
|
|
458
|
-
```
|
|
459
|
-
|
|
460
|
-
### getentiretrack
|
|
461
|
-
|
|
462
|
-
# IPCB\_PrimitiveArc.getEntireTrack() method
|
|
463
|
-
|
|
464
|
-
> 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.
|
|
465
|
-
|
|
466
|
-
Get the entire wire
|
|
467
|
-
|
|
468
|
-
## Signature
|
|
469
|
-
|
|
470
|
-
```typescript
|
|
471
|
-
function getEntireTrack(includeVias: false): Promise<Array<IPCB_PrimitiveLine | IPCB_PrimitiveArc>>;
|
|
472
|
-
```
|
|
473
|
-
|
|
474
|
-
## Parameters
|
|
475
|
-
|
|
476
|
-
<table><thead><tr><th>
|
|
477
|
-
|
|
478
|
-
Parameter
|
|
479
|
-
|
|
480
|
-
</th><th>
|
|
481
|
-
|
|
482
|
-
Type
|
|
483
|
-
|
|
484
|
-
</th><th>
|
|
485
|
-
|
|
486
|
-
Description
|
|
487
|
-
|
|
488
|
-
</th></tr></thead>
|
|
489
|
-
<tbody><tr><td>
|
|
490
|
-
|
|
491
|
-
includeVias
|
|
492
|
-
|
|
493
|
-
</td><td>
|
|
494
|
-
|
|
495
|
-
false
|
|
496
|
-
|
|
497
|
-
</td><td>
|
|
498
|
-
|
|
499
|
-
Whether to include the vias at both ends of the wire
|
|
500
|
-
|
|
501
|
-
</td></tr>
|
|
502
|
-
</tbody></table>
|
|
503
|
-
|
|
504
|
-
## Returns
|
|
505
|
-
|
|
506
|
-
Promise<Array<[IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md) \| [IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md)<!-- -->>>
|
|
507
|
-
|
|
508
|
-
All lines and arc lines in the entire wire
|
|
509
|
-
|
|
510
|
-
## Example
|
|
511
|
-
|
|
512
|
-
```javascript
|
|
513
|
-
// 1. 创建一条直线走线,终点落在 (7500, 7000)
|
|
514
|
-
const line = await eda.pcb_PrimitiveLine.create('', 1, 7000, 7000, 7500, 7000, 10);
|
|
515
|
-
|
|
516
|
-
// 2. 创建一段圆弧,起点与直线终点重合,两段构成一整段导线
|
|
517
|
-
const arc = await eda.pcb_PrimitiveArc.create('', 1, 7500, 7000, 7800, 7300, 90, 10, 1, false);
|
|
518
|
-
|
|
519
|
-
// 3. 只取导线内的直线和圆弧
|
|
520
|
-
const trackOnly = await arc.getEntireTrack(false);
|
|
521
|
-
|
|
522
|
-
// 4. 连两端过孔一起取(本例两端没有过孔,数量不变)
|
|
523
|
-
const trackWithVias = await arc.getEntireTrack(true);
|
|
524
|
-
|
|
525
|
-
// 5. 清理测试图元(查询类案例不留测试对象)
|
|
526
|
-
await eda.pcb_PrimitiveLine.delete([line]);
|
|
527
|
-
await eda.pcb_PrimitiveArc.delete([arc]);
|
|
528
|
-
|
|
529
|
-
console.log('track(false) count:', trackOnly.length);
|
|
530
|
-
trackOnly.forEach((p, i) => {
|
|
531
|
-
console.log(`track(false)[${i}] type:`, p.getState_PrimitiveType());
|
|
532
|
-
});
|
|
533
|
-
console.log('track(true) count:', trackWithVias.length);
|
|
534
|
-
```
|
|
535
|
-
|
|
536
|
-
### getentiretrack_1
|
|
537
|
-
|
|
538
|
-
# IPCB\_PrimitiveArc.getEntireTrack() method
|
|
539
|
-
|
|
540
|
-
> 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.
|
|
541
|
-
|
|
542
|
-
Get the entire wire
|
|
543
|
-
|
|
544
|
-
## Signature
|
|
545
|
-
|
|
546
|
-
```typescript
|
|
547
|
-
function getEntireTrack(
|
|
548
|
-
includeVias: true,
|
|
549
|
-
): Promise<Array<IPCB_PrimitiveLine | IPCB_PrimitiveArc | IPCB_PrimitiveVia>>;
|
|
550
|
-
```
|
|
551
|
-
|
|
552
|
-
## Parameters
|
|
553
|
-
|
|
554
|
-
<table><thead><tr><th>
|
|
555
|
-
|
|
556
|
-
Parameter
|
|
557
|
-
|
|
558
|
-
</th><th>
|
|
559
|
-
|
|
560
|
-
Type
|
|
561
|
-
|
|
562
|
-
</th><th>
|
|
563
|
-
|
|
564
|
-
Description
|
|
565
|
-
|
|
566
|
-
</th></tr></thead>
|
|
567
|
-
<tbody><tr><td>
|
|
568
|
-
|
|
569
|
-
includeVias
|
|
570
|
-
|
|
571
|
-
</td><td>
|
|
572
|
-
|
|
573
|
-
true
|
|
574
|
-
|
|
575
|
-
</td><td>
|
|
576
|
-
|
|
577
|
-
Whether to include the vias at both ends of the wire
|
|
578
|
-
|
|
579
|
-
</td></tr>
|
|
580
|
-
</tbody></table>
|
|
581
|
-
|
|
582
|
-
## Returns
|
|
583
|
-
|
|
584
|
-
Promise<Array<[IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md) \| [IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md) \| [IPCB\_PrimitiveVia](./IPCB_PrimitiveVia.md)<!-- -->>>
|
|
585
|
-
|
|
586
|
-
All lines and arc lines in the entire wire, as well as the vias connected at both ends (if any)
|
|
587
|
-
|
|
588
|
-
### getstate_arcangle
|
|
589
|
-
|
|
590
|
-
# IPCB\_PrimitiveArc.getState\_ArcAngle() method
|
|
591
|
-
|
|
592
|
-
Get the property state: arc angle
|
|
593
|
-
|
|
594
|
-
## Signature
|
|
595
|
-
|
|
596
|
-
```typescript
|
|
597
|
-
function getState_ArcAngle(): number;
|
|
598
|
-
```
|
|
599
|
-
|
|
600
|
-
## Returns
|
|
601
|
-
|
|
602
|
-
number
|
|
603
|
-
|
|
604
|
-
Arc angle
|
|
605
|
-
|
|
606
|
-
## Example
|
|
607
|
-
|
|
608
|
-
```javascript
|
|
609
|
-
// 1. 创建一段 90° 测试圆弧(PCB 坐标单位 mil)
|
|
610
|
-
const arc = await eda.pcb_PrimitiveArc.create('', 1, 1000, 1000, 1500, 1300, 90, 10, 1, false);
|
|
611
|
-
|
|
612
|
-
// 2. 读取圆弧角度
|
|
613
|
-
const arcAngle = arc.getState_ArcAngle();
|
|
614
|
-
|
|
615
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
616
|
-
await eda.pcb_PrimitiveArc.delete([arc.getState_PrimitiveId()]);
|
|
617
|
-
|
|
618
|
-
console.log('arcAngle:', arcAngle);
|
|
619
|
-
```
|
|
620
|
-
|
|
621
|
-
### getstate_endx
|
|
622
|
-
|
|
623
|
-
# IPCB\_PrimitiveArc.getState\_EndX() method
|
|
624
|
-
|
|
625
|
-
Get the property state: end position X
|
|
626
|
-
|
|
627
|
-
## Signature
|
|
628
|
-
|
|
629
|
-
```typescript
|
|
630
|
-
function getState_EndX(): number;
|
|
631
|
-
```
|
|
632
|
-
|
|
633
|
-
## Returns
|
|
634
|
-
|
|
635
|
-
number
|
|
636
|
-
|
|
637
|
-
End position X
|
|
638
|
-
|
|
639
|
-
## Example
|
|
640
|
-
|
|
641
|
-
```javascript
|
|
642
|
-
// 1. 创建一段测试圆弧,终点 (1500, 1300)(PCB 坐标单位 mil)
|
|
643
|
-
const arc = await eda.pcb_PrimitiveArc.create('', 1, 1000, 1000, 1500, 1300, 90, 10, 1, false);
|
|
644
|
-
|
|
645
|
-
// 2. 读取终止位置 X
|
|
646
|
-
const endX = arc.getState_EndX();
|
|
647
|
-
|
|
648
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
649
|
-
await eda.pcb_PrimitiveArc.delete([arc.getState_PrimitiveId()]);
|
|
650
|
-
|
|
651
|
-
console.log('endX:', endX);
|
|
652
|
-
```
|
|
653
|
-
|
|
654
|
-
### getstate_endy
|
|
655
|
-
|
|
656
|
-
# IPCB\_PrimitiveArc.getState\_EndY() method
|
|
657
|
-
|
|
658
|
-
Get the property state: end position Y
|
|
659
|
-
|
|
660
|
-
## Signature
|
|
661
|
-
|
|
662
|
-
```typescript
|
|
663
|
-
function getState_EndY(): number;
|
|
664
|
-
```
|
|
665
|
-
|
|
666
|
-
## Returns
|
|
667
|
-
|
|
668
|
-
number
|
|
669
|
-
|
|
670
|
-
End position Y
|
|
671
|
-
|
|
672
|
-
## Example
|
|
673
|
-
|
|
674
|
-
```javascript
|
|
675
|
-
// 1. 创建一段测试圆弧,终点 (1500, 1300)(PCB 坐标单位 mil)
|
|
676
|
-
const arc = await eda.pcb_PrimitiveArc.create('', 1, 1000, 1000, 1500, 1300, 90, 10, 1, false);
|
|
677
|
-
|
|
678
|
-
// 2. 读取终止位置 Y
|
|
679
|
-
const endY = arc.getState_EndY();
|
|
680
|
-
|
|
681
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
682
|
-
await eda.pcb_PrimitiveArc.delete([arc.getState_PrimitiveId()]);
|
|
683
|
-
|
|
684
|
-
console.log('endY:', endY);
|
|
685
|
-
```
|
|
686
|
-
|
|
687
|
-
### getstate_interactivemode
|
|
688
|
-
|
|
689
|
-
# IPCB\_PrimitiveArc.getState\_InteractiveMode() method
|
|
690
|
-
|
|
691
|
-
Get the property state: interaction mode
|
|
692
|
-
|
|
693
|
-
## Signature
|
|
694
|
-
|
|
695
|
-
```typescript
|
|
696
|
-
function getState_InteractiveMode(): EPCB_PrimitiveArcInteractiveMode;
|
|
697
|
-
```
|
|
698
|
-
|
|
699
|
-
## Returns
|
|
700
|
-
|
|
701
|
-
[EPCB\_PrimitiveArcInteractiveMode](../enums/EPCB_PrimitiveArcInteractiveMode.md)
|
|
702
|
-
|
|
703
|
-
Interaction mode
|
|
704
|
-
|
|
705
|
-
## Example
|
|
706
|
-
|
|
707
|
-
```javascript
|
|
708
|
-
// 1. 创建一段两点圆弧(交互模式 1)的测试圆弧
|
|
709
|
-
const arc = await eda.pcb_PrimitiveArc.create('', 1, 1000, 1000, 1500, 1300, 90, 10, 1, false);
|
|
710
|
-
|
|
711
|
-
// 2. 读取交互模式
|
|
712
|
-
const interactiveMode = arc.getState_InteractiveMode();
|
|
713
|
-
|
|
714
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
715
|
-
await eda.pcb_PrimitiveArc.delete([arc.getState_PrimitiveId()]);
|
|
716
|
-
|
|
717
|
-
console.log('interactiveMode:', interactiveMode);
|
|
718
|
-
```
|
|
719
|
-
|
|
720
|
-
### getstate_layer
|
|
721
|
-
|
|
722
|
-
# IPCB\_PrimitiveArc.getState\_Layer() method
|
|
723
|
-
|
|
724
|
-
Get the property state: Layer
|
|
725
|
-
|
|
726
|
-
## Signature
|
|
727
|
-
|
|
728
|
-
```typescript
|
|
729
|
-
function getState_Layer(): TPCB_LayersOfLine;
|
|
730
|
-
```
|
|
731
|
-
|
|
732
|
-
## Returns
|
|
733
|
-
|
|
734
|
-
[TPCB\_LayersOfLine](../types/TPCB_LayersOfLine.md)
|
|
735
|
-
|
|
736
|
-
Layer
|
|
737
|
-
|
|
738
|
-
## Example
|
|
739
|
-
|
|
740
|
-
```javascript
|
|
741
|
-
// 1. 创建一段顶层(1)测试圆弧
|
|
742
|
-
const arc = await eda.pcb_PrimitiveArc.create('', 1, 1000, 1000, 1500, 1300, 90, 10, 1, false);
|
|
743
|
-
|
|
744
|
-
// 2. 读取所在层
|
|
745
|
-
const layer = arc.getState_Layer();
|
|
746
|
-
|
|
747
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
748
|
-
await eda.pcb_PrimitiveArc.delete([arc.getState_PrimitiveId()]);
|
|
749
|
-
|
|
750
|
-
console.log('layer:', layer);
|
|
751
|
-
```
|
|
752
|
-
|
|
753
|
-
### getstate_linewidth
|
|
754
|
-
|
|
755
|
-
# IPCB\_PrimitiveArc.getState\_LineWidth() method
|
|
756
|
-
|
|
757
|
-
Get the property state: Line width
|
|
758
|
-
|
|
759
|
-
## Signature
|
|
760
|
-
|
|
761
|
-
```typescript
|
|
762
|
-
function getState_LineWidth(): number;
|
|
763
|
-
```
|
|
764
|
-
|
|
765
|
-
## Returns
|
|
766
|
-
|
|
767
|
-
number
|
|
768
|
-
|
|
769
|
-
Line width
|
|
770
|
-
|
|
771
|
-
## Example
|
|
772
|
-
|
|
773
|
-
```javascript
|
|
774
|
-
// 1. 创建一段 10mil 线宽的测试圆弧
|
|
775
|
-
const arc = await eda.pcb_PrimitiveArc.create('', 1, 1000, 1000, 1500, 1300, 90, 10, 1, false);
|
|
776
|
-
|
|
777
|
-
// 2. 读取线宽
|
|
778
|
-
const lineWidth = arc.getState_LineWidth();
|
|
779
|
-
|
|
780
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
781
|
-
await eda.pcb_PrimitiveArc.delete([arc.getState_PrimitiveId()]);
|
|
782
|
-
|
|
783
|
-
console.log('lineWidth:', lineWidth);
|
|
784
|
-
```
|
|
785
|
-
|
|
786
|
-
### getstate_net
|
|
787
|
-
|
|
788
|
-
# IPCB\_PrimitiveArc.getState\_Net() method
|
|
789
|
-
|
|
790
|
-
Get the property state: net name
|
|
791
|
-
|
|
792
|
-
## Signature
|
|
793
|
-
|
|
794
|
-
```typescript
|
|
795
|
-
function getState_Net(): string;
|
|
796
|
-
```
|
|
797
|
-
|
|
798
|
-
## Returns
|
|
799
|
-
|
|
800
|
-
string
|
|
801
|
-
|
|
802
|
-
Net name
|
|
803
|
-
|
|
804
|
-
## Example
|
|
805
|
-
|
|
806
|
-
```javascript
|
|
807
|
-
// 1. 创建一段指定网络的测试圆弧
|
|
808
|
-
const arc = await eda.pcb_PrimitiveArc.create('嘉立创示例_NET', 1, 1000, 1000, 1500, 1300, 90, 10, 1, false);
|
|
809
|
-
|
|
810
|
-
// 2. 读取网络名称
|
|
811
|
-
const net = arc.getState_Net();
|
|
812
|
-
|
|
813
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
814
|
-
await eda.pcb_PrimitiveArc.delete([arc.getState_PrimitiveId()]);
|
|
815
|
-
|
|
816
|
-
console.log('net:', net);
|
|
817
|
-
```
|
|
818
|
-
|
|
819
|
-
### getstate_primitiveid
|
|
820
|
-
|
|
821
|
-
# IPCB\_PrimitiveArc.getState\_PrimitiveId() method
|
|
822
|
-
|
|
823
|
-
Get the property state: primitive ID
|
|
824
|
-
|
|
825
|
-
## Signature
|
|
826
|
-
|
|
827
|
-
```typescript
|
|
828
|
-
function getState_PrimitiveId(): string;
|
|
829
|
-
```
|
|
830
|
-
|
|
831
|
-
## Returns
|
|
832
|
-
|
|
833
|
-
string
|
|
834
|
-
|
|
835
|
-
Primitive ID
|
|
836
|
-
|
|
837
|
-
## Example
|
|
838
|
-
|
|
839
|
-
```javascript
|
|
840
|
-
// 1. 创建一段测试圆弧
|
|
841
|
-
const arc = await eda.pcb_PrimitiveArc.create('', 1, 1000, 1000, 1500, 1300, 90, 10, 1, false);
|
|
842
|
-
|
|
843
|
-
// 2. 读取图元 ID
|
|
844
|
-
const primitiveId = arc.getState_PrimitiveId();
|
|
845
|
-
|
|
846
|
-
// 3. 用该 ID 从画布重新取回圆弧,验证 ID 有效
|
|
847
|
-
const refetched = await eda.pcb_PrimitiveArc.get(primitiveId);
|
|
848
|
-
|
|
849
|
-
// 4. 清理测试图元(查询类案例不留测试对象)
|
|
850
|
-
await eda.pcb_PrimitiveArc.delete([primitiveId]);
|
|
851
|
-
|
|
852
|
-
console.log('primitiveId:', primitiveId);
|
|
853
|
-
console.log('refetched type:', refetched.getState_PrimitiveType());
|
|
854
|
-
```
|
|
855
|
-
|
|
856
|
-
### getstate_primitivelock
|
|
857
|
-
|
|
858
|
-
# IPCB\_PrimitiveArc.getState\_PrimitiveLock() method
|
|
859
|
-
|
|
860
|
-
Get the property state: whether it is locked
|
|
861
|
-
|
|
862
|
-
## Signature
|
|
863
|
-
|
|
864
|
-
```typescript
|
|
865
|
-
function getState_PrimitiveLock(): boolean;
|
|
866
|
-
```
|
|
867
|
-
|
|
868
|
-
## Returns
|
|
869
|
-
|
|
870
|
-
boolean
|
|
871
|
-
|
|
872
|
-
Whether it is locked
|
|
873
|
-
|
|
874
|
-
## Example
|
|
875
|
-
|
|
876
|
-
```javascript
|
|
877
|
-
// 1. 创建一段测试圆弧(默认不锁定)
|
|
878
|
-
const arc = await eda.pcb_PrimitiveArc.create('', 1, 1000, 1000, 1500, 1300, 90, 10, 1, false);
|
|
879
|
-
|
|
880
|
-
// 2. 读取锁定状态
|
|
881
|
-
const locked = arc.getState_PrimitiveLock();
|
|
882
|
-
|
|
883
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
884
|
-
await eda.pcb_PrimitiveArc.delete([arc.getState_PrimitiveId()]);
|
|
885
|
-
|
|
886
|
-
console.log('locked:', locked);
|
|
887
|
-
```
|
|
888
|
-
|
|
889
|
-
### getstate_primitivetype
|
|
890
|
-
|
|
891
|
-
# IPCB\_PrimitiveArc.getState\_PrimitiveType() method
|
|
892
|
-
|
|
893
|
-
Get the property state: primitive type
|
|
894
|
-
|
|
895
|
-
## Signature
|
|
896
|
-
|
|
897
|
-
```typescript
|
|
898
|
-
function getState_PrimitiveType(): EPCB_PrimitiveType;
|
|
899
|
-
```
|
|
900
|
-
|
|
901
|
-
## Returns
|
|
902
|
-
|
|
903
|
-
[EPCB\_PrimitiveType](../enums/EPCB_PrimitiveType.md)
|
|
904
|
-
|
|
905
|
-
Primitive type
|
|
906
|
-
|
|
907
|
-
## Example
|
|
908
|
-
|
|
909
|
-
```javascript
|
|
910
|
-
// 1. 创建一段测试圆弧
|
|
911
|
-
const arc = await eda.pcb_PrimitiveArc.create('', 1, 1000, 1000, 1500, 1300, 90, 10, 1, false);
|
|
912
|
-
|
|
913
|
-
// 2. 读取图元类型
|
|
914
|
-
const type = arc.getState_PrimitiveType();
|
|
915
|
-
|
|
916
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
917
|
-
await eda.pcb_PrimitiveArc.delete([arc.getState_PrimitiveId()]);
|
|
918
|
-
|
|
919
|
-
console.log('type:', type);
|
|
920
|
-
```
|
|
921
|
-
|
|
922
|
-
### getstate_startx
|
|
923
|
-
|
|
924
|
-
# IPCB\_PrimitiveArc.getState\_StartX() method
|
|
925
|
-
|
|
926
|
-
Get the property state: start position X
|
|
927
|
-
|
|
928
|
-
## Signature
|
|
929
|
-
|
|
930
|
-
```typescript
|
|
931
|
-
function getState_StartX(): number;
|
|
932
|
-
```
|
|
933
|
-
|
|
934
|
-
## Returns
|
|
935
|
-
|
|
936
|
-
number
|
|
937
|
-
|
|
938
|
-
Start position X
|
|
939
|
-
|
|
940
|
-
## Example
|
|
941
|
-
|
|
942
|
-
```javascript
|
|
943
|
-
// 1. 创建一段测试圆弧,起点 (1000, 1000)(PCB 坐标单位 mil)
|
|
944
|
-
const arc = await eda.pcb_PrimitiveArc.create('', 1, 1000, 1000, 1500, 1300, 90, 10, 1, false);
|
|
945
|
-
|
|
946
|
-
// 2. 读取起始位置 X
|
|
947
|
-
const startX = arc.getState_StartX();
|
|
948
|
-
|
|
949
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
950
|
-
await eda.pcb_PrimitiveArc.delete([arc.getState_PrimitiveId()]);
|
|
951
|
-
|
|
952
|
-
console.log('startX:', startX);
|
|
953
|
-
```
|
|
954
|
-
|
|
955
|
-
### getstate_starty
|
|
956
|
-
|
|
957
|
-
# IPCB\_PrimitiveArc.getState\_StartY() method
|
|
958
|
-
|
|
959
|
-
Get the property state: start position Y
|
|
960
|
-
|
|
961
|
-
## Signature
|
|
962
|
-
|
|
963
|
-
```typescript
|
|
964
|
-
function getState_StartY(): number;
|
|
965
|
-
```
|
|
966
|
-
|
|
967
|
-
## Returns
|
|
968
|
-
|
|
969
|
-
number
|
|
970
|
-
|
|
971
|
-
Start position Y
|
|
972
|
-
|
|
973
|
-
## Example
|
|
974
|
-
|
|
975
|
-
```javascript
|
|
976
|
-
// 1. 创建一段测试圆弧,起点 (1000, 1000)(PCB 坐标单位 mil)
|
|
977
|
-
const arc = await eda.pcb_PrimitiveArc.create('', 1, 1000, 1000, 1500, 1300, 90, 10, 1, false);
|
|
978
|
-
|
|
979
|
-
// 2. 读取起始位置 Y
|
|
980
|
-
const startY = arc.getState_StartY();
|
|
981
|
-
|
|
982
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
983
|
-
await eda.pcb_PrimitiveArc.delete([arc.getState_PrimitiveId()]);
|
|
984
|
-
|
|
985
|
-
console.log('startY:', startY);
|
|
986
|
-
```
|
|
987
|
-
|
|
988
|
-
### isasync
|
|
989
|
-
|
|
990
|
-
# IPCB\_PrimitiveArc.isAsync() method
|
|
991
|
-
|
|
992
|
-
Query whether the primitive is an async primitive
|
|
993
|
-
|
|
994
|
-
## Signature
|
|
995
|
-
|
|
996
|
-
```typescript
|
|
997
|
-
function isAsync(): boolean;
|
|
998
|
-
```
|
|
999
|
-
|
|
1000
|
-
## Returns
|
|
1001
|
-
|
|
1002
|
-
boolean
|
|
1003
|
-
|
|
1004
|
-
Whether Is async primitive
|
|
1005
|
-
|
|
1006
|
-
## Example
|
|
1007
|
-
|
|
1008
|
-
```javascript
|
|
1009
|
-
// 1. 创建一段测试圆弧,创建后默认处于异步模式
|
|
1010
|
-
const arc = await eda.pcb_PrimitiveArc.create('', 1, 1000, 1000, 1500, 1300, 90, 10, 1, false);
|
|
1011
|
-
const asyncOnCreate = arc.isAsync();
|
|
1012
|
-
|
|
1013
|
-
// 2. 切换到同步模式再查询一次,对比两种模式
|
|
1014
|
-
arc.toSync();
|
|
1015
|
-
const asyncAfterToSync = arc.isAsync();
|
|
1016
|
-
|
|
1017
|
-
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
1018
|
-
await eda.pcb_PrimitiveArc.delete([arc.getState_PrimitiveId()]);
|
|
1019
|
-
|
|
1020
|
-
console.log('isAsync on create:', asyncOnCreate);
|
|
1021
|
-
console.log('isAsync after toSync:', asyncAfterToSync);
|
|
1022
|
-
```
|
|
1023
|
-
|
|
1024
|
-
### reset
|
|
1025
|
-
|
|
1026
|
-
# IPCB\_PrimitiveArc.reset() method
|
|
1027
|
-
|
|
1028
|
-
> 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.
|
|
1029
|
-
|
|
1030
|
-
Reset the async primitive to the current canvas state
|
|
1031
|
-
|
|
1032
|
-
## Signature
|
|
1033
|
-
|
|
1034
|
-
```typescript
|
|
1035
|
-
function reset(): Promise<IPCB_PrimitiveArc>;
|
|
1036
|
-
```
|
|
1037
|
-
|
|
1038
|
-
## Returns
|
|
1039
|
-
|
|
1040
|
-
Promise<[IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md)<!-- -->>
|
|
1041
|
-
|
|
1042
|
-
Arc line primitive object
|
|
1043
|
-
|
|
1044
|
-
## Example
|
|
1045
|
-
|
|
1046
|
-
```javascript
|
|
1047
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试圆弧重合
|
|
1048
|
-
const x = 46000 + (Math.floor(Math.random() * 100000));
|
|
1049
|
-
const y = 2000 + (Math.floor(Math.random() * 100000));
|
|
1050
|
-
|
|
1051
|
-
// 2. 创建一段 10mil 线宽的测试圆弧
|
|
1052
|
-
const arc = await eda.pcb_PrimitiveArc.create('', 1, x, y, x + 500, y + 300, 90, 10, 1, false);
|
|
1053
|
-
|
|
1054
|
-
// 3. 切换异步模式,累计一处未提交的线宽修改(10 → 99)
|
|
1055
|
-
const asyncArc = arc.toAsync();
|
|
1056
|
-
asyncArc.setState_LineWidth(99);
|
|
1057
|
-
|
|
1058
|
-
// 4. 重置:丢弃未提交的修改,回到画布当前状态
|
|
1059
|
-
await asyncArc.reset();
|
|
1060
|
-
|
|
1061
|
-
// 5. 从画布重新读取,线宽仍是 10(保留现场供观察)
|
|
1062
|
-
const refetched = await eda.pcb_PrimitiveArc.get(arc.getState_PrimitiveId());
|
|
1063
|
-
|
|
1064
|
-
console.log('lineWidth after reset:', refetched.getState_LineWidth());
|
|
1065
|
-
```
|
|
1066
|
-
|
|
1067
|
-
### setstate_arcangle
|
|
1068
|
-
|
|
1069
|
-
# IPCB\_PrimitiveArc.setState\_ArcAngle() method
|
|
1070
|
-
|
|
1071
|
-
> 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.
|
|
1072
|
-
|
|
1073
|
-
Set the property state: arc angle
|
|
1074
|
-
|
|
1075
|
-
## Signature
|
|
1076
|
-
|
|
1077
|
-
```typescript
|
|
1078
|
-
function setState_ArcAngle(arcAngle: number): IPCB_PrimitiveArc;
|
|
1079
|
-
```
|
|
1080
|
-
|
|
1081
|
-
## Parameters
|
|
1082
|
-
|
|
1083
|
-
<table><thead><tr><th>
|
|
1084
|
-
|
|
1085
|
-
Parameter
|
|
1086
|
-
|
|
1087
|
-
</th><th>
|
|
1088
|
-
|
|
1089
|
-
Type
|
|
1090
|
-
|
|
1091
|
-
</th><th>
|
|
1092
|
-
|
|
1093
|
-
Description
|
|
1094
|
-
|
|
1095
|
-
</th></tr></thead>
|
|
1096
|
-
<tbody><tr><td>
|
|
1097
|
-
|
|
1098
|
-
arcAngle
|
|
1099
|
-
|
|
1100
|
-
</td><td>
|
|
1101
|
-
|
|
1102
|
-
number
|
|
1103
|
-
|
|
1104
|
-
</td><td>
|
|
1105
|
-
|
|
1106
|
-
Arc angle
|
|
1107
|
-
|
|
1108
|
-
</td></tr>
|
|
1109
|
-
</tbody></table>
|
|
1110
|
-
|
|
1111
|
-
## Returns
|
|
1112
|
-
|
|
1113
|
-
[IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md)
|
|
1114
|
-
|
|
1115
|
-
Arc line primitive object
|
|
1116
|
-
|
|
1117
|
-
## Example
|
|
1118
|
-
|
|
1119
|
-
```javascript
|
|
1120
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试圆弧重合
|
|
1121
|
-
const x = 2000 + (Math.floor(Math.random() * 100000));
|
|
1122
|
-
const y = 2000 + (Math.floor(Math.random() * 100000));
|
|
1123
|
-
|
|
1124
|
-
// 2. 创建一段 90° 测试圆弧(PCB 坐标单位 mil,跨度 500×300)
|
|
1125
|
-
const arc = await eda.pcb_PrimitiveArc.create('', 1, x, y, x + 500, y + 300, 90, 10, 1, false);
|
|
1126
|
-
|
|
1127
|
-
// 3. 读取修改前的角度
|
|
1128
|
-
const before = arc.getState_ArcAngle();
|
|
1129
|
-
|
|
1130
|
-
// 4. 切换异步模式并修改角度(90° → 45°)
|
|
1131
|
-
const asyncArc = arc.toAsync();
|
|
1132
|
-
asyncArc.setState_ArcAngle(45);
|
|
1133
|
-
await asyncArc.done();
|
|
1134
|
-
|
|
1135
|
-
// 5. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1136
|
-
const refetched = await eda.pcb_PrimitiveArc.get(arc.getState_PrimitiveId());
|
|
1137
|
-
const after = refetched.getState_ArcAngle();
|
|
1138
|
-
|
|
1139
|
-
console.log('arcAngle:', before, '→', after);
|
|
1140
|
-
```
|
|
1141
|
-
|
|
1142
|
-
### setstate_endx
|
|
1143
|
-
|
|
1144
|
-
# IPCB\_PrimitiveArc.setState\_EndX() method
|
|
1145
|
-
|
|
1146
|
-
> 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.
|
|
1147
|
-
|
|
1148
|
-
Set the property state: end position X
|
|
1149
|
-
|
|
1150
|
-
## Signature
|
|
1151
|
-
|
|
1152
|
-
```typescript
|
|
1153
|
-
function setState_EndX(endX: number): IPCB_PrimitiveArc;
|
|
1154
|
-
```
|
|
1155
|
-
|
|
1156
|
-
## Parameters
|
|
1157
|
-
|
|
1158
|
-
<table><thead><tr><th>
|
|
1159
|
-
|
|
1160
|
-
Parameter
|
|
1161
|
-
|
|
1162
|
-
</th><th>
|
|
1163
|
-
|
|
1164
|
-
Type
|
|
1165
|
-
|
|
1166
|
-
</th><th>
|
|
1167
|
-
|
|
1168
|
-
Description
|
|
1169
|
-
|
|
1170
|
-
</th></tr></thead>
|
|
1171
|
-
<tbody><tr><td>
|
|
1172
|
-
|
|
1173
|
-
endX
|
|
1174
|
-
|
|
1175
|
-
</td><td>
|
|
1176
|
-
|
|
1177
|
-
number
|
|
1178
|
-
|
|
1179
|
-
</td><td>
|
|
1180
|
-
|
|
1181
|
-
End position X
|
|
1182
|
-
|
|
1183
|
-
</td></tr>
|
|
1184
|
-
</tbody></table>
|
|
1185
|
-
|
|
1186
|
-
## Returns
|
|
1187
|
-
|
|
1188
|
-
[IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md)
|
|
1189
|
-
|
|
1190
|
-
Arc line primitive object
|
|
1191
|
-
|
|
1192
|
-
## Example
|
|
1193
|
-
|
|
1194
|
-
```javascript
|
|
1195
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试圆弧重合
|
|
1196
|
-
const x = 14000 + (Math.floor(Math.random() * 100000));
|
|
1197
|
-
const y = 2000 + (Math.floor(Math.random() * 100000));
|
|
1198
|
-
|
|
1199
|
-
// 2. 创建一段测试圆弧,终点 (x+500, y+300)
|
|
1200
|
-
const arc = await eda.pcb_PrimitiveArc.create('', 1, x, y, x + 500, y + 300, 90, 10, 1, false);
|
|
1201
|
-
|
|
1202
|
-
// 3. 读取修改前的终点 X
|
|
1203
|
-
const before = arc.getState_EndX();
|
|
1204
|
-
|
|
1205
|
-
// 4. 切换异步模式并平移终点 X(右移 300mil)
|
|
1206
|
-
const asyncArc = arc.toAsync();
|
|
1207
|
-
asyncArc.setState_EndX(x + 800);
|
|
1208
|
-
await asyncArc.done();
|
|
1209
|
-
|
|
1210
|
-
// 5. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1211
|
-
const refetched = await eda.pcb_PrimitiveArc.get(arc.getState_PrimitiveId());
|
|
1212
|
-
const after = refetched.getState_EndX();
|
|
1213
|
-
|
|
1214
|
-
console.log('endX:', before, '→', after);
|
|
1215
|
-
```
|
|
1216
|
-
|
|
1217
|
-
### setstate_endy
|
|
1218
|
-
|
|
1219
|
-
# IPCB\_PrimitiveArc.setState\_EndY() method
|
|
1220
|
-
|
|
1221
|
-
> 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.
|
|
1222
|
-
|
|
1223
|
-
Set the property state: end position Y
|
|
1224
|
-
|
|
1225
|
-
## Signature
|
|
1226
|
-
|
|
1227
|
-
```typescript
|
|
1228
|
-
function setState_EndY(endY: number): IPCB_PrimitiveArc;
|
|
1229
|
-
```
|
|
1230
|
-
|
|
1231
|
-
## Parameters
|
|
1232
|
-
|
|
1233
|
-
<table><thead><tr><th>
|
|
1234
|
-
|
|
1235
|
-
Parameter
|
|
1236
|
-
|
|
1237
|
-
</th><th>
|
|
1238
|
-
|
|
1239
|
-
Type
|
|
1240
|
-
|
|
1241
|
-
</th><th>
|
|
1242
|
-
|
|
1243
|
-
Description
|
|
1244
|
-
|
|
1245
|
-
</th></tr></thead>
|
|
1246
|
-
<tbody><tr><td>
|
|
1247
|
-
|
|
1248
|
-
endY
|
|
1249
|
-
|
|
1250
|
-
</td><td>
|
|
1251
|
-
|
|
1252
|
-
number
|
|
1253
|
-
|
|
1254
|
-
</td><td>
|
|
1255
|
-
|
|
1256
|
-
End position Y
|
|
1257
|
-
|
|
1258
|
-
</td></tr>
|
|
1259
|
-
</tbody></table>
|
|
1260
|
-
|
|
1261
|
-
## Returns
|
|
1262
|
-
|
|
1263
|
-
[IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md)
|
|
1264
|
-
|
|
1265
|
-
Arc line primitive object
|
|
1266
|
-
|
|
1267
|
-
## Example
|
|
1268
|
-
|
|
1269
|
-
```javascript
|
|
1270
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试圆弧重合
|
|
1271
|
-
const x = 18000 + (Math.floor(Math.random() * 100000));
|
|
1272
|
-
const y = 2000 + (Math.floor(Math.random() * 100000));
|
|
1273
|
-
|
|
1274
|
-
// 2. 创建一段测试圆弧,终点 (x+500, y+300)
|
|
1275
|
-
const arc = await eda.pcb_PrimitiveArc.create('', 1, x, y, x + 500, y + 300, 90, 10, 1, false);
|
|
1276
|
-
|
|
1277
|
-
// 3. 读取修改前的终点 Y
|
|
1278
|
-
const before = arc.getState_EndY();
|
|
1279
|
-
|
|
1280
|
-
// 4. 切换异步模式并平移终点 Y(上移 300mil)
|
|
1281
|
-
const asyncArc = arc.toAsync();
|
|
1282
|
-
asyncArc.setState_EndY(y + 600);
|
|
1283
|
-
await asyncArc.done();
|
|
1284
|
-
|
|
1285
|
-
// 5. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1286
|
-
const refetched = await eda.pcb_PrimitiveArc.get(arc.getState_PrimitiveId());
|
|
1287
|
-
const after = refetched.getState_EndY();
|
|
1288
|
-
|
|
1289
|
-
console.log('endY:', before, '→', after);
|
|
1290
|
-
```
|
|
1291
|
-
|
|
1292
|
-
### setstate_interactivemode
|
|
1293
|
-
|
|
1294
|
-
# IPCB\_PrimitiveArc.setState\_InteractiveMode() method
|
|
1295
|
-
|
|
1296
|
-
> 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.
|
|
1297
|
-
|
|
1298
|
-
Set the property state: interaction mode
|
|
1299
|
-
|
|
1300
|
-
## Signature
|
|
1301
|
-
|
|
1302
|
-
```typescript
|
|
1303
|
-
function setState_InteractiveMode(
|
|
1304
|
-
interactiveMode: EPCB_PrimitiveArcInteractiveMode,
|
|
1305
|
-
): IPCB_PrimitiveArc;
|
|
1306
|
-
```
|
|
1307
|
-
|
|
1308
|
-
## Parameters
|
|
1309
|
-
|
|
1310
|
-
<table><thead><tr><th>
|
|
1311
|
-
|
|
1312
|
-
Parameter
|
|
1313
|
-
|
|
1314
|
-
</th><th>
|
|
1315
|
-
|
|
1316
|
-
Type
|
|
1317
|
-
|
|
1318
|
-
</th><th>
|
|
1319
|
-
|
|
1320
|
-
Description
|
|
1321
|
-
|
|
1322
|
-
</th></tr></thead>
|
|
1323
|
-
<tbody><tr><td>
|
|
1324
|
-
|
|
1325
|
-
interactiveMode
|
|
1326
|
-
|
|
1327
|
-
</td><td>
|
|
1328
|
-
|
|
1329
|
-
[EPCB\_PrimitiveArcInteractiveMode](../enums/EPCB_PrimitiveArcInteractiveMode.md)
|
|
1330
|
-
|
|
1331
|
-
</td><td>
|
|
1332
|
-
|
|
1333
|
-
Interaction mode
|
|
1334
|
-
|
|
1335
|
-
</td></tr>
|
|
1336
|
-
</tbody></table>
|
|
1337
|
-
|
|
1338
|
-
## Returns
|
|
1339
|
-
|
|
1340
|
-
[IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md)
|
|
1341
|
-
|
|
1342
|
-
Arc line primitive object
|
|
1343
|
-
|
|
1344
|
-
## Example
|
|
1345
|
-
|
|
1346
|
-
```javascript
|
|
1347
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试圆弧重合
|
|
1348
|
-
const x = 38000 + (Math.floor(Math.random() * 100000));
|
|
1349
|
-
const y = 2000 + (Math.floor(Math.random() * 100000));
|
|
1350
|
-
|
|
1351
|
-
// 2. 创建一段两点圆弧(交互模式 1)测试圆弧
|
|
1352
|
-
const arc = await eda.pcb_PrimitiveArc.create('', 1, x, y, x + 500, y + 300, 90, 10, 1, false);
|
|
1353
|
-
|
|
1354
|
-
// 3. 读取修改前的交互模式
|
|
1355
|
-
const before = arc.getState_InteractiveMode();
|
|
1356
|
-
|
|
1357
|
-
// 4. 切换异步模式并改为中心圆弧(1 → 2)
|
|
1358
|
-
const asyncArc = arc.toAsync();
|
|
1359
|
-
asyncArc.setState_InteractiveMode(2);
|
|
1360
|
-
await asyncArc.done();
|
|
1361
|
-
|
|
1362
|
-
// 5. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1363
|
-
const refetched = await eda.pcb_PrimitiveArc.get(arc.getState_PrimitiveId());
|
|
1364
|
-
const after = refetched.getState_InteractiveMode();
|
|
1365
|
-
|
|
1366
|
-
console.log('interactiveMode:', before, '→', after);
|
|
1367
|
-
```
|
|
1368
|
-
|
|
1369
|
-
### setstate_layer
|
|
1370
|
-
|
|
1371
|
-
# IPCB\_PrimitiveArc.setState\_Layer() method
|
|
1372
|
-
|
|
1373
|
-
> 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.
|
|
1374
|
-
|
|
1375
|
-
Set the property state: Layer
|
|
1376
|
-
|
|
1377
|
-
## Signature
|
|
1378
|
-
|
|
1379
|
-
```typescript
|
|
1380
|
-
function setState_Layer(layer: TPCB_LayersOfLine): IPCB_PrimitiveArc;
|
|
1381
|
-
```
|
|
1382
|
-
|
|
1383
|
-
## Parameters
|
|
1384
|
-
|
|
1385
|
-
<table><thead><tr><th>
|
|
1386
|
-
|
|
1387
|
-
Parameter
|
|
1388
|
-
|
|
1389
|
-
</th><th>
|
|
1390
|
-
|
|
1391
|
-
Type
|
|
1392
|
-
|
|
1393
|
-
</th><th>
|
|
1394
|
-
|
|
1395
|
-
Description
|
|
1396
|
-
|
|
1397
|
-
</th></tr></thead>
|
|
1398
|
-
<tbody><tr><td>
|
|
1399
|
-
|
|
1400
|
-
layer
|
|
1401
|
-
|
|
1402
|
-
</td><td>
|
|
1403
|
-
|
|
1404
|
-
[TPCB\_LayersOfLine](../types/TPCB_LayersOfLine.md)
|
|
1405
|
-
|
|
1406
|
-
</td><td>
|
|
1407
|
-
|
|
1408
|
-
Layer
|
|
1409
|
-
|
|
1410
|
-
</td></tr>
|
|
1411
|
-
</tbody></table>
|
|
1412
|
-
|
|
1413
|
-
## Returns
|
|
1414
|
-
|
|
1415
|
-
[IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md)
|
|
1416
|
-
|
|
1417
|
-
Arc line primitive object
|
|
1418
|
-
|
|
1419
|
-
## Example
|
|
1420
|
-
|
|
1421
|
-
```javascript
|
|
1422
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试圆弧重合
|
|
1423
|
-
const x = 22000 + (Math.floor(Math.random() * 100000));
|
|
1424
|
-
const y = 2000 + (Math.floor(Math.random() * 100000));
|
|
1425
|
-
|
|
1426
|
-
// 2. 创建一段顶层(1)测试圆弧
|
|
1427
|
-
const arc = await eda.pcb_PrimitiveArc.create('', 1, x, y, x + 500, y + 300, 90, 10, 1, false);
|
|
1428
|
-
|
|
1429
|
-
// 3. 读取修改前的层
|
|
1430
|
-
const before = arc.getState_Layer();
|
|
1431
|
-
|
|
1432
|
-
// 4. 切换异步模式并换层(顶层 1 → 底层 2)
|
|
1433
|
-
const asyncArc = arc.toAsync();
|
|
1434
|
-
asyncArc.setState_Layer(2);
|
|
1435
|
-
await asyncArc.done();
|
|
1436
|
-
|
|
1437
|
-
// 5. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1438
|
-
const refetched = await eda.pcb_PrimitiveArc.get(arc.getState_PrimitiveId());
|
|
1439
|
-
const after = refetched.getState_Layer();
|
|
1440
|
-
|
|
1441
|
-
console.log('layer:', before, '→', after);
|
|
1442
|
-
```
|
|
1443
|
-
|
|
1444
|
-
### setstate_linewidth
|
|
1445
|
-
|
|
1446
|
-
# IPCB\_PrimitiveArc.setState\_LineWidth() method
|
|
1447
|
-
|
|
1448
|
-
> 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.
|
|
1449
|
-
|
|
1450
|
-
Set the property state: Line width
|
|
1451
|
-
|
|
1452
|
-
## Signature
|
|
1453
|
-
|
|
1454
|
-
```typescript
|
|
1455
|
-
function setState_LineWidth(lineWidth: number): IPCB_PrimitiveArc;
|
|
1456
|
-
```
|
|
1457
|
-
|
|
1458
|
-
## Parameters
|
|
1459
|
-
|
|
1460
|
-
<table><thead><tr><th>
|
|
1461
|
-
|
|
1462
|
-
Parameter
|
|
1463
|
-
|
|
1464
|
-
</th><th>
|
|
1465
|
-
|
|
1466
|
-
Type
|
|
1467
|
-
|
|
1468
|
-
</th><th>
|
|
1469
|
-
|
|
1470
|
-
Description
|
|
1471
|
-
|
|
1472
|
-
</th></tr></thead>
|
|
1473
|
-
<tbody><tr><td>
|
|
1474
|
-
|
|
1475
|
-
lineWidth
|
|
1476
|
-
|
|
1477
|
-
</td><td>
|
|
1478
|
-
|
|
1479
|
-
number
|
|
1480
|
-
|
|
1481
|
-
</td><td>
|
|
1482
|
-
|
|
1483
|
-
Line width
|
|
1484
|
-
|
|
1485
|
-
</td></tr>
|
|
1486
|
-
</tbody></table>
|
|
1487
|
-
|
|
1488
|
-
## Returns
|
|
1489
|
-
|
|
1490
|
-
[IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md)
|
|
1491
|
-
|
|
1492
|
-
Arc line primitive object
|
|
1493
|
-
|
|
1494
|
-
## Example
|
|
1495
|
-
|
|
1496
|
-
```javascript
|
|
1497
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试圆弧重合
|
|
1498
|
-
const x = 26000 + (Math.floor(Math.random() * 100000));
|
|
1499
|
-
const y = 2000 + (Math.floor(Math.random() * 100000));
|
|
1500
|
-
|
|
1501
|
-
// 2. 创建一段 10mil 线宽的测试圆弧
|
|
1502
|
-
const arc = await eda.pcb_PrimitiveArc.create('', 1, x, y, x + 500, y + 300, 90, 10, 1, false);
|
|
1503
|
-
|
|
1504
|
-
// 3. 读取修改前的线宽
|
|
1505
|
-
const before = arc.getState_LineWidth();
|
|
1506
|
-
|
|
1507
|
-
// 4. 切换异步模式并加宽(10 → 24)
|
|
1508
|
-
const asyncArc = arc.toAsync();
|
|
1509
|
-
asyncArc.setState_LineWidth(24);
|
|
1510
|
-
await asyncArc.done();
|
|
1511
|
-
|
|
1512
|
-
// 5. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1513
|
-
const refetched = await eda.pcb_PrimitiveArc.get(arc.getState_PrimitiveId());
|
|
1514
|
-
const after = refetched.getState_LineWidth();
|
|
1515
|
-
|
|
1516
|
-
console.log('lineWidth:', before, '→', after);
|
|
1517
|
-
```
|
|
1518
|
-
|
|
1519
|
-
### setstate_net
|
|
1520
|
-
|
|
1521
|
-
# IPCB\_PrimitiveArc.setState\_Net() method
|
|
1522
|
-
|
|
1523
|
-
> 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.
|
|
1524
|
-
|
|
1525
|
-
Set the property state: net name
|
|
1526
|
-
|
|
1527
|
-
## Signature
|
|
1528
|
-
|
|
1529
|
-
```typescript
|
|
1530
|
-
function setState_Net(net: string): IPCB_PrimitiveArc;
|
|
1531
|
-
```
|
|
1532
|
-
|
|
1533
|
-
## Parameters
|
|
1534
|
-
|
|
1535
|
-
<table><thead><tr><th>
|
|
1536
|
-
|
|
1537
|
-
Parameter
|
|
1538
|
-
|
|
1539
|
-
</th><th>
|
|
1540
|
-
|
|
1541
|
-
Type
|
|
1542
|
-
|
|
1543
|
-
</th><th>
|
|
1544
|
-
|
|
1545
|
-
Description
|
|
1546
|
-
|
|
1547
|
-
</th></tr></thead>
|
|
1548
|
-
<tbody><tr><td>
|
|
1549
|
-
|
|
1550
|
-
net
|
|
1551
|
-
|
|
1552
|
-
</td><td>
|
|
1553
|
-
|
|
1554
|
-
string
|
|
1555
|
-
|
|
1556
|
-
</td><td>
|
|
1557
|
-
|
|
1558
|
-
Net name
|
|
1559
|
-
|
|
1560
|
-
</td></tr>
|
|
1561
|
-
</tbody></table>
|
|
1562
|
-
|
|
1563
|
-
## Returns
|
|
1564
|
-
|
|
1565
|
-
[IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md)
|
|
1566
|
-
|
|
1567
|
-
Arc line primitive object
|
|
1568
|
-
|
|
1569
|
-
## Example
|
|
1570
|
-
|
|
1571
|
-
```javascript
|
|
1572
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试圆弧重合
|
|
1573
|
-
const x = 30000 + (Math.floor(Math.random() * 100000));
|
|
1574
|
-
const y = 2000 + (Math.floor(Math.random() * 100000));
|
|
1575
|
-
|
|
1576
|
-
// 2. 创建一段无网络的测试圆弧
|
|
1577
|
-
const arc = await eda.pcb_PrimitiveArc.create('', 1, x, y, x + 500, y + 300, 90, 10, 1, false);
|
|
1578
|
-
|
|
1579
|
-
// 3. 读取修改前的网络名称
|
|
1580
|
-
const before = arc.getState_Net();
|
|
1581
|
-
|
|
1582
|
-
// 4. 切换异步模式并指定网络('' → '嘉立创示例_NET')
|
|
1583
|
-
const asyncArc = arc.toAsync();
|
|
1584
|
-
asyncArc.setState_Net('嘉立创示例_NET');
|
|
1585
|
-
await asyncArc.done();
|
|
1586
|
-
|
|
1587
|
-
// 5. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1588
|
-
const refetched = await eda.pcb_PrimitiveArc.get(arc.getState_PrimitiveId());
|
|
1589
|
-
const after = refetched.getState_Net();
|
|
1590
|
-
|
|
1591
|
-
console.log('net:', before, '→', after);
|
|
1592
|
-
```
|
|
1593
|
-
|
|
1594
|
-
### setstate_primitivelock
|
|
1595
|
-
|
|
1596
|
-
# IPCB\_PrimitiveArc.setState\_PrimitiveLock() method
|
|
1597
|
-
|
|
1598
|
-
> 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.
|
|
1599
|
-
|
|
1600
|
-
Set the property state: whether it is locked
|
|
1601
|
-
|
|
1602
|
-
## Signature
|
|
1603
|
-
|
|
1604
|
-
```typescript
|
|
1605
|
-
function setState_PrimitiveLock(primitiveLock: boolean): IPCB_PrimitiveArc;
|
|
1606
|
-
```
|
|
1607
|
-
|
|
1608
|
-
## Parameters
|
|
1609
|
-
|
|
1610
|
-
<table><thead><tr><th>
|
|
1611
|
-
|
|
1612
|
-
Parameter
|
|
1613
|
-
|
|
1614
|
-
</th><th>
|
|
1615
|
-
|
|
1616
|
-
Type
|
|
1617
|
-
|
|
1618
|
-
</th><th>
|
|
1619
|
-
|
|
1620
|
-
Description
|
|
1621
|
-
|
|
1622
|
-
</th></tr></thead>
|
|
1623
|
-
<tbody><tr><td>
|
|
1624
|
-
|
|
1625
|
-
primitiveLock
|
|
1626
|
-
|
|
1627
|
-
</td><td>
|
|
1628
|
-
|
|
1629
|
-
boolean
|
|
1630
|
-
|
|
1631
|
-
</td><td>
|
|
1632
|
-
|
|
1633
|
-
Whether it is locked
|
|
1634
|
-
|
|
1635
|
-
</td></tr>
|
|
1636
|
-
</tbody></table>
|
|
1637
|
-
|
|
1638
|
-
## Returns
|
|
1639
|
-
|
|
1640
|
-
[IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md)
|
|
1641
|
-
|
|
1642
|
-
Arc line primitive object
|
|
1643
|
-
|
|
1644
|
-
## Example
|
|
1645
|
-
|
|
1646
|
-
```javascript
|
|
1647
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试圆弧重合
|
|
1648
|
-
const x = 34000 + (Math.floor(Math.random() * 100000));
|
|
1649
|
-
const y = 2000 + (Math.floor(Math.random() * 100000));
|
|
1650
|
-
|
|
1651
|
-
// 2. 创建一段测试圆弧(默认不锁定)
|
|
1652
|
-
const arc = await eda.pcb_PrimitiveArc.create('', 1, x, y, x + 500, y + 300, 90, 10, 1, false);
|
|
1653
|
-
|
|
1654
|
-
// 3. 读取修改前的锁定状态
|
|
1655
|
-
const before = arc.getState_PrimitiveLock();
|
|
1656
|
-
|
|
1657
|
-
// 4. 切换异步模式并锁定(false → true)
|
|
1658
|
-
const asyncArc = arc.toAsync();
|
|
1659
|
-
asyncArc.setState_PrimitiveLock(true);
|
|
1660
|
-
await asyncArc.done();
|
|
1661
|
-
|
|
1662
|
-
// 5. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1663
|
-
const refetched = await eda.pcb_PrimitiveArc.get(arc.getState_PrimitiveId());
|
|
1664
|
-
const after = refetched.getState_PrimitiveLock();
|
|
1665
|
-
|
|
1666
|
-
console.log('locked:', before, '→', after);
|
|
1667
|
-
```
|
|
1668
|
-
|
|
1669
|
-
### setstate_startx
|
|
1670
|
-
|
|
1671
|
-
# IPCB\_PrimitiveArc.setState\_StartX() method
|
|
1672
|
-
|
|
1673
|
-
> 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.
|
|
1674
|
-
|
|
1675
|
-
Set the property state: start position X
|
|
1676
|
-
|
|
1677
|
-
## Signature
|
|
1678
|
-
|
|
1679
|
-
```typescript
|
|
1680
|
-
function setState_StartX(startX: number): IPCB_PrimitiveArc;
|
|
1681
|
-
```
|
|
1682
|
-
|
|
1683
|
-
## Parameters
|
|
1684
|
-
|
|
1685
|
-
<table><thead><tr><th>
|
|
1686
|
-
|
|
1687
|
-
Parameter
|
|
1688
|
-
|
|
1689
|
-
</th><th>
|
|
1690
|
-
|
|
1691
|
-
Type
|
|
1692
|
-
|
|
1693
|
-
</th><th>
|
|
1694
|
-
|
|
1695
|
-
Description
|
|
1696
|
-
|
|
1697
|
-
</th></tr></thead>
|
|
1698
|
-
<tbody><tr><td>
|
|
1699
|
-
|
|
1700
|
-
startX
|
|
1701
|
-
|
|
1702
|
-
</td><td>
|
|
1703
|
-
|
|
1704
|
-
number
|
|
1705
|
-
|
|
1706
|
-
</td><td>
|
|
1707
|
-
|
|
1708
|
-
Start position X
|
|
1709
|
-
|
|
1710
|
-
</td></tr>
|
|
1711
|
-
</tbody></table>
|
|
1712
|
-
|
|
1713
|
-
## Returns
|
|
1714
|
-
|
|
1715
|
-
[IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md)
|
|
1716
|
-
|
|
1717
|
-
Arc line primitive object
|
|
1718
|
-
|
|
1719
|
-
## Example
|
|
1720
|
-
|
|
1721
|
-
```javascript
|
|
1722
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试圆弧重合
|
|
1723
|
-
const x = 6000 + (Math.floor(Math.random() * 100000));
|
|
1724
|
-
const y = 2000 + (Math.floor(Math.random() * 100000));
|
|
1725
|
-
|
|
1726
|
-
// 2. 创建一段测试圆弧,起点 (x, y)
|
|
1727
|
-
const arc = await eda.pcb_PrimitiveArc.create('', 1, x, y, x + 500, y + 300, 90, 10, 1, false);
|
|
1728
|
-
|
|
1729
|
-
// 3. 读取修改前的起点 X
|
|
1730
|
-
const before = arc.getState_StartX();
|
|
1731
|
-
|
|
1732
|
-
// 4. 切换异步模式并平移起点 X(右移 300mil)
|
|
1733
|
-
const asyncArc = arc.toAsync();
|
|
1734
|
-
asyncArc.setState_StartX(x + 300);
|
|
1735
|
-
await asyncArc.done();
|
|
1736
|
-
|
|
1737
|
-
// 5. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1738
|
-
const refetched = await eda.pcb_PrimitiveArc.get(arc.getState_PrimitiveId());
|
|
1739
|
-
const after = refetched.getState_StartX();
|
|
1740
|
-
|
|
1741
|
-
console.log('startX:', before, '→', after);
|
|
1742
|
-
```
|
|
1743
|
-
|
|
1744
|
-
### setstate_starty
|
|
1745
|
-
|
|
1746
|
-
# IPCB\_PrimitiveArc.setState\_StartY() method
|
|
1747
|
-
|
|
1748
|
-
> 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.
|
|
1749
|
-
|
|
1750
|
-
Set the property state: start position Y
|
|
1751
|
-
|
|
1752
|
-
## Signature
|
|
1753
|
-
|
|
1754
|
-
```typescript
|
|
1755
|
-
function setState_StartY(startY: number): IPCB_PrimitiveArc;
|
|
1756
|
-
```
|
|
1757
|
-
|
|
1758
|
-
## Parameters
|
|
1759
|
-
|
|
1760
|
-
<table><thead><tr><th>
|
|
1761
|
-
|
|
1762
|
-
Parameter
|
|
1763
|
-
|
|
1764
|
-
</th><th>
|
|
1765
|
-
|
|
1766
|
-
Type
|
|
1767
|
-
|
|
1768
|
-
</th><th>
|
|
1769
|
-
|
|
1770
|
-
Description
|
|
1771
|
-
|
|
1772
|
-
</th></tr></thead>
|
|
1773
|
-
<tbody><tr><td>
|
|
1774
|
-
|
|
1775
|
-
startY
|
|
1776
|
-
|
|
1777
|
-
</td><td>
|
|
1778
|
-
|
|
1779
|
-
number
|
|
1780
|
-
|
|
1781
|
-
</td><td>
|
|
1782
|
-
|
|
1783
|
-
Start position Y
|
|
1784
|
-
|
|
1785
|
-
</td></tr>
|
|
1786
|
-
</tbody></table>
|
|
1787
|
-
|
|
1788
|
-
## Returns
|
|
1789
|
-
|
|
1790
|
-
[IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md)
|
|
1791
|
-
|
|
1792
|
-
Arc line primitive object
|
|
1793
|
-
|
|
1794
|
-
## Example
|
|
1795
|
-
|
|
1796
|
-
```javascript
|
|
1797
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试圆弧重合
|
|
1798
|
-
const x = 10000 + (Math.floor(Math.random() * 100000));
|
|
1799
|
-
const y = 2000 + (Math.floor(Math.random() * 100000));
|
|
1800
|
-
|
|
1801
|
-
// 2. 创建一段测试圆弧,起点 (x, y)
|
|
1802
|
-
const arc = await eda.pcb_PrimitiveArc.create('', 1, x, y, x + 500, y + 300, 90, 10, 1, false);
|
|
1803
|
-
|
|
1804
|
-
// 3. 读取修改前的起点 Y
|
|
1805
|
-
const before = arc.getState_StartY();
|
|
1806
|
-
|
|
1807
|
-
// 4. 切换异步模式并平移起点 Y(上移 300mil)
|
|
1808
|
-
const asyncArc = arc.toAsync();
|
|
1809
|
-
asyncArc.setState_StartY(y + 300);
|
|
1810
|
-
await asyncArc.done();
|
|
1811
|
-
|
|
1812
|
-
// 5. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1813
|
-
const refetched = await eda.pcb_PrimitiveArc.get(arc.getState_PrimitiveId());
|
|
1814
|
-
const after = refetched.getState_StartY();
|
|
1815
|
-
|
|
1816
|
-
console.log('startY:', before, '→', after);
|
|
1817
|
-
```
|
|
1818
|
-
|
|
1819
|
-
### toasync
|
|
1820
|
-
|
|
1821
|
-
# IPCB\_PrimitiveArc.toAsync() method
|
|
1822
|
-
|
|
1823
|
-
Convert Primitive to Async primitive
|
|
1824
|
-
|
|
1825
|
-
## Signature
|
|
1826
|
-
|
|
1827
|
-
```typescript
|
|
1828
|
-
function toAsync(): IPCB_PrimitiveArc;
|
|
1829
|
-
```
|
|
1830
|
-
|
|
1831
|
-
## Returns
|
|
1832
|
-
|
|
1833
|
-
[IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md)
|
|
1834
|
-
|
|
1835
|
-
Arc line primitive object
|
|
1836
|
-
|
|
1837
|
-
## Example
|
|
1838
|
-
|
|
1839
|
-
```javascript
|
|
1840
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试圆弧重合
|
|
1841
|
-
const x = 52000 + (Math.floor(Math.random() * 100000));
|
|
1842
|
-
const y = 2000 + (Math.floor(Math.random() * 100000));
|
|
1843
|
-
|
|
1844
|
-
// 2. 创建一段测试圆弧,切换到同步模式,让模式变化可观察
|
|
1845
|
-
const arc = await eda.pcb_PrimitiveArc.create('', 1, x, y, x + 500, y + 300, 90, 10, 1, false);
|
|
1846
|
-
arc.toSync();
|
|
1847
|
-
|
|
1848
|
-
// 3. 转换为异步图元
|
|
1849
|
-
const asyncArc = arc.toAsync();
|
|
1850
|
-
|
|
1851
|
-
// 4. 异步模式下累计修改并提交
|
|
1852
|
-
asyncArc.setState_LineWidth(24);
|
|
1853
|
-
await asyncArc.done();
|
|
1854
|
-
|
|
1855
|
-
// 5. 从画布重新读取,确认提交生效(保留现场供观察)
|
|
1856
|
-
const refetched = await eda.pcb_PrimitiveArc.get(arc.getState_PrimitiveId());
|
|
1857
|
-
|
|
1858
|
-
console.log('isAsync after toAsync:', arc.isAsync());
|
|
1859
|
-
console.log('lineWidth:', 10, '→', refetched.getState_LineWidth());
|
|
1860
|
-
```
|
|
1861
|
-
|
|
1862
|
-
### tosync
|
|
1863
|
-
|
|
1864
|
-
# IPCB\_PrimitiveArc.toSync() method
|
|
1865
|
-
|
|
1866
|
-
Convert Primitive to Sync primitive
|
|
1867
|
-
|
|
1868
|
-
## Signature
|
|
1869
|
-
|
|
1870
|
-
```typescript
|
|
1871
|
-
function toSync(): IPCB_PrimitiveArc;
|
|
1872
|
-
```
|
|
1873
|
-
|
|
1874
|
-
## Returns
|
|
1875
|
-
|
|
1876
|
-
[IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md)
|
|
1877
|
-
|
|
1878
|
-
Arc line primitive object
|
|
1879
|
-
|
|
1880
|
-
## Example
|
|
1881
|
-
|
|
1882
|
-
```javascript
|
|
1883
|
-
// 1. 生成本次运行专用的坐标,避免与之前保留的测试圆弧重合
|
|
1884
|
-
const x = 56000 + (Math.floor(Math.random() * 100000));
|
|
1885
|
-
const y = 2000 + (Math.floor(Math.random() * 100000));
|
|
1886
|
-
|
|
1887
|
-
// 2. 创建一段测试圆弧
|
|
1888
|
-
const arc = await eda.pcb_PrimitiveArc.create('', 1, x, y, x + 500, y + 300, 90, 10, 1, false);
|
|
1889
|
-
|
|
1890
|
-
// 3. 转换为同步图元
|
|
1891
|
-
const syncArc = arc.toSync();
|
|
1892
|
-
|
|
1893
|
-
// 4. 同步模式下修改线宽,立即生效(无需 done())
|
|
1894
|
-
syncArc.setState_LineWidth(40);
|
|
1895
|
-
|
|
1896
|
-
// 5. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1897
|
-
const refetched = await eda.pcb_PrimitiveArc.get(arc.getState_PrimitiveId());
|
|
1898
|
-
|
|
1899
|
-
console.log('isSync after toSync:', !syncArc.isAsync());
|
|
1900
|
-
console.log('lineWidth:', 10, '→', refetched.getState_LineWidth());
|
|
1901
|
-
```
|
|
1
|
+
# IPCB\_PrimitiveArc class
|
|
2
|
+
|
|
3
|
+
Arc line primitive
|
|
4
|
+
|
|
5
|
+
## Signature
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
class IPCB_PrimitiveArc implements IPCB_Primitive
|
|
9
|
+
```
|
|
10
|
+
**Implements:** [IPCB\_Primitive](../interfaces/IPCB_Primitive.md)
|
|
11
|
+
|
|
12
|
+
## Remarks
|
|
13
|
+
|
|
14
|
+
Both lines and arc lines are wires, corresponding to the line traces and arc traces on the canvas
|
|
15
|
+
|
|
16
|
+
## Methods
|
|
17
|
+
|
|
18
|
+
<table><thead><tr><th>
|
|
19
|
+
|
|
20
|
+
Method
|
|
21
|
+
|
|
22
|
+
</th><th>
|
|
23
|
+
|
|
24
|
+
Modifiers
|
|
25
|
+
|
|
26
|
+
</th><th>
|
|
27
|
+
|
|
28
|
+
Description
|
|
29
|
+
|
|
30
|
+
</th></tr></thead>
|
|
31
|
+
<tbody><tr><td>
|
|
32
|
+
|
|
33
|
+
[done()](./IPCB_PrimitiveArc.md)
|
|
34
|
+
|
|
35
|
+
</td><td>
|
|
36
|
+
|
|
37
|
+
</td><td>
|
|
38
|
+
|
|
39
|
+
**_(BETA)_** Apply the changes to the primitives to the canvas
|
|
40
|
+
|
|
41
|
+
</td></tr>
|
|
42
|
+
<tr><td>
|
|
43
|
+
|
|
44
|
+
[getAdjacentPrimitives()](./IPCB_PrimitiveArc.md)
|
|
45
|
+
|
|
46
|
+
</td><td>
|
|
47
|
+
|
|
48
|
+
</td><td>
|
|
49
|
+
|
|
50
|
+
**_(BETA)_** Get Adjacent primitive objects
|
|
51
|
+
|
|
52
|
+
</td></tr>
|
|
53
|
+
<tr><td>
|
|
54
|
+
|
|
55
|
+
[getEntireTrack(includeVias)](./IPCB_PrimitiveArc.md)
|
|
56
|
+
|
|
57
|
+
</td><td>
|
|
58
|
+
|
|
59
|
+
</td><td>
|
|
60
|
+
|
|
61
|
+
**_(BETA)_** Get the entire wire
|
|
62
|
+
|
|
63
|
+
</td></tr>
|
|
64
|
+
<tr><td>
|
|
65
|
+
|
|
66
|
+
[getEntireTrack(includeVias)](./IPCB_PrimitiveArc.md)
|
|
67
|
+
|
|
68
|
+
</td><td>
|
|
69
|
+
|
|
70
|
+
</td><td>
|
|
71
|
+
|
|
72
|
+
**_(BETA)_** Get the entire wire
|
|
73
|
+
|
|
74
|
+
</td></tr>
|
|
75
|
+
<tr><td>
|
|
76
|
+
|
|
77
|
+
[getState\_ArcAngle()](./IPCB_PrimitiveArc.md)
|
|
78
|
+
|
|
79
|
+
</td><td>
|
|
80
|
+
|
|
81
|
+
</td><td>
|
|
82
|
+
|
|
83
|
+
Get the property state: arc angle
|
|
84
|
+
|
|
85
|
+
</td></tr>
|
|
86
|
+
<tr><td>
|
|
87
|
+
|
|
88
|
+
[getState\_EndX()](./IPCB_PrimitiveArc.md)
|
|
89
|
+
|
|
90
|
+
</td><td>
|
|
91
|
+
|
|
92
|
+
</td><td>
|
|
93
|
+
|
|
94
|
+
Get the property state: end position X
|
|
95
|
+
|
|
96
|
+
</td></tr>
|
|
97
|
+
<tr><td>
|
|
98
|
+
|
|
99
|
+
[getState\_EndY()](./IPCB_PrimitiveArc.md)
|
|
100
|
+
|
|
101
|
+
</td><td>
|
|
102
|
+
|
|
103
|
+
</td><td>
|
|
104
|
+
|
|
105
|
+
Get the property state: end position Y
|
|
106
|
+
|
|
107
|
+
</td></tr>
|
|
108
|
+
<tr><td>
|
|
109
|
+
|
|
110
|
+
[getState\_InteractiveMode()](./IPCB_PrimitiveArc.md)
|
|
111
|
+
|
|
112
|
+
</td><td>
|
|
113
|
+
|
|
114
|
+
</td><td>
|
|
115
|
+
|
|
116
|
+
Get the property state: interaction mode
|
|
117
|
+
|
|
118
|
+
</td></tr>
|
|
119
|
+
<tr><td>
|
|
120
|
+
|
|
121
|
+
[getState\_Layer()](./IPCB_PrimitiveArc.md)
|
|
122
|
+
|
|
123
|
+
</td><td>
|
|
124
|
+
|
|
125
|
+
</td><td>
|
|
126
|
+
|
|
127
|
+
Get the property state: Layer
|
|
128
|
+
|
|
129
|
+
</td></tr>
|
|
130
|
+
<tr><td>
|
|
131
|
+
|
|
132
|
+
[getState\_LineWidth()](./IPCB_PrimitiveArc.md)
|
|
133
|
+
|
|
134
|
+
</td><td>
|
|
135
|
+
|
|
136
|
+
</td><td>
|
|
137
|
+
|
|
138
|
+
Get the property state: Line width
|
|
139
|
+
|
|
140
|
+
</td></tr>
|
|
141
|
+
<tr><td>
|
|
142
|
+
|
|
143
|
+
[getState\_Net()](./IPCB_PrimitiveArc.md)
|
|
144
|
+
|
|
145
|
+
</td><td>
|
|
146
|
+
|
|
147
|
+
</td><td>
|
|
148
|
+
|
|
149
|
+
Get the property state: net name
|
|
150
|
+
|
|
151
|
+
</td></tr>
|
|
152
|
+
<tr><td>
|
|
153
|
+
|
|
154
|
+
[getState\_PrimitiveId()](./IPCB_PrimitiveArc.md)
|
|
155
|
+
|
|
156
|
+
</td><td>
|
|
157
|
+
|
|
158
|
+
</td><td>
|
|
159
|
+
|
|
160
|
+
Get the property state: primitive ID
|
|
161
|
+
|
|
162
|
+
</td></tr>
|
|
163
|
+
<tr><td>
|
|
164
|
+
|
|
165
|
+
[getState\_PrimitiveLock()](./IPCB_PrimitiveArc.md)
|
|
166
|
+
|
|
167
|
+
</td><td>
|
|
168
|
+
|
|
169
|
+
</td><td>
|
|
170
|
+
|
|
171
|
+
Get the property state: whether it is locked
|
|
172
|
+
|
|
173
|
+
</td></tr>
|
|
174
|
+
<tr><td>
|
|
175
|
+
|
|
176
|
+
[getState\_PrimitiveType()](./IPCB_PrimitiveArc.md)
|
|
177
|
+
|
|
178
|
+
</td><td>
|
|
179
|
+
|
|
180
|
+
</td><td>
|
|
181
|
+
|
|
182
|
+
Get the property state: primitive type
|
|
183
|
+
|
|
184
|
+
</td></tr>
|
|
185
|
+
<tr><td>
|
|
186
|
+
|
|
187
|
+
[getState\_StartX()](./IPCB_PrimitiveArc.md)
|
|
188
|
+
|
|
189
|
+
</td><td>
|
|
190
|
+
|
|
191
|
+
</td><td>
|
|
192
|
+
|
|
193
|
+
Get the property state: start position X
|
|
194
|
+
|
|
195
|
+
</td></tr>
|
|
196
|
+
<tr><td>
|
|
197
|
+
|
|
198
|
+
[getState\_StartY()](./IPCB_PrimitiveArc.md)
|
|
199
|
+
|
|
200
|
+
</td><td>
|
|
201
|
+
|
|
202
|
+
</td><td>
|
|
203
|
+
|
|
204
|
+
Get the property state: start position Y
|
|
205
|
+
|
|
206
|
+
</td></tr>
|
|
207
|
+
<tr><td>
|
|
208
|
+
|
|
209
|
+
[isAsync()](./IPCB_PrimitiveArc.md)
|
|
210
|
+
|
|
211
|
+
</td><td>
|
|
212
|
+
|
|
213
|
+
</td><td>
|
|
214
|
+
|
|
215
|
+
Query whether the primitive is an async primitive
|
|
216
|
+
|
|
217
|
+
</td></tr>
|
|
218
|
+
<tr><td>
|
|
219
|
+
|
|
220
|
+
[reset()](./IPCB_PrimitiveArc.md)
|
|
221
|
+
|
|
222
|
+
</td><td>
|
|
223
|
+
|
|
224
|
+
</td><td>
|
|
225
|
+
|
|
226
|
+
**_(BETA)_** Reset the async primitive to the current canvas state
|
|
227
|
+
|
|
228
|
+
</td></tr>
|
|
229
|
+
<tr><td>
|
|
230
|
+
|
|
231
|
+
[setState\_ArcAngle(arcAngle)](./IPCB_PrimitiveArc.md)
|
|
232
|
+
|
|
233
|
+
</td><td>
|
|
234
|
+
|
|
235
|
+
</td><td>
|
|
236
|
+
|
|
237
|
+
**_(BETA)_** Set the property state: arc angle
|
|
238
|
+
|
|
239
|
+
</td></tr>
|
|
240
|
+
<tr><td>
|
|
241
|
+
|
|
242
|
+
[setState\_EndX(endX)](./IPCB_PrimitiveArc.md)
|
|
243
|
+
|
|
244
|
+
</td><td>
|
|
245
|
+
|
|
246
|
+
</td><td>
|
|
247
|
+
|
|
248
|
+
**_(BETA)_** Set the property state: end position X
|
|
249
|
+
|
|
250
|
+
</td></tr>
|
|
251
|
+
<tr><td>
|
|
252
|
+
|
|
253
|
+
[setState\_EndY(endY)](./IPCB_PrimitiveArc.md)
|
|
254
|
+
|
|
255
|
+
</td><td>
|
|
256
|
+
|
|
257
|
+
</td><td>
|
|
258
|
+
|
|
259
|
+
**_(BETA)_** Set the property state: end position Y
|
|
260
|
+
|
|
261
|
+
</td></tr>
|
|
262
|
+
<tr><td>
|
|
263
|
+
|
|
264
|
+
[setState\_InteractiveMode(interactiveMode)](./IPCB_PrimitiveArc.md)
|
|
265
|
+
|
|
266
|
+
</td><td>
|
|
267
|
+
|
|
268
|
+
</td><td>
|
|
269
|
+
|
|
270
|
+
**_(BETA)_** Set the property state: interaction mode
|
|
271
|
+
|
|
272
|
+
</td></tr>
|
|
273
|
+
<tr><td>
|
|
274
|
+
|
|
275
|
+
[setState\_Layer(layer)](./IPCB_PrimitiveArc.md)
|
|
276
|
+
|
|
277
|
+
</td><td>
|
|
278
|
+
|
|
279
|
+
</td><td>
|
|
280
|
+
|
|
281
|
+
**_(BETA)_** Set the property state: Layer
|
|
282
|
+
|
|
283
|
+
</td></tr>
|
|
284
|
+
<tr><td>
|
|
285
|
+
|
|
286
|
+
[setState\_LineWidth(lineWidth)](./IPCB_PrimitiveArc.md)
|
|
287
|
+
|
|
288
|
+
</td><td>
|
|
289
|
+
|
|
290
|
+
</td><td>
|
|
291
|
+
|
|
292
|
+
**_(BETA)_** Set the property state: Line width
|
|
293
|
+
|
|
294
|
+
</td></tr>
|
|
295
|
+
<tr><td>
|
|
296
|
+
|
|
297
|
+
[setState\_Net(net)](./IPCB_PrimitiveArc.md)
|
|
298
|
+
|
|
299
|
+
</td><td>
|
|
300
|
+
|
|
301
|
+
</td><td>
|
|
302
|
+
|
|
303
|
+
**_(BETA)_** Set the property state: net name
|
|
304
|
+
|
|
305
|
+
</td></tr>
|
|
306
|
+
<tr><td>
|
|
307
|
+
|
|
308
|
+
[setState\_PrimitiveLock(primitiveLock)](./IPCB_PrimitiveArc.md)
|
|
309
|
+
|
|
310
|
+
</td><td>
|
|
311
|
+
|
|
312
|
+
</td><td>
|
|
313
|
+
|
|
314
|
+
**_(BETA)_** Set the property state: whether it is locked
|
|
315
|
+
|
|
316
|
+
</td></tr>
|
|
317
|
+
<tr><td>
|
|
318
|
+
|
|
319
|
+
[setState\_StartX(startX)](./IPCB_PrimitiveArc.md)
|
|
320
|
+
|
|
321
|
+
</td><td>
|
|
322
|
+
|
|
323
|
+
</td><td>
|
|
324
|
+
|
|
325
|
+
**_(BETA)_** Set the property state: start position X
|
|
326
|
+
|
|
327
|
+
</td></tr>
|
|
328
|
+
<tr><td>
|
|
329
|
+
|
|
330
|
+
[setState\_StartY(startY)](./IPCB_PrimitiveArc.md)
|
|
331
|
+
|
|
332
|
+
</td><td>
|
|
333
|
+
|
|
334
|
+
</td><td>
|
|
335
|
+
|
|
336
|
+
**_(BETA)_** Set the property state: start position Y
|
|
337
|
+
|
|
338
|
+
</td></tr>
|
|
339
|
+
<tr><td>
|
|
340
|
+
|
|
341
|
+
[toAsync()](./IPCB_PrimitiveArc.md)
|
|
342
|
+
|
|
343
|
+
</td><td>
|
|
344
|
+
|
|
345
|
+
</td><td>
|
|
346
|
+
|
|
347
|
+
Convert Primitive to Async primitive
|
|
348
|
+
|
|
349
|
+
</td></tr>
|
|
350
|
+
<tr><td>
|
|
351
|
+
|
|
352
|
+
[toSync()](./IPCB_PrimitiveArc.md)
|
|
353
|
+
|
|
354
|
+
</td><td>
|
|
355
|
+
|
|
356
|
+
</td><td>
|
|
357
|
+
|
|
358
|
+
Convert Primitive to Sync primitive
|
|
359
|
+
|
|
360
|
+
</td></tr>
|
|
361
|
+
</tbody></table>
|
|
362
|
+
|
|
363
|
+
---
|
|
364
|
+
|
|
365
|
+
## 方法详情
|
|
366
|
+
|
|
367
|
+
### done
|
|
368
|
+
|
|
369
|
+
# IPCB\_PrimitiveArc.done() method
|
|
370
|
+
|
|
371
|
+
> 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.
|
|
372
|
+
|
|
373
|
+
Apply the changes to the primitives to the canvas
|
|
374
|
+
|
|
375
|
+
## Signature
|
|
376
|
+
|
|
377
|
+
```typescript
|
|
378
|
+
function done(): Promise<IPCB_PrimitiveArc>;
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
## Returns
|
|
382
|
+
|
|
383
|
+
Promise<[IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md)<!-- -->>
|
|
384
|
+
|
|
385
|
+
Arc line primitive object
|
|
386
|
+
|
|
387
|
+
## Example
|
|
388
|
+
|
|
389
|
+
```javascript
|
|
390
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试圆弧重合
|
|
391
|
+
const x = 42000 + (Math.floor(Math.random() * 100000));
|
|
392
|
+
const y = 2000 + (Math.floor(Math.random() * 100000));
|
|
393
|
+
|
|
394
|
+
// 2. 创建一段测试圆弧
|
|
395
|
+
const arc = await eda.pcb_PrimitiveArc.create('', 1, x, y, x + 500, y + 300, 90, 10, 1, false);
|
|
396
|
+
|
|
397
|
+
// 3. 切换异步模式,连续累计两处修改(线宽 + 换层)
|
|
398
|
+
const asyncArc = arc.toAsync();
|
|
399
|
+
asyncArc.setState_LineWidth(24);
|
|
400
|
+
asyncArc.setState_Layer(2);
|
|
401
|
+
|
|
402
|
+
// 4. 一次性提交到画布
|
|
403
|
+
await asyncArc.done();
|
|
404
|
+
|
|
405
|
+
// 5. 从画布重新读取,确认两处修改都已生效(保留现场供观察)
|
|
406
|
+
const refetched = await eda.pcb_PrimitiveArc.get(arc.getState_PrimitiveId());
|
|
407
|
+
|
|
408
|
+
console.log('lineWidth:', 10, '→', refetched.getState_LineWidth());
|
|
409
|
+
console.log('layer:', 1, '→', refetched.getState_Layer());
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
### getadjacentprimitives
|
|
413
|
+
|
|
414
|
+
# IPCB\_PrimitiveArc.getAdjacentPrimitives() method
|
|
415
|
+
|
|
416
|
+
> 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.
|
|
417
|
+
|
|
418
|
+
Get Adjacent primitive objects
|
|
419
|
+
|
|
420
|
+
## Signature
|
|
421
|
+
|
|
422
|
+
```typescript
|
|
423
|
+
function getAdjacentPrimitives(): Promise<
|
|
424
|
+
Array<IPCB_PrimitiveLine | IPCB_PrimitiveVia | IPCB_PrimitiveArc>
|
|
425
|
+
>;
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
## Returns
|
|
429
|
+
|
|
430
|
+
Promise<Array<[IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md) \| [IPCB\_PrimitiveVia](./IPCB_PrimitiveVia.md) \| [IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md)<!-- -->>>
|
|
431
|
+
|
|
432
|
+
Adjacent line, via, and arc-line primitive objects
|
|
433
|
+
|
|
434
|
+
## Remarks
|
|
435
|
+
|
|
436
|
+
It will get the line, via, and arc-line primitive objects directly connected to the arc line
|
|
437
|
+
|
|
438
|
+
## Example
|
|
439
|
+
|
|
440
|
+
```javascript
|
|
441
|
+
// 1. 创建一条直线走线,终点落在 (7500, 7000)
|
|
442
|
+
const line = await eda.pcb_PrimitiveLine.create('', 1, 7000, 7000, 7500, 7000, 10);
|
|
443
|
+
|
|
444
|
+
// 2. 创建一段圆弧,起点与直线终点重合,两段构成一整段导线
|
|
445
|
+
const arc = await eda.pcb_PrimitiveArc.create('', 1, 7500, 7000, 7800, 7300, 90, 10, 1, false);
|
|
446
|
+
|
|
447
|
+
// 3. 获取与圆弧直接相连的图元,并读出各自的类型
|
|
448
|
+
const adjacent = await arc.getAdjacentPrimitives();
|
|
449
|
+
|
|
450
|
+
// 4. 清理测试图元(查询类案例不留测试对象)
|
|
451
|
+
await eda.pcb_PrimitiveLine.delete([line]);
|
|
452
|
+
await eda.pcb_PrimitiveArc.delete([arc]);
|
|
453
|
+
|
|
454
|
+
console.log('adjacent count:', adjacent.length);
|
|
455
|
+
adjacent.forEach((p, i) => {
|
|
456
|
+
console.log(`adjacent[${i}] type:`, p.getState_PrimitiveType());
|
|
457
|
+
});
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
### getentiretrack
|
|
461
|
+
|
|
462
|
+
# IPCB\_PrimitiveArc.getEntireTrack() method
|
|
463
|
+
|
|
464
|
+
> 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.
|
|
465
|
+
|
|
466
|
+
Get the entire wire
|
|
467
|
+
|
|
468
|
+
## Signature
|
|
469
|
+
|
|
470
|
+
```typescript
|
|
471
|
+
function getEntireTrack(includeVias: false): Promise<Array<IPCB_PrimitiveLine | IPCB_PrimitiveArc>>;
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
## Parameters
|
|
475
|
+
|
|
476
|
+
<table><thead><tr><th>
|
|
477
|
+
|
|
478
|
+
Parameter
|
|
479
|
+
|
|
480
|
+
</th><th>
|
|
481
|
+
|
|
482
|
+
Type
|
|
483
|
+
|
|
484
|
+
</th><th>
|
|
485
|
+
|
|
486
|
+
Description
|
|
487
|
+
|
|
488
|
+
</th></tr></thead>
|
|
489
|
+
<tbody><tr><td>
|
|
490
|
+
|
|
491
|
+
includeVias
|
|
492
|
+
|
|
493
|
+
</td><td>
|
|
494
|
+
|
|
495
|
+
false
|
|
496
|
+
|
|
497
|
+
</td><td>
|
|
498
|
+
|
|
499
|
+
Whether to include the vias at both ends of the wire
|
|
500
|
+
|
|
501
|
+
</td></tr>
|
|
502
|
+
</tbody></table>
|
|
503
|
+
|
|
504
|
+
## Returns
|
|
505
|
+
|
|
506
|
+
Promise<Array<[IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md) \| [IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md)<!-- -->>>
|
|
507
|
+
|
|
508
|
+
All lines and arc lines in the entire wire
|
|
509
|
+
|
|
510
|
+
## Example
|
|
511
|
+
|
|
512
|
+
```javascript
|
|
513
|
+
// 1. 创建一条直线走线,终点落在 (7500, 7000)
|
|
514
|
+
const line = await eda.pcb_PrimitiveLine.create('', 1, 7000, 7000, 7500, 7000, 10);
|
|
515
|
+
|
|
516
|
+
// 2. 创建一段圆弧,起点与直线终点重合,两段构成一整段导线
|
|
517
|
+
const arc = await eda.pcb_PrimitiveArc.create('', 1, 7500, 7000, 7800, 7300, 90, 10, 1, false);
|
|
518
|
+
|
|
519
|
+
// 3. 只取导线内的直线和圆弧
|
|
520
|
+
const trackOnly = await arc.getEntireTrack(false);
|
|
521
|
+
|
|
522
|
+
// 4. 连两端过孔一起取(本例两端没有过孔,数量不变)
|
|
523
|
+
const trackWithVias = await arc.getEntireTrack(true);
|
|
524
|
+
|
|
525
|
+
// 5. 清理测试图元(查询类案例不留测试对象)
|
|
526
|
+
await eda.pcb_PrimitiveLine.delete([line]);
|
|
527
|
+
await eda.pcb_PrimitiveArc.delete([arc]);
|
|
528
|
+
|
|
529
|
+
console.log('track(false) count:', trackOnly.length);
|
|
530
|
+
trackOnly.forEach((p, i) => {
|
|
531
|
+
console.log(`track(false)[${i}] type:`, p.getState_PrimitiveType());
|
|
532
|
+
});
|
|
533
|
+
console.log('track(true) count:', trackWithVias.length);
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
### getentiretrack_1
|
|
537
|
+
|
|
538
|
+
# IPCB\_PrimitiveArc.getEntireTrack() method
|
|
539
|
+
|
|
540
|
+
> 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.
|
|
541
|
+
|
|
542
|
+
Get the entire wire
|
|
543
|
+
|
|
544
|
+
## Signature
|
|
545
|
+
|
|
546
|
+
```typescript
|
|
547
|
+
function getEntireTrack(
|
|
548
|
+
includeVias: true,
|
|
549
|
+
): Promise<Array<IPCB_PrimitiveLine | IPCB_PrimitiveArc | IPCB_PrimitiveVia>>;
|
|
550
|
+
```
|
|
551
|
+
|
|
552
|
+
## Parameters
|
|
553
|
+
|
|
554
|
+
<table><thead><tr><th>
|
|
555
|
+
|
|
556
|
+
Parameter
|
|
557
|
+
|
|
558
|
+
</th><th>
|
|
559
|
+
|
|
560
|
+
Type
|
|
561
|
+
|
|
562
|
+
</th><th>
|
|
563
|
+
|
|
564
|
+
Description
|
|
565
|
+
|
|
566
|
+
</th></tr></thead>
|
|
567
|
+
<tbody><tr><td>
|
|
568
|
+
|
|
569
|
+
includeVias
|
|
570
|
+
|
|
571
|
+
</td><td>
|
|
572
|
+
|
|
573
|
+
true
|
|
574
|
+
|
|
575
|
+
</td><td>
|
|
576
|
+
|
|
577
|
+
Whether to include the vias at both ends of the wire
|
|
578
|
+
|
|
579
|
+
</td></tr>
|
|
580
|
+
</tbody></table>
|
|
581
|
+
|
|
582
|
+
## Returns
|
|
583
|
+
|
|
584
|
+
Promise<Array<[IPCB\_PrimitiveLine](./IPCB_PrimitiveLine.md) \| [IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md) \| [IPCB\_PrimitiveVia](./IPCB_PrimitiveVia.md)<!-- -->>>
|
|
585
|
+
|
|
586
|
+
All lines and arc lines in the entire wire, as well as the vias connected at both ends (if any)
|
|
587
|
+
|
|
588
|
+
### getstate_arcangle
|
|
589
|
+
|
|
590
|
+
# IPCB\_PrimitiveArc.getState\_ArcAngle() method
|
|
591
|
+
|
|
592
|
+
Get the property state: arc angle
|
|
593
|
+
|
|
594
|
+
## Signature
|
|
595
|
+
|
|
596
|
+
```typescript
|
|
597
|
+
function getState_ArcAngle(): number;
|
|
598
|
+
```
|
|
599
|
+
|
|
600
|
+
## Returns
|
|
601
|
+
|
|
602
|
+
number
|
|
603
|
+
|
|
604
|
+
Arc angle
|
|
605
|
+
|
|
606
|
+
## Example
|
|
607
|
+
|
|
608
|
+
```javascript
|
|
609
|
+
// 1. 创建一段 90° 测试圆弧(PCB 坐标单位 mil)
|
|
610
|
+
const arc = await eda.pcb_PrimitiveArc.create('', 1, 1000, 1000, 1500, 1300, 90, 10, 1, false);
|
|
611
|
+
|
|
612
|
+
// 2. 读取圆弧角度
|
|
613
|
+
const arcAngle = arc.getState_ArcAngle();
|
|
614
|
+
|
|
615
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
616
|
+
await eda.pcb_PrimitiveArc.delete([arc.getState_PrimitiveId()]);
|
|
617
|
+
|
|
618
|
+
console.log('arcAngle:', arcAngle);
|
|
619
|
+
```
|
|
620
|
+
|
|
621
|
+
### getstate_endx
|
|
622
|
+
|
|
623
|
+
# IPCB\_PrimitiveArc.getState\_EndX() method
|
|
624
|
+
|
|
625
|
+
Get the property state: end position X
|
|
626
|
+
|
|
627
|
+
## Signature
|
|
628
|
+
|
|
629
|
+
```typescript
|
|
630
|
+
function getState_EndX(): number;
|
|
631
|
+
```
|
|
632
|
+
|
|
633
|
+
## Returns
|
|
634
|
+
|
|
635
|
+
number
|
|
636
|
+
|
|
637
|
+
End position X
|
|
638
|
+
|
|
639
|
+
## Example
|
|
640
|
+
|
|
641
|
+
```javascript
|
|
642
|
+
// 1. 创建一段测试圆弧,终点 (1500, 1300)(PCB 坐标单位 mil)
|
|
643
|
+
const arc = await eda.pcb_PrimitiveArc.create('', 1, 1000, 1000, 1500, 1300, 90, 10, 1, false);
|
|
644
|
+
|
|
645
|
+
// 2. 读取终止位置 X
|
|
646
|
+
const endX = arc.getState_EndX();
|
|
647
|
+
|
|
648
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
649
|
+
await eda.pcb_PrimitiveArc.delete([arc.getState_PrimitiveId()]);
|
|
650
|
+
|
|
651
|
+
console.log('endX:', endX);
|
|
652
|
+
```
|
|
653
|
+
|
|
654
|
+
### getstate_endy
|
|
655
|
+
|
|
656
|
+
# IPCB\_PrimitiveArc.getState\_EndY() method
|
|
657
|
+
|
|
658
|
+
Get the property state: end position Y
|
|
659
|
+
|
|
660
|
+
## Signature
|
|
661
|
+
|
|
662
|
+
```typescript
|
|
663
|
+
function getState_EndY(): number;
|
|
664
|
+
```
|
|
665
|
+
|
|
666
|
+
## Returns
|
|
667
|
+
|
|
668
|
+
number
|
|
669
|
+
|
|
670
|
+
End position Y
|
|
671
|
+
|
|
672
|
+
## Example
|
|
673
|
+
|
|
674
|
+
```javascript
|
|
675
|
+
// 1. 创建一段测试圆弧,终点 (1500, 1300)(PCB 坐标单位 mil)
|
|
676
|
+
const arc = await eda.pcb_PrimitiveArc.create('', 1, 1000, 1000, 1500, 1300, 90, 10, 1, false);
|
|
677
|
+
|
|
678
|
+
// 2. 读取终止位置 Y
|
|
679
|
+
const endY = arc.getState_EndY();
|
|
680
|
+
|
|
681
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
682
|
+
await eda.pcb_PrimitiveArc.delete([arc.getState_PrimitiveId()]);
|
|
683
|
+
|
|
684
|
+
console.log('endY:', endY);
|
|
685
|
+
```
|
|
686
|
+
|
|
687
|
+
### getstate_interactivemode
|
|
688
|
+
|
|
689
|
+
# IPCB\_PrimitiveArc.getState\_InteractiveMode() method
|
|
690
|
+
|
|
691
|
+
Get the property state: interaction mode
|
|
692
|
+
|
|
693
|
+
## Signature
|
|
694
|
+
|
|
695
|
+
```typescript
|
|
696
|
+
function getState_InteractiveMode(): EPCB_PrimitiveArcInteractiveMode;
|
|
697
|
+
```
|
|
698
|
+
|
|
699
|
+
## Returns
|
|
700
|
+
|
|
701
|
+
[EPCB\_PrimitiveArcInteractiveMode](../enums/EPCB_PrimitiveArcInteractiveMode.md)
|
|
702
|
+
|
|
703
|
+
Interaction mode
|
|
704
|
+
|
|
705
|
+
## Example
|
|
706
|
+
|
|
707
|
+
```javascript
|
|
708
|
+
// 1. 创建一段两点圆弧(交互模式 1)的测试圆弧
|
|
709
|
+
const arc = await eda.pcb_PrimitiveArc.create('', 1, 1000, 1000, 1500, 1300, 90, 10, 1, false);
|
|
710
|
+
|
|
711
|
+
// 2. 读取交互模式
|
|
712
|
+
const interactiveMode = arc.getState_InteractiveMode();
|
|
713
|
+
|
|
714
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
715
|
+
await eda.pcb_PrimitiveArc.delete([arc.getState_PrimitiveId()]);
|
|
716
|
+
|
|
717
|
+
console.log('interactiveMode:', interactiveMode);
|
|
718
|
+
```
|
|
719
|
+
|
|
720
|
+
### getstate_layer
|
|
721
|
+
|
|
722
|
+
# IPCB\_PrimitiveArc.getState\_Layer() method
|
|
723
|
+
|
|
724
|
+
Get the property state: Layer
|
|
725
|
+
|
|
726
|
+
## Signature
|
|
727
|
+
|
|
728
|
+
```typescript
|
|
729
|
+
function getState_Layer(): TPCB_LayersOfLine;
|
|
730
|
+
```
|
|
731
|
+
|
|
732
|
+
## Returns
|
|
733
|
+
|
|
734
|
+
[TPCB\_LayersOfLine](../types/TPCB_LayersOfLine.md)
|
|
735
|
+
|
|
736
|
+
Layer
|
|
737
|
+
|
|
738
|
+
## Example
|
|
739
|
+
|
|
740
|
+
```javascript
|
|
741
|
+
// 1. 创建一段顶层(1)测试圆弧
|
|
742
|
+
const arc = await eda.pcb_PrimitiveArc.create('', 1, 1000, 1000, 1500, 1300, 90, 10, 1, false);
|
|
743
|
+
|
|
744
|
+
// 2. 读取所在层
|
|
745
|
+
const layer = arc.getState_Layer();
|
|
746
|
+
|
|
747
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
748
|
+
await eda.pcb_PrimitiveArc.delete([arc.getState_PrimitiveId()]);
|
|
749
|
+
|
|
750
|
+
console.log('layer:', layer);
|
|
751
|
+
```
|
|
752
|
+
|
|
753
|
+
### getstate_linewidth
|
|
754
|
+
|
|
755
|
+
# IPCB\_PrimitiveArc.getState\_LineWidth() method
|
|
756
|
+
|
|
757
|
+
Get the property state: Line width
|
|
758
|
+
|
|
759
|
+
## Signature
|
|
760
|
+
|
|
761
|
+
```typescript
|
|
762
|
+
function getState_LineWidth(): number;
|
|
763
|
+
```
|
|
764
|
+
|
|
765
|
+
## Returns
|
|
766
|
+
|
|
767
|
+
number
|
|
768
|
+
|
|
769
|
+
Line width
|
|
770
|
+
|
|
771
|
+
## Example
|
|
772
|
+
|
|
773
|
+
```javascript
|
|
774
|
+
// 1. 创建一段 10mil 线宽的测试圆弧
|
|
775
|
+
const arc = await eda.pcb_PrimitiveArc.create('', 1, 1000, 1000, 1500, 1300, 90, 10, 1, false);
|
|
776
|
+
|
|
777
|
+
// 2. 读取线宽
|
|
778
|
+
const lineWidth = arc.getState_LineWidth();
|
|
779
|
+
|
|
780
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
781
|
+
await eda.pcb_PrimitiveArc.delete([arc.getState_PrimitiveId()]);
|
|
782
|
+
|
|
783
|
+
console.log('lineWidth:', lineWidth);
|
|
784
|
+
```
|
|
785
|
+
|
|
786
|
+
### getstate_net
|
|
787
|
+
|
|
788
|
+
# IPCB\_PrimitiveArc.getState\_Net() method
|
|
789
|
+
|
|
790
|
+
Get the property state: net name
|
|
791
|
+
|
|
792
|
+
## Signature
|
|
793
|
+
|
|
794
|
+
```typescript
|
|
795
|
+
function getState_Net(): string;
|
|
796
|
+
```
|
|
797
|
+
|
|
798
|
+
## Returns
|
|
799
|
+
|
|
800
|
+
string
|
|
801
|
+
|
|
802
|
+
Net name
|
|
803
|
+
|
|
804
|
+
## Example
|
|
805
|
+
|
|
806
|
+
```javascript
|
|
807
|
+
// 1. 创建一段指定网络的测试圆弧
|
|
808
|
+
const arc = await eda.pcb_PrimitiveArc.create('嘉立创示例_NET', 1, 1000, 1000, 1500, 1300, 90, 10, 1, false);
|
|
809
|
+
|
|
810
|
+
// 2. 读取网络名称
|
|
811
|
+
const net = arc.getState_Net();
|
|
812
|
+
|
|
813
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
814
|
+
await eda.pcb_PrimitiveArc.delete([arc.getState_PrimitiveId()]);
|
|
815
|
+
|
|
816
|
+
console.log('net:', net);
|
|
817
|
+
```
|
|
818
|
+
|
|
819
|
+
### getstate_primitiveid
|
|
820
|
+
|
|
821
|
+
# IPCB\_PrimitiveArc.getState\_PrimitiveId() method
|
|
822
|
+
|
|
823
|
+
Get the property state: primitive ID
|
|
824
|
+
|
|
825
|
+
## Signature
|
|
826
|
+
|
|
827
|
+
```typescript
|
|
828
|
+
function getState_PrimitiveId(): string;
|
|
829
|
+
```
|
|
830
|
+
|
|
831
|
+
## Returns
|
|
832
|
+
|
|
833
|
+
string
|
|
834
|
+
|
|
835
|
+
Primitive ID
|
|
836
|
+
|
|
837
|
+
## Example
|
|
838
|
+
|
|
839
|
+
```javascript
|
|
840
|
+
// 1. 创建一段测试圆弧
|
|
841
|
+
const arc = await eda.pcb_PrimitiveArc.create('', 1, 1000, 1000, 1500, 1300, 90, 10, 1, false);
|
|
842
|
+
|
|
843
|
+
// 2. 读取图元 ID
|
|
844
|
+
const primitiveId = arc.getState_PrimitiveId();
|
|
845
|
+
|
|
846
|
+
// 3. 用该 ID 从画布重新取回圆弧,验证 ID 有效
|
|
847
|
+
const refetched = await eda.pcb_PrimitiveArc.get(primitiveId);
|
|
848
|
+
|
|
849
|
+
// 4. 清理测试图元(查询类案例不留测试对象)
|
|
850
|
+
await eda.pcb_PrimitiveArc.delete([primitiveId]);
|
|
851
|
+
|
|
852
|
+
console.log('primitiveId:', primitiveId);
|
|
853
|
+
console.log('refetched type:', refetched.getState_PrimitiveType());
|
|
854
|
+
```
|
|
855
|
+
|
|
856
|
+
### getstate_primitivelock
|
|
857
|
+
|
|
858
|
+
# IPCB\_PrimitiveArc.getState\_PrimitiveLock() method
|
|
859
|
+
|
|
860
|
+
Get the property state: whether it is locked
|
|
861
|
+
|
|
862
|
+
## Signature
|
|
863
|
+
|
|
864
|
+
```typescript
|
|
865
|
+
function getState_PrimitiveLock(): boolean;
|
|
866
|
+
```
|
|
867
|
+
|
|
868
|
+
## Returns
|
|
869
|
+
|
|
870
|
+
boolean
|
|
871
|
+
|
|
872
|
+
Whether it is locked
|
|
873
|
+
|
|
874
|
+
## Example
|
|
875
|
+
|
|
876
|
+
```javascript
|
|
877
|
+
// 1. 创建一段测试圆弧(默认不锁定)
|
|
878
|
+
const arc = await eda.pcb_PrimitiveArc.create('', 1, 1000, 1000, 1500, 1300, 90, 10, 1, false);
|
|
879
|
+
|
|
880
|
+
// 2. 读取锁定状态
|
|
881
|
+
const locked = arc.getState_PrimitiveLock();
|
|
882
|
+
|
|
883
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
884
|
+
await eda.pcb_PrimitiveArc.delete([arc.getState_PrimitiveId()]);
|
|
885
|
+
|
|
886
|
+
console.log('locked:', locked);
|
|
887
|
+
```
|
|
888
|
+
|
|
889
|
+
### getstate_primitivetype
|
|
890
|
+
|
|
891
|
+
# IPCB\_PrimitiveArc.getState\_PrimitiveType() method
|
|
892
|
+
|
|
893
|
+
Get the property state: primitive type
|
|
894
|
+
|
|
895
|
+
## Signature
|
|
896
|
+
|
|
897
|
+
```typescript
|
|
898
|
+
function getState_PrimitiveType(): EPCB_PrimitiveType;
|
|
899
|
+
```
|
|
900
|
+
|
|
901
|
+
## Returns
|
|
902
|
+
|
|
903
|
+
[EPCB\_PrimitiveType](../enums/EPCB_PrimitiveType.md)
|
|
904
|
+
|
|
905
|
+
Primitive type
|
|
906
|
+
|
|
907
|
+
## Example
|
|
908
|
+
|
|
909
|
+
```javascript
|
|
910
|
+
// 1. 创建一段测试圆弧
|
|
911
|
+
const arc = await eda.pcb_PrimitiveArc.create('', 1, 1000, 1000, 1500, 1300, 90, 10, 1, false);
|
|
912
|
+
|
|
913
|
+
// 2. 读取图元类型
|
|
914
|
+
const type = arc.getState_PrimitiveType();
|
|
915
|
+
|
|
916
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
917
|
+
await eda.pcb_PrimitiveArc.delete([arc.getState_PrimitiveId()]);
|
|
918
|
+
|
|
919
|
+
console.log('type:', type);
|
|
920
|
+
```
|
|
921
|
+
|
|
922
|
+
### getstate_startx
|
|
923
|
+
|
|
924
|
+
# IPCB\_PrimitiveArc.getState\_StartX() method
|
|
925
|
+
|
|
926
|
+
Get the property state: start position X
|
|
927
|
+
|
|
928
|
+
## Signature
|
|
929
|
+
|
|
930
|
+
```typescript
|
|
931
|
+
function getState_StartX(): number;
|
|
932
|
+
```
|
|
933
|
+
|
|
934
|
+
## Returns
|
|
935
|
+
|
|
936
|
+
number
|
|
937
|
+
|
|
938
|
+
Start position X
|
|
939
|
+
|
|
940
|
+
## Example
|
|
941
|
+
|
|
942
|
+
```javascript
|
|
943
|
+
// 1. 创建一段测试圆弧,起点 (1000, 1000)(PCB 坐标单位 mil)
|
|
944
|
+
const arc = await eda.pcb_PrimitiveArc.create('', 1, 1000, 1000, 1500, 1300, 90, 10, 1, false);
|
|
945
|
+
|
|
946
|
+
// 2. 读取起始位置 X
|
|
947
|
+
const startX = arc.getState_StartX();
|
|
948
|
+
|
|
949
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
950
|
+
await eda.pcb_PrimitiveArc.delete([arc.getState_PrimitiveId()]);
|
|
951
|
+
|
|
952
|
+
console.log('startX:', startX);
|
|
953
|
+
```
|
|
954
|
+
|
|
955
|
+
### getstate_starty
|
|
956
|
+
|
|
957
|
+
# IPCB\_PrimitiveArc.getState\_StartY() method
|
|
958
|
+
|
|
959
|
+
Get the property state: start position Y
|
|
960
|
+
|
|
961
|
+
## Signature
|
|
962
|
+
|
|
963
|
+
```typescript
|
|
964
|
+
function getState_StartY(): number;
|
|
965
|
+
```
|
|
966
|
+
|
|
967
|
+
## Returns
|
|
968
|
+
|
|
969
|
+
number
|
|
970
|
+
|
|
971
|
+
Start position Y
|
|
972
|
+
|
|
973
|
+
## Example
|
|
974
|
+
|
|
975
|
+
```javascript
|
|
976
|
+
// 1. 创建一段测试圆弧,起点 (1000, 1000)(PCB 坐标单位 mil)
|
|
977
|
+
const arc = await eda.pcb_PrimitiveArc.create('', 1, 1000, 1000, 1500, 1300, 90, 10, 1, false);
|
|
978
|
+
|
|
979
|
+
// 2. 读取起始位置 Y
|
|
980
|
+
const startY = arc.getState_StartY();
|
|
981
|
+
|
|
982
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
983
|
+
await eda.pcb_PrimitiveArc.delete([arc.getState_PrimitiveId()]);
|
|
984
|
+
|
|
985
|
+
console.log('startY:', startY);
|
|
986
|
+
```
|
|
987
|
+
|
|
988
|
+
### isasync
|
|
989
|
+
|
|
990
|
+
# IPCB\_PrimitiveArc.isAsync() method
|
|
991
|
+
|
|
992
|
+
Query whether the primitive is an async primitive
|
|
993
|
+
|
|
994
|
+
## Signature
|
|
995
|
+
|
|
996
|
+
```typescript
|
|
997
|
+
function isAsync(): boolean;
|
|
998
|
+
```
|
|
999
|
+
|
|
1000
|
+
## Returns
|
|
1001
|
+
|
|
1002
|
+
boolean
|
|
1003
|
+
|
|
1004
|
+
Whether Is async primitive
|
|
1005
|
+
|
|
1006
|
+
## Example
|
|
1007
|
+
|
|
1008
|
+
```javascript
|
|
1009
|
+
// 1. 创建一段测试圆弧,创建后默认处于异步模式
|
|
1010
|
+
const arc = await eda.pcb_PrimitiveArc.create('', 1, 1000, 1000, 1500, 1300, 90, 10, 1, false);
|
|
1011
|
+
const asyncOnCreate = arc.isAsync();
|
|
1012
|
+
|
|
1013
|
+
// 2. 切换到同步模式再查询一次,对比两种模式
|
|
1014
|
+
arc.toSync();
|
|
1015
|
+
const asyncAfterToSync = arc.isAsync();
|
|
1016
|
+
|
|
1017
|
+
// 3. 清理测试图元(查询类案例不留测试对象)
|
|
1018
|
+
await eda.pcb_PrimitiveArc.delete([arc.getState_PrimitiveId()]);
|
|
1019
|
+
|
|
1020
|
+
console.log('isAsync on create:', asyncOnCreate);
|
|
1021
|
+
console.log('isAsync after toSync:', asyncAfterToSync);
|
|
1022
|
+
```
|
|
1023
|
+
|
|
1024
|
+
### reset
|
|
1025
|
+
|
|
1026
|
+
# IPCB\_PrimitiveArc.reset() method
|
|
1027
|
+
|
|
1028
|
+
> 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.
|
|
1029
|
+
|
|
1030
|
+
Reset the async primitive to the current canvas state
|
|
1031
|
+
|
|
1032
|
+
## Signature
|
|
1033
|
+
|
|
1034
|
+
```typescript
|
|
1035
|
+
function reset(): Promise<IPCB_PrimitiveArc>;
|
|
1036
|
+
```
|
|
1037
|
+
|
|
1038
|
+
## Returns
|
|
1039
|
+
|
|
1040
|
+
Promise<[IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md)<!-- -->>
|
|
1041
|
+
|
|
1042
|
+
Arc line primitive object
|
|
1043
|
+
|
|
1044
|
+
## Example
|
|
1045
|
+
|
|
1046
|
+
```javascript
|
|
1047
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试圆弧重合
|
|
1048
|
+
const x = 46000 + (Math.floor(Math.random() * 100000));
|
|
1049
|
+
const y = 2000 + (Math.floor(Math.random() * 100000));
|
|
1050
|
+
|
|
1051
|
+
// 2. 创建一段 10mil 线宽的测试圆弧
|
|
1052
|
+
const arc = await eda.pcb_PrimitiveArc.create('', 1, x, y, x + 500, y + 300, 90, 10, 1, false);
|
|
1053
|
+
|
|
1054
|
+
// 3. 切换异步模式,累计一处未提交的线宽修改(10 → 99)
|
|
1055
|
+
const asyncArc = arc.toAsync();
|
|
1056
|
+
asyncArc.setState_LineWidth(99);
|
|
1057
|
+
|
|
1058
|
+
// 4. 重置:丢弃未提交的修改,回到画布当前状态
|
|
1059
|
+
await asyncArc.reset();
|
|
1060
|
+
|
|
1061
|
+
// 5. 从画布重新读取,线宽仍是 10(保留现场供观察)
|
|
1062
|
+
const refetched = await eda.pcb_PrimitiveArc.get(arc.getState_PrimitiveId());
|
|
1063
|
+
|
|
1064
|
+
console.log('lineWidth after reset:', refetched.getState_LineWidth());
|
|
1065
|
+
```
|
|
1066
|
+
|
|
1067
|
+
### setstate_arcangle
|
|
1068
|
+
|
|
1069
|
+
# IPCB\_PrimitiveArc.setState\_ArcAngle() method
|
|
1070
|
+
|
|
1071
|
+
> 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.
|
|
1072
|
+
|
|
1073
|
+
Set the property state: arc angle
|
|
1074
|
+
|
|
1075
|
+
## Signature
|
|
1076
|
+
|
|
1077
|
+
```typescript
|
|
1078
|
+
function setState_ArcAngle(arcAngle: number): IPCB_PrimitiveArc;
|
|
1079
|
+
```
|
|
1080
|
+
|
|
1081
|
+
## Parameters
|
|
1082
|
+
|
|
1083
|
+
<table><thead><tr><th>
|
|
1084
|
+
|
|
1085
|
+
Parameter
|
|
1086
|
+
|
|
1087
|
+
</th><th>
|
|
1088
|
+
|
|
1089
|
+
Type
|
|
1090
|
+
|
|
1091
|
+
</th><th>
|
|
1092
|
+
|
|
1093
|
+
Description
|
|
1094
|
+
|
|
1095
|
+
</th></tr></thead>
|
|
1096
|
+
<tbody><tr><td>
|
|
1097
|
+
|
|
1098
|
+
arcAngle
|
|
1099
|
+
|
|
1100
|
+
</td><td>
|
|
1101
|
+
|
|
1102
|
+
number
|
|
1103
|
+
|
|
1104
|
+
</td><td>
|
|
1105
|
+
|
|
1106
|
+
Arc angle
|
|
1107
|
+
|
|
1108
|
+
</td></tr>
|
|
1109
|
+
</tbody></table>
|
|
1110
|
+
|
|
1111
|
+
## Returns
|
|
1112
|
+
|
|
1113
|
+
[IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md)
|
|
1114
|
+
|
|
1115
|
+
Arc line primitive object
|
|
1116
|
+
|
|
1117
|
+
## Example
|
|
1118
|
+
|
|
1119
|
+
```javascript
|
|
1120
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试圆弧重合
|
|
1121
|
+
const x = 2000 + (Math.floor(Math.random() * 100000));
|
|
1122
|
+
const y = 2000 + (Math.floor(Math.random() * 100000));
|
|
1123
|
+
|
|
1124
|
+
// 2. 创建一段 90° 测试圆弧(PCB 坐标单位 mil,跨度 500×300)
|
|
1125
|
+
const arc = await eda.pcb_PrimitiveArc.create('', 1, x, y, x + 500, y + 300, 90, 10, 1, false);
|
|
1126
|
+
|
|
1127
|
+
// 3. 读取修改前的角度
|
|
1128
|
+
const before = arc.getState_ArcAngle();
|
|
1129
|
+
|
|
1130
|
+
// 4. 切换异步模式并修改角度(90° → 45°)
|
|
1131
|
+
const asyncArc = arc.toAsync();
|
|
1132
|
+
asyncArc.setState_ArcAngle(45);
|
|
1133
|
+
await asyncArc.done();
|
|
1134
|
+
|
|
1135
|
+
// 5. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1136
|
+
const refetched = await eda.pcb_PrimitiveArc.get(arc.getState_PrimitiveId());
|
|
1137
|
+
const after = refetched.getState_ArcAngle();
|
|
1138
|
+
|
|
1139
|
+
console.log('arcAngle:', before, '→', after);
|
|
1140
|
+
```
|
|
1141
|
+
|
|
1142
|
+
### setstate_endx
|
|
1143
|
+
|
|
1144
|
+
# IPCB\_PrimitiveArc.setState\_EndX() method
|
|
1145
|
+
|
|
1146
|
+
> 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.
|
|
1147
|
+
|
|
1148
|
+
Set the property state: end position X
|
|
1149
|
+
|
|
1150
|
+
## Signature
|
|
1151
|
+
|
|
1152
|
+
```typescript
|
|
1153
|
+
function setState_EndX(endX: number): IPCB_PrimitiveArc;
|
|
1154
|
+
```
|
|
1155
|
+
|
|
1156
|
+
## Parameters
|
|
1157
|
+
|
|
1158
|
+
<table><thead><tr><th>
|
|
1159
|
+
|
|
1160
|
+
Parameter
|
|
1161
|
+
|
|
1162
|
+
</th><th>
|
|
1163
|
+
|
|
1164
|
+
Type
|
|
1165
|
+
|
|
1166
|
+
</th><th>
|
|
1167
|
+
|
|
1168
|
+
Description
|
|
1169
|
+
|
|
1170
|
+
</th></tr></thead>
|
|
1171
|
+
<tbody><tr><td>
|
|
1172
|
+
|
|
1173
|
+
endX
|
|
1174
|
+
|
|
1175
|
+
</td><td>
|
|
1176
|
+
|
|
1177
|
+
number
|
|
1178
|
+
|
|
1179
|
+
</td><td>
|
|
1180
|
+
|
|
1181
|
+
End position X
|
|
1182
|
+
|
|
1183
|
+
</td></tr>
|
|
1184
|
+
</tbody></table>
|
|
1185
|
+
|
|
1186
|
+
## Returns
|
|
1187
|
+
|
|
1188
|
+
[IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md)
|
|
1189
|
+
|
|
1190
|
+
Arc line primitive object
|
|
1191
|
+
|
|
1192
|
+
## Example
|
|
1193
|
+
|
|
1194
|
+
```javascript
|
|
1195
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试圆弧重合
|
|
1196
|
+
const x = 14000 + (Math.floor(Math.random() * 100000));
|
|
1197
|
+
const y = 2000 + (Math.floor(Math.random() * 100000));
|
|
1198
|
+
|
|
1199
|
+
// 2. 创建一段测试圆弧,终点 (x+500, y+300)
|
|
1200
|
+
const arc = await eda.pcb_PrimitiveArc.create('', 1, x, y, x + 500, y + 300, 90, 10, 1, false);
|
|
1201
|
+
|
|
1202
|
+
// 3. 读取修改前的终点 X
|
|
1203
|
+
const before = arc.getState_EndX();
|
|
1204
|
+
|
|
1205
|
+
// 4. 切换异步模式并平移终点 X(右移 300mil)
|
|
1206
|
+
const asyncArc = arc.toAsync();
|
|
1207
|
+
asyncArc.setState_EndX(x + 800);
|
|
1208
|
+
await asyncArc.done();
|
|
1209
|
+
|
|
1210
|
+
// 5. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1211
|
+
const refetched = await eda.pcb_PrimitiveArc.get(arc.getState_PrimitiveId());
|
|
1212
|
+
const after = refetched.getState_EndX();
|
|
1213
|
+
|
|
1214
|
+
console.log('endX:', before, '→', after);
|
|
1215
|
+
```
|
|
1216
|
+
|
|
1217
|
+
### setstate_endy
|
|
1218
|
+
|
|
1219
|
+
# IPCB\_PrimitiveArc.setState\_EndY() method
|
|
1220
|
+
|
|
1221
|
+
> 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.
|
|
1222
|
+
|
|
1223
|
+
Set the property state: end position Y
|
|
1224
|
+
|
|
1225
|
+
## Signature
|
|
1226
|
+
|
|
1227
|
+
```typescript
|
|
1228
|
+
function setState_EndY(endY: number): IPCB_PrimitiveArc;
|
|
1229
|
+
```
|
|
1230
|
+
|
|
1231
|
+
## Parameters
|
|
1232
|
+
|
|
1233
|
+
<table><thead><tr><th>
|
|
1234
|
+
|
|
1235
|
+
Parameter
|
|
1236
|
+
|
|
1237
|
+
</th><th>
|
|
1238
|
+
|
|
1239
|
+
Type
|
|
1240
|
+
|
|
1241
|
+
</th><th>
|
|
1242
|
+
|
|
1243
|
+
Description
|
|
1244
|
+
|
|
1245
|
+
</th></tr></thead>
|
|
1246
|
+
<tbody><tr><td>
|
|
1247
|
+
|
|
1248
|
+
endY
|
|
1249
|
+
|
|
1250
|
+
</td><td>
|
|
1251
|
+
|
|
1252
|
+
number
|
|
1253
|
+
|
|
1254
|
+
</td><td>
|
|
1255
|
+
|
|
1256
|
+
End position Y
|
|
1257
|
+
|
|
1258
|
+
</td></tr>
|
|
1259
|
+
</tbody></table>
|
|
1260
|
+
|
|
1261
|
+
## Returns
|
|
1262
|
+
|
|
1263
|
+
[IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md)
|
|
1264
|
+
|
|
1265
|
+
Arc line primitive object
|
|
1266
|
+
|
|
1267
|
+
## Example
|
|
1268
|
+
|
|
1269
|
+
```javascript
|
|
1270
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试圆弧重合
|
|
1271
|
+
const x = 18000 + (Math.floor(Math.random() * 100000));
|
|
1272
|
+
const y = 2000 + (Math.floor(Math.random() * 100000));
|
|
1273
|
+
|
|
1274
|
+
// 2. 创建一段测试圆弧,终点 (x+500, y+300)
|
|
1275
|
+
const arc = await eda.pcb_PrimitiveArc.create('', 1, x, y, x + 500, y + 300, 90, 10, 1, false);
|
|
1276
|
+
|
|
1277
|
+
// 3. 读取修改前的终点 Y
|
|
1278
|
+
const before = arc.getState_EndY();
|
|
1279
|
+
|
|
1280
|
+
// 4. 切换异步模式并平移终点 Y(上移 300mil)
|
|
1281
|
+
const asyncArc = arc.toAsync();
|
|
1282
|
+
asyncArc.setState_EndY(y + 600);
|
|
1283
|
+
await asyncArc.done();
|
|
1284
|
+
|
|
1285
|
+
// 5. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1286
|
+
const refetched = await eda.pcb_PrimitiveArc.get(arc.getState_PrimitiveId());
|
|
1287
|
+
const after = refetched.getState_EndY();
|
|
1288
|
+
|
|
1289
|
+
console.log('endY:', before, '→', after);
|
|
1290
|
+
```
|
|
1291
|
+
|
|
1292
|
+
### setstate_interactivemode
|
|
1293
|
+
|
|
1294
|
+
# IPCB\_PrimitiveArc.setState\_InteractiveMode() method
|
|
1295
|
+
|
|
1296
|
+
> 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.
|
|
1297
|
+
|
|
1298
|
+
Set the property state: interaction mode
|
|
1299
|
+
|
|
1300
|
+
## Signature
|
|
1301
|
+
|
|
1302
|
+
```typescript
|
|
1303
|
+
function setState_InteractiveMode(
|
|
1304
|
+
interactiveMode: EPCB_PrimitiveArcInteractiveMode,
|
|
1305
|
+
): IPCB_PrimitiveArc;
|
|
1306
|
+
```
|
|
1307
|
+
|
|
1308
|
+
## Parameters
|
|
1309
|
+
|
|
1310
|
+
<table><thead><tr><th>
|
|
1311
|
+
|
|
1312
|
+
Parameter
|
|
1313
|
+
|
|
1314
|
+
</th><th>
|
|
1315
|
+
|
|
1316
|
+
Type
|
|
1317
|
+
|
|
1318
|
+
</th><th>
|
|
1319
|
+
|
|
1320
|
+
Description
|
|
1321
|
+
|
|
1322
|
+
</th></tr></thead>
|
|
1323
|
+
<tbody><tr><td>
|
|
1324
|
+
|
|
1325
|
+
interactiveMode
|
|
1326
|
+
|
|
1327
|
+
</td><td>
|
|
1328
|
+
|
|
1329
|
+
[EPCB\_PrimitiveArcInteractiveMode](../enums/EPCB_PrimitiveArcInteractiveMode.md)
|
|
1330
|
+
|
|
1331
|
+
</td><td>
|
|
1332
|
+
|
|
1333
|
+
Interaction mode
|
|
1334
|
+
|
|
1335
|
+
</td></tr>
|
|
1336
|
+
</tbody></table>
|
|
1337
|
+
|
|
1338
|
+
## Returns
|
|
1339
|
+
|
|
1340
|
+
[IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md)
|
|
1341
|
+
|
|
1342
|
+
Arc line primitive object
|
|
1343
|
+
|
|
1344
|
+
## Example
|
|
1345
|
+
|
|
1346
|
+
```javascript
|
|
1347
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试圆弧重合
|
|
1348
|
+
const x = 38000 + (Math.floor(Math.random() * 100000));
|
|
1349
|
+
const y = 2000 + (Math.floor(Math.random() * 100000));
|
|
1350
|
+
|
|
1351
|
+
// 2. 创建一段两点圆弧(交互模式 1)测试圆弧
|
|
1352
|
+
const arc = await eda.pcb_PrimitiveArc.create('', 1, x, y, x + 500, y + 300, 90, 10, 1, false);
|
|
1353
|
+
|
|
1354
|
+
// 3. 读取修改前的交互模式
|
|
1355
|
+
const before = arc.getState_InteractiveMode();
|
|
1356
|
+
|
|
1357
|
+
// 4. 切换异步模式并改为中心圆弧(1 → 2)
|
|
1358
|
+
const asyncArc = arc.toAsync();
|
|
1359
|
+
asyncArc.setState_InteractiveMode(2);
|
|
1360
|
+
await asyncArc.done();
|
|
1361
|
+
|
|
1362
|
+
// 5. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1363
|
+
const refetched = await eda.pcb_PrimitiveArc.get(arc.getState_PrimitiveId());
|
|
1364
|
+
const after = refetched.getState_InteractiveMode();
|
|
1365
|
+
|
|
1366
|
+
console.log('interactiveMode:', before, '→', after);
|
|
1367
|
+
```
|
|
1368
|
+
|
|
1369
|
+
### setstate_layer
|
|
1370
|
+
|
|
1371
|
+
# IPCB\_PrimitiveArc.setState\_Layer() method
|
|
1372
|
+
|
|
1373
|
+
> 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.
|
|
1374
|
+
|
|
1375
|
+
Set the property state: Layer
|
|
1376
|
+
|
|
1377
|
+
## Signature
|
|
1378
|
+
|
|
1379
|
+
```typescript
|
|
1380
|
+
function setState_Layer(layer: TPCB_LayersOfLine): IPCB_PrimitiveArc;
|
|
1381
|
+
```
|
|
1382
|
+
|
|
1383
|
+
## Parameters
|
|
1384
|
+
|
|
1385
|
+
<table><thead><tr><th>
|
|
1386
|
+
|
|
1387
|
+
Parameter
|
|
1388
|
+
|
|
1389
|
+
</th><th>
|
|
1390
|
+
|
|
1391
|
+
Type
|
|
1392
|
+
|
|
1393
|
+
</th><th>
|
|
1394
|
+
|
|
1395
|
+
Description
|
|
1396
|
+
|
|
1397
|
+
</th></tr></thead>
|
|
1398
|
+
<tbody><tr><td>
|
|
1399
|
+
|
|
1400
|
+
layer
|
|
1401
|
+
|
|
1402
|
+
</td><td>
|
|
1403
|
+
|
|
1404
|
+
[TPCB\_LayersOfLine](../types/TPCB_LayersOfLine.md)
|
|
1405
|
+
|
|
1406
|
+
</td><td>
|
|
1407
|
+
|
|
1408
|
+
Layer
|
|
1409
|
+
|
|
1410
|
+
</td></tr>
|
|
1411
|
+
</tbody></table>
|
|
1412
|
+
|
|
1413
|
+
## Returns
|
|
1414
|
+
|
|
1415
|
+
[IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md)
|
|
1416
|
+
|
|
1417
|
+
Arc line primitive object
|
|
1418
|
+
|
|
1419
|
+
## Example
|
|
1420
|
+
|
|
1421
|
+
```javascript
|
|
1422
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试圆弧重合
|
|
1423
|
+
const x = 22000 + (Math.floor(Math.random() * 100000));
|
|
1424
|
+
const y = 2000 + (Math.floor(Math.random() * 100000));
|
|
1425
|
+
|
|
1426
|
+
// 2. 创建一段顶层(1)测试圆弧
|
|
1427
|
+
const arc = await eda.pcb_PrimitiveArc.create('', 1, x, y, x + 500, y + 300, 90, 10, 1, false);
|
|
1428
|
+
|
|
1429
|
+
// 3. 读取修改前的层
|
|
1430
|
+
const before = arc.getState_Layer();
|
|
1431
|
+
|
|
1432
|
+
// 4. 切换异步模式并换层(顶层 1 → 底层 2)
|
|
1433
|
+
const asyncArc = arc.toAsync();
|
|
1434
|
+
asyncArc.setState_Layer(2);
|
|
1435
|
+
await asyncArc.done();
|
|
1436
|
+
|
|
1437
|
+
// 5. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1438
|
+
const refetched = await eda.pcb_PrimitiveArc.get(arc.getState_PrimitiveId());
|
|
1439
|
+
const after = refetched.getState_Layer();
|
|
1440
|
+
|
|
1441
|
+
console.log('layer:', before, '→', after);
|
|
1442
|
+
```
|
|
1443
|
+
|
|
1444
|
+
### setstate_linewidth
|
|
1445
|
+
|
|
1446
|
+
# IPCB\_PrimitiveArc.setState\_LineWidth() method
|
|
1447
|
+
|
|
1448
|
+
> 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.
|
|
1449
|
+
|
|
1450
|
+
Set the property state: Line width
|
|
1451
|
+
|
|
1452
|
+
## Signature
|
|
1453
|
+
|
|
1454
|
+
```typescript
|
|
1455
|
+
function setState_LineWidth(lineWidth: number): IPCB_PrimitiveArc;
|
|
1456
|
+
```
|
|
1457
|
+
|
|
1458
|
+
## Parameters
|
|
1459
|
+
|
|
1460
|
+
<table><thead><tr><th>
|
|
1461
|
+
|
|
1462
|
+
Parameter
|
|
1463
|
+
|
|
1464
|
+
</th><th>
|
|
1465
|
+
|
|
1466
|
+
Type
|
|
1467
|
+
|
|
1468
|
+
</th><th>
|
|
1469
|
+
|
|
1470
|
+
Description
|
|
1471
|
+
|
|
1472
|
+
</th></tr></thead>
|
|
1473
|
+
<tbody><tr><td>
|
|
1474
|
+
|
|
1475
|
+
lineWidth
|
|
1476
|
+
|
|
1477
|
+
</td><td>
|
|
1478
|
+
|
|
1479
|
+
number
|
|
1480
|
+
|
|
1481
|
+
</td><td>
|
|
1482
|
+
|
|
1483
|
+
Line width
|
|
1484
|
+
|
|
1485
|
+
</td></tr>
|
|
1486
|
+
</tbody></table>
|
|
1487
|
+
|
|
1488
|
+
## Returns
|
|
1489
|
+
|
|
1490
|
+
[IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md)
|
|
1491
|
+
|
|
1492
|
+
Arc line primitive object
|
|
1493
|
+
|
|
1494
|
+
## Example
|
|
1495
|
+
|
|
1496
|
+
```javascript
|
|
1497
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试圆弧重合
|
|
1498
|
+
const x = 26000 + (Math.floor(Math.random() * 100000));
|
|
1499
|
+
const y = 2000 + (Math.floor(Math.random() * 100000));
|
|
1500
|
+
|
|
1501
|
+
// 2. 创建一段 10mil 线宽的测试圆弧
|
|
1502
|
+
const arc = await eda.pcb_PrimitiveArc.create('', 1, x, y, x + 500, y + 300, 90, 10, 1, false);
|
|
1503
|
+
|
|
1504
|
+
// 3. 读取修改前的线宽
|
|
1505
|
+
const before = arc.getState_LineWidth();
|
|
1506
|
+
|
|
1507
|
+
// 4. 切换异步模式并加宽(10 → 24)
|
|
1508
|
+
const asyncArc = arc.toAsync();
|
|
1509
|
+
asyncArc.setState_LineWidth(24);
|
|
1510
|
+
await asyncArc.done();
|
|
1511
|
+
|
|
1512
|
+
// 5. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1513
|
+
const refetched = await eda.pcb_PrimitiveArc.get(arc.getState_PrimitiveId());
|
|
1514
|
+
const after = refetched.getState_LineWidth();
|
|
1515
|
+
|
|
1516
|
+
console.log('lineWidth:', before, '→', after);
|
|
1517
|
+
```
|
|
1518
|
+
|
|
1519
|
+
### setstate_net
|
|
1520
|
+
|
|
1521
|
+
# IPCB\_PrimitiveArc.setState\_Net() method
|
|
1522
|
+
|
|
1523
|
+
> 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.
|
|
1524
|
+
|
|
1525
|
+
Set the property state: net name
|
|
1526
|
+
|
|
1527
|
+
## Signature
|
|
1528
|
+
|
|
1529
|
+
```typescript
|
|
1530
|
+
function setState_Net(net: string): IPCB_PrimitiveArc;
|
|
1531
|
+
```
|
|
1532
|
+
|
|
1533
|
+
## Parameters
|
|
1534
|
+
|
|
1535
|
+
<table><thead><tr><th>
|
|
1536
|
+
|
|
1537
|
+
Parameter
|
|
1538
|
+
|
|
1539
|
+
</th><th>
|
|
1540
|
+
|
|
1541
|
+
Type
|
|
1542
|
+
|
|
1543
|
+
</th><th>
|
|
1544
|
+
|
|
1545
|
+
Description
|
|
1546
|
+
|
|
1547
|
+
</th></tr></thead>
|
|
1548
|
+
<tbody><tr><td>
|
|
1549
|
+
|
|
1550
|
+
net
|
|
1551
|
+
|
|
1552
|
+
</td><td>
|
|
1553
|
+
|
|
1554
|
+
string
|
|
1555
|
+
|
|
1556
|
+
</td><td>
|
|
1557
|
+
|
|
1558
|
+
Net name
|
|
1559
|
+
|
|
1560
|
+
</td></tr>
|
|
1561
|
+
</tbody></table>
|
|
1562
|
+
|
|
1563
|
+
## Returns
|
|
1564
|
+
|
|
1565
|
+
[IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md)
|
|
1566
|
+
|
|
1567
|
+
Arc line primitive object
|
|
1568
|
+
|
|
1569
|
+
## Example
|
|
1570
|
+
|
|
1571
|
+
```javascript
|
|
1572
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试圆弧重合
|
|
1573
|
+
const x = 30000 + (Math.floor(Math.random() * 100000));
|
|
1574
|
+
const y = 2000 + (Math.floor(Math.random() * 100000));
|
|
1575
|
+
|
|
1576
|
+
// 2. 创建一段无网络的测试圆弧
|
|
1577
|
+
const arc = await eda.pcb_PrimitiveArc.create('', 1, x, y, x + 500, y + 300, 90, 10, 1, false);
|
|
1578
|
+
|
|
1579
|
+
// 3. 读取修改前的网络名称
|
|
1580
|
+
const before = arc.getState_Net();
|
|
1581
|
+
|
|
1582
|
+
// 4. 切换异步模式并指定网络('' → '嘉立创示例_NET')
|
|
1583
|
+
const asyncArc = arc.toAsync();
|
|
1584
|
+
asyncArc.setState_Net('嘉立创示例_NET');
|
|
1585
|
+
await asyncArc.done();
|
|
1586
|
+
|
|
1587
|
+
// 5. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1588
|
+
const refetched = await eda.pcb_PrimitiveArc.get(arc.getState_PrimitiveId());
|
|
1589
|
+
const after = refetched.getState_Net();
|
|
1590
|
+
|
|
1591
|
+
console.log('net:', before, '→', after);
|
|
1592
|
+
```
|
|
1593
|
+
|
|
1594
|
+
### setstate_primitivelock
|
|
1595
|
+
|
|
1596
|
+
# IPCB\_PrimitiveArc.setState\_PrimitiveLock() method
|
|
1597
|
+
|
|
1598
|
+
> 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.
|
|
1599
|
+
|
|
1600
|
+
Set the property state: whether it is locked
|
|
1601
|
+
|
|
1602
|
+
## Signature
|
|
1603
|
+
|
|
1604
|
+
```typescript
|
|
1605
|
+
function setState_PrimitiveLock(primitiveLock: boolean): IPCB_PrimitiveArc;
|
|
1606
|
+
```
|
|
1607
|
+
|
|
1608
|
+
## Parameters
|
|
1609
|
+
|
|
1610
|
+
<table><thead><tr><th>
|
|
1611
|
+
|
|
1612
|
+
Parameter
|
|
1613
|
+
|
|
1614
|
+
</th><th>
|
|
1615
|
+
|
|
1616
|
+
Type
|
|
1617
|
+
|
|
1618
|
+
</th><th>
|
|
1619
|
+
|
|
1620
|
+
Description
|
|
1621
|
+
|
|
1622
|
+
</th></tr></thead>
|
|
1623
|
+
<tbody><tr><td>
|
|
1624
|
+
|
|
1625
|
+
primitiveLock
|
|
1626
|
+
|
|
1627
|
+
</td><td>
|
|
1628
|
+
|
|
1629
|
+
boolean
|
|
1630
|
+
|
|
1631
|
+
</td><td>
|
|
1632
|
+
|
|
1633
|
+
Whether it is locked
|
|
1634
|
+
|
|
1635
|
+
</td></tr>
|
|
1636
|
+
</tbody></table>
|
|
1637
|
+
|
|
1638
|
+
## Returns
|
|
1639
|
+
|
|
1640
|
+
[IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md)
|
|
1641
|
+
|
|
1642
|
+
Arc line primitive object
|
|
1643
|
+
|
|
1644
|
+
## Example
|
|
1645
|
+
|
|
1646
|
+
```javascript
|
|
1647
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试圆弧重合
|
|
1648
|
+
const x = 34000 + (Math.floor(Math.random() * 100000));
|
|
1649
|
+
const y = 2000 + (Math.floor(Math.random() * 100000));
|
|
1650
|
+
|
|
1651
|
+
// 2. 创建一段测试圆弧(默认不锁定)
|
|
1652
|
+
const arc = await eda.pcb_PrimitiveArc.create('', 1, x, y, x + 500, y + 300, 90, 10, 1, false);
|
|
1653
|
+
|
|
1654
|
+
// 3. 读取修改前的锁定状态
|
|
1655
|
+
const before = arc.getState_PrimitiveLock();
|
|
1656
|
+
|
|
1657
|
+
// 4. 切换异步模式并锁定(false → true)
|
|
1658
|
+
const asyncArc = arc.toAsync();
|
|
1659
|
+
asyncArc.setState_PrimitiveLock(true);
|
|
1660
|
+
await asyncArc.done();
|
|
1661
|
+
|
|
1662
|
+
// 5. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1663
|
+
const refetched = await eda.pcb_PrimitiveArc.get(arc.getState_PrimitiveId());
|
|
1664
|
+
const after = refetched.getState_PrimitiveLock();
|
|
1665
|
+
|
|
1666
|
+
console.log('locked:', before, '→', after);
|
|
1667
|
+
```
|
|
1668
|
+
|
|
1669
|
+
### setstate_startx
|
|
1670
|
+
|
|
1671
|
+
# IPCB\_PrimitiveArc.setState\_StartX() method
|
|
1672
|
+
|
|
1673
|
+
> 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.
|
|
1674
|
+
|
|
1675
|
+
Set the property state: start position X
|
|
1676
|
+
|
|
1677
|
+
## Signature
|
|
1678
|
+
|
|
1679
|
+
```typescript
|
|
1680
|
+
function setState_StartX(startX: number): IPCB_PrimitiveArc;
|
|
1681
|
+
```
|
|
1682
|
+
|
|
1683
|
+
## Parameters
|
|
1684
|
+
|
|
1685
|
+
<table><thead><tr><th>
|
|
1686
|
+
|
|
1687
|
+
Parameter
|
|
1688
|
+
|
|
1689
|
+
</th><th>
|
|
1690
|
+
|
|
1691
|
+
Type
|
|
1692
|
+
|
|
1693
|
+
</th><th>
|
|
1694
|
+
|
|
1695
|
+
Description
|
|
1696
|
+
|
|
1697
|
+
</th></tr></thead>
|
|
1698
|
+
<tbody><tr><td>
|
|
1699
|
+
|
|
1700
|
+
startX
|
|
1701
|
+
|
|
1702
|
+
</td><td>
|
|
1703
|
+
|
|
1704
|
+
number
|
|
1705
|
+
|
|
1706
|
+
</td><td>
|
|
1707
|
+
|
|
1708
|
+
Start position X
|
|
1709
|
+
|
|
1710
|
+
</td></tr>
|
|
1711
|
+
</tbody></table>
|
|
1712
|
+
|
|
1713
|
+
## Returns
|
|
1714
|
+
|
|
1715
|
+
[IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md)
|
|
1716
|
+
|
|
1717
|
+
Arc line primitive object
|
|
1718
|
+
|
|
1719
|
+
## Example
|
|
1720
|
+
|
|
1721
|
+
```javascript
|
|
1722
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试圆弧重合
|
|
1723
|
+
const x = 6000 + (Math.floor(Math.random() * 100000));
|
|
1724
|
+
const y = 2000 + (Math.floor(Math.random() * 100000));
|
|
1725
|
+
|
|
1726
|
+
// 2. 创建一段测试圆弧,起点 (x, y)
|
|
1727
|
+
const arc = await eda.pcb_PrimitiveArc.create('', 1, x, y, x + 500, y + 300, 90, 10, 1, false);
|
|
1728
|
+
|
|
1729
|
+
// 3. 读取修改前的起点 X
|
|
1730
|
+
const before = arc.getState_StartX();
|
|
1731
|
+
|
|
1732
|
+
// 4. 切换异步模式并平移起点 X(右移 300mil)
|
|
1733
|
+
const asyncArc = arc.toAsync();
|
|
1734
|
+
asyncArc.setState_StartX(x + 300);
|
|
1735
|
+
await asyncArc.done();
|
|
1736
|
+
|
|
1737
|
+
// 5. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1738
|
+
const refetched = await eda.pcb_PrimitiveArc.get(arc.getState_PrimitiveId());
|
|
1739
|
+
const after = refetched.getState_StartX();
|
|
1740
|
+
|
|
1741
|
+
console.log('startX:', before, '→', after);
|
|
1742
|
+
```
|
|
1743
|
+
|
|
1744
|
+
### setstate_starty
|
|
1745
|
+
|
|
1746
|
+
# IPCB\_PrimitiveArc.setState\_StartY() method
|
|
1747
|
+
|
|
1748
|
+
> 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.
|
|
1749
|
+
|
|
1750
|
+
Set the property state: start position Y
|
|
1751
|
+
|
|
1752
|
+
## Signature
|
|
1753
|
+
|
|
1754
|
+
```typescript
|
|
1755
|
+
function setState_StartY(startY: number): IPCB_PrimitiveArc;
|
|
1756
|
+
```
|
|
1757
|
+
|
|
1758
|
+
## Parameters
|
|
1759
|
+
|
|
1760
|
+
<table><thead><tr><th>
|
|
1761
|
+
|
|
1762
|
+
Parameter
|
|
1763
|
+
|
|
1764
|
+
</th><th>
|
|
1765
|
+
|
|
1766
|
+
Type
|
|
1767
|
+
|
|
1768
|
+
</th><th>
|
|
1769
|
+
|
|
1770
|
+
Description
|
|
1771
|
+
|
|
1772
|
+
</th></tr></thead>
|
|
1773
|
+
<tbody><tr><td>
|
|
1774
|
+
|
|
1775
|
+
startY
|
|
1776
|
+
|
|
1777
|
+
</td><td>
|
|
1778
|
+
|
|
1779
|
+
number
|
|
1780
|
+
|
|
1781
|
+
</td><td>
|
|
1782
|
+
|
|
1783
|
+
Start position Y
|
|
1784
|
+
|
|
1785
|
+
</td></tr>
|
|
1786
|
+
</tbody></table>
|
|
1787
|
+
|
|
1788
|
+
## Returns
|
|
1789
|
+
|
|
1790
|
+
[IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md)
|
|
1791
|
+
|
|
1792
|
+
Arc line primitive object
|
|
1793
|
+
|
|
1794
|
+
## Example
|
|
1795
|
+
|
|
1796
|
+
```javascript
|
|
1797
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试圆弧重合
|
|
1798
|
+
const x = 10000 + (Math.floor(Math.random() * 100000));
|
|
1799
|
+
const y = 2000 + (Math.floor(Math.random() * 100000));
|
|
1800
|
+
|
|
1801
|
+
// 2. 创建一段测试圆弧,起点 (x, y)
|
|
1802
|
+
const arc = await eda.pcb_PrimitiveArc.create('', 1, x, y, x + 500, y + 300, 90, 10, 1, false);
|
|
1803
|
+
|
|
1804
|
+
// 3. 读取修改前的起点 Y
|
|
1805
|
+
const before = arc.getState_StartY();
|
|
1806
|
+
|
|
1807
|
+
// 4. 切换异步模式并平移起点 Y(上移 300mil)
|
|
1808
|
+
const asyncArc = arc.toAsync();
|
|
1809
|
+
asyncArc.setState_StartY(y + 300);
|
|
1810
|
+
await asyncArc.done();
|
|
1811
|
+
|
|
1812
|
+
// 5. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1813
|
+
const refetched = await eda.pcb_PrimitiveArc.get(arc.getState_PrimitiveId());
|
|
1814
|
+
const after = refetched.getState_StartY();
|
|
1815
|
+
|
|
1816
|
+
console.log('startY:', before, '→', after);
|
|
1817
|
+
```
|
|
1818
|
+
|
|
1819
|
+
### toasync
|
|
1820
|
+
|
|
1821
|
+
# IPCB\_PrimitiveArc.toAsync() method
|
|
1822
|
+
|
|
1823
|
+
Convert Primitive to Async primitive
|
|
1824
|
+
|
|
1825
|
+
## Signature
|
|
1826
|
+
|
|
1827
|
+
```typescript
|
|
1828
|
+
function toAsync(): IPCB_PrimitiveArc;
|
|
1829
|
+
```
|
|
1830
|
+
|
|
1831
|
+
## Returns
|
|
1832
|
+
|
|
1833
|
+
[IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md)
|
|
1834
|
+
|
|
1835
|
+
Arc line primitive object
|
|
1836
|
+
|
|
1837
|
+
## Example
|
|
1838
|
+
|
|
1839
|
+
```javascript
|
|
1840
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试圆弧重合
|
|
1841
|
+
const x = 52000 + (Math.floor(Math.random() * 100000));
|
|
1842
|
+
const y = 2000 + (Math.floor(Math.random() * 100000));
|
|
1843
|
+
|
|
1844
|
+
// 2. 创建一段测试圆弧,切换到同步模式,让模式变化可观察
|
|
1845
|
+
const arc = await eda.pcb_PrimitiveArc.create('', 1, x, y, x + 500, y + 300, 90, 10, 1, false);
|
|
1846
|
+
arc.toSync();
|
|
1847
|
+
|
|
1848
|
+
// 3. 转换为异步图元
|
|
1849
|
+
const asyncArc = arc.toAsync();
|
|
1850
|
+
|
|
1851
|
+
// 4. 异步模式下累计修改并提交
|
|
1852
|
+
asyncArc.setState_LineWidth(24);
|
|
1853
|
+
await asyncArc.done();
|
|
1854
|
+
|
|
1855
|
+
// 5. 从画布重新读取,确认提交生效(保留现场供观察)
|
|
1856
|
+
const refetched = await eda.pcb_PrimitiveArc.get(arc.getState_PrimitiveId());
|
|
1857
|
+
|
|
1858
|
+
console.log('isAsync after toAsync:', arc.isAsync());
|
|
1859
|
+
console.log('lineWidth:', 10, '→', refetched.getState_LineWidth());
|
|
1860
|
+
```
|
|
1861
|
+
|
|
1862
|
+
### tosync
|
|
1863
|
+
|
|
1864
|
+
# IPCB\_PrimitiveArc.toSync() method
|
|
1865
|
+
|
|
1866
|
+
Convert Primitive to Sync primitive
|
|
1867
|
+
|
|
1868
|
+
## Signature
|
|
1869
|
+
|
|
1870
|
+
```typescript
|
|
1871
|
+
function toSync(): IPCB_PrimitiveArc;
|
|
1872
|
+
```
|
|
1873
|
+
|
|
1874
|
+
## Returns
|
|
1875
|
+
|
|
1876
|
+
[IPCB\_PrimitiveArc](./IPCB_PrimitiveArc.md)
|
|
1877
|
+
|
|
1878
|
+
Arc line primitive object
|
|
1879
|
+
|
|
1880
|
+
## Example
|
|
1881
|
+
|
|
1882
|
+
```javascript
|
|
1883
|
+
// 1. 生成本次运行专用的坐标,避免与之前保留的测试圆弧重合
|
|
1884
|
+
const x = 56000 + (Math.floor(Math.random() * 100000));
|
|
1885
|
+
const y = 2000 + (Math.floor(Math.random() * 100000));
|
|
1886
|
+
|
|
1887
|
+
// 2. 创建一段测试圆弧
|
|
1888
|
+
const arc = await eda.pcb_PrimitiveArc.create('', 1, x, y, x + 500, y + 300, 90, 10, 1, false);
|
|
1889
|
+
|
|
1890
|
+
// 3. 转换为同步图元
|
|
1891
|
+
const syncArc = arc.toSync();
|
|
1892
|
+
|
|
1893
|
+
// 4. 同步模式下修改线宽,立即生效(无需 done())
|
|
1894
|
+
syncArc.setState_LineWidth(40);
|
|
1895
|
+
|
|
1896
|
+
// 5. 从画布重新读取,确认修改已生效(保留现场供观察)
|
|
1897
|
+
const refetched = await eda.pcb_PrimitiveArc.get(arc.getState_PrimitiveId());
|
|
1898
|
+
|
|
1899
|
+
console.log('isSync after toSync:', !syncArc.isAsync());
|
|
1900
|
+
console.log('lineWidth:', 10, '→', refetched.getState_LineWidth());
|
|
1901
|
+
```
|