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