@windypro-rourou/dsh-eda 0.1.0 → 0.1.1
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 +71 -119
- package/cordis.patch.yml +9 -7
- package/lib/board.js +80 -0
- package/lib/client.js +2 -2
- package/lib/index.js +339 -11
- package/lib/installer.js +4 -4
- package/lib/skill.js +138 -0
- package/package.json +12 -2
- package/skill/INDEX.md +193 -0
- package/skill/README.official.md +125 -0
- package/skill/README.zh-Hans.official.md +125 -0
- package/skill/SKILL.md +746 -0
- package/skill/format/index.md +152 -0
- package/skill/format/pcb/3d.md +166 -0
- package/skill/format/pcb/attr.md +63 -0
- package/skill/format/pcb/common.md +306 -0
- package/skill/format/pcb/component.md +132 -0
- package/skill/format/pcb/dimension.md +58 -0
- package/skill/format/pcb/index.md +17 -0
- package/skill/format/pcb/obj.md +43 -0
- package/skill/format/pcb/pad_via.md +151 -0
- package/skill/format/pcb/panel.md +64 -0
- package/skill/format/pcb/partition.md +43 -0
- package/skill/format/pcb/primitive.md +196 -0
- package/skill/format/pcb/rule.md +71 -0
- package/skill/format/pcb/shape.md +441 -0
- package/skill/format/pcb/text.md +62 -0
- package/skill/format/project/blob.md +30 -0
- package/skill/format/project/common.md +42 -0
- package/skill/format/project/group.md +62 -0
- package/skill/format/project/index.md +12 -0
- package/skill/format/project/instance.md +32 -0
- package/skill/format/project/meta.md +189 -0
- package/skill/format/project/variant.md +30 -0
- package/skill/format/schematic/attr.md +41 -0
- package/skill/format/schematic/common.md +47 -0
- package/skill/format/schematic/component.md +91 -0
- package/skill/format/schematic/index.md +14 -0
- package/skill/format/schematic/obj.md +41 -0
- package/skill/format/schematic/pin.md +59 -0
- package/skill/format/schematic/shape.md +231 -0
- package/skill/format/schematic/structure.md +53 -0
- package/skill/format/schematic/table.md +109 -0
- package/skill/format/schematic/text.md +47 -0
- package/skill/format/schematic/wire.md +132 -0
- package/skill/guide/ancillary-projects/pro-api-sdk.md +1 -0
- package/skill/guide/ancillary-projects/pro-api-types.md +5 -0
- package/skill/guide/ancillary-projects.md +10 -0
- package/skill/guide/error-handling.md +38 -0
- package/skill/guide/extension-json.md +135 -0
- package/skill/guide/extensions-marketplace.md +61 -0
- package/skill/guide/how-to-start.md +301 -0
- package/skill/guide/i18n.md +57 -0
- package/skill/guide/index.md +7 -0
- package/skill/guide/inline-frame.md +20 -0
- package/skill/guide/invoke-apis.md +81 -0
- package/skill/guide/stability.md +37 -0
- package/skill/references/_index.md +398 -0
- package/skill/references/_quick-reference.md +3028 -0
- package/skill/references/classes/DMT_Board.md +533 -0
- package/skill/references/classes/DMT_EditorControl.md +1736 -0
- package/skill/references/classes/DMT_Event.md +356 -0
- package/skill/references/classes/DMT_Folder.md +775 -0
- package/skill/references/classes/DMT_Panel.md +531 -0
- package/skill/references/classes/DMT_Pcb.md +575 -0
- package/skill/references/classes/DMT_Project.md +573 -0
- package/skill/references/classes/DMT_Schematic.md +1477 -0
- package/skill/references/classes/DMT_SelectControl.md +96 -0
- package/skill/references/classes/DMT_Team.md +172 -0
- package/skill/references/classes/DMT_Workspace.md +198 -0
- package/skill/references/classes/EDA.md +961 -0
- package/skill/references/classes/IPCB_ComplexPolygon.md +299 -0
- package/skill/references/classes/IPCB_Polygon.md +175 -0
- package/skill/references/classes/IPCB_PrimitiveArc.md +1901 -0
- package/skill/references/classes/IPCB_PrimitiveAttribute.md +2993 -0
- package/skill/references/classes/IPCB_PrimitiveComponent.md +2627 -0
- package/skill/references/classes/IPCB_PrimitiveComponentPad.md +410 -0
- package/skill/references/classes/IPCB_PrimitiveDimension.md +1419 -0
- package/skill/references/classes/IPCB_PrimitiveFill.md +1325 -0
- package/skill/references/classes/IPCB_PrimitiveImage.md +1461 -0
- package/skill/references/classes/IPCB_PrimitiveLine.md +1639 -0
- package/skill/references/classes/IPCB_PrimitiveObject.md +1700 -0
- package/skill/references/classes/IPCB_PrimitivePad.md +3155 -0
- package/skill/references/classes/IPCB_PrimitivePolyline.md +1193 -0
- package/skill/references/classes/IPCB_PrimitivePour.md +1858 -0
- package/skill/references/classes/IPCB_PrimitivePoured.md +556 -0
- package/skill/references/classes/IPCB_PrimitiveRegion.md +1332 -0
- package/skill/references/classes/IPCB_PrimitiveString.md +2315 -0
- package/skill/references/classes/IPCB_PrimitiveVia.md +1588 -0
- package/skill/references/classes/ISCH_PrimitiveArc.md +1676 -0
- package/skill/references/classes/ISCH_PrimitiveAttribute.md +2541 -0
- package/skill/references/classes/ISCH_PrimitiveBus.md +973 -0
- package/skill/references/classes/ISCH_PrimitiveCbbSymbolComponent.md +260 -0
- package/skill/references/classes/ISCH_PrimitiveCircle.md +1392 -0
- package/skill/references/classes/ISCH_PrimitiveComponent.md +2913 -0
- package/skill/references/classes/ISCH_PrimitiveComponentPin.md +155 -0
- package/skill/references/classes/ISCH_PrimitiveObject.md +960 -0
- package/skill/references/classes/ISCH_PrimitivePin.md +2402 -0
- package/skill/references/classes/ISCH_PrimitivePolygon.md +1028 -0
- package/skill/references/classes/ISCH_PrimitiveRectangle.md +1777 -0
- package/skill/references/classes/ISCH_PrimitiveText.md +1771 -0
- package/skill/references/classes/ISCH_PrimitiveWire.md +973 -0
- package/skill/references/classes/LIB_3DModel.md +780 -0
- package/skill/references/classes/LIB_Cbb.md +957 -0
- package/skill/references/classes/LIB_Classification.md +965 -0
- package/skill/references/classes/LIB_Device.md +1221 -0
- package/skill/references/classes/LIB_Footprint.md +1153 -0
- package/skill/references/classes/LIB_LibrariesList.md +329 -0
- package/skill/references/classes/LIB_PanelLibrary.md +855 -0
- package/skill/references/classes/LIB_SelectControl.md +89 -0
- package/skill/references/classes/LIB_SimulationModel.md +821 -0
- package/skill/references/classes/LIB_Symbol.md +1195 -0
- package/skill/references/classes/PCB_Document.md +1754 -0
- package/skill/references/classes/PCB_Drc.md +3375 -0
- package/skill/references/classes/PCB_Event.md +1081 -0
- package/skill/references/classes/PCB_Layer.md +1911 -0
- package/skill/references/classes/PCB_ManufactureData.md +2968 -0
- package/skill/references/classes/PCB_MathPolygon.md +785 -0
- package/skill/references/classes/PCB_Net.md +1128 -0
- package/skill/references/classes/PCB_Primitive.md +217 -0
- package/skill/references/classes/PCB_PrimitiveArc.md +894 -0
- package/skill/references/classes/PCB_PrimitiveAttribute.md +717 -0
- package/skill/references/classes/PCB_PrimitiveComponent.md +1050 -0
- package/skill/references/classes/PCB_PrimitiveDimension.md +833 -0
- package/skill/references/classes/PCB_PrimitiveFill.md +861 -0
- package/skill/references/classes/PCB_PrimitiveImage.md +875 -0
- package/skill/references/classes/PCB_PrimitiveLine.md +858 -0
- package/skill/references/classes/PCB_PrimitiveObject.md +800 -0
- package/skill/references/classes/PCB_PrimitivePad.md +944 -0
- package/skill/references/classes/PCB_PrimitivePolyline.md +819 -0
- package/skill/references/classes/PCB_PrimitivePour.md +845 -0
- package/skill/references/classes/PCB_PrimitivePoured.md +363 -0
- package/skill/references/classes/PCB_PrimitiveRegion.md +799 -0
- package/skill/references/classes/PCB_PrimitiveString.md +910 -0
- package/skill/references/classes/PCB_PrimitiveVia.md +765 -0
- package/skill/references/classes/PCB_RayTracerEngine.md +263 -0
- package/skill/references/classes/PCB_SelectControl.md +495 -0
- package/skill/references/classes/PNL_Document.md +83 -0
- package/skill/references/classes/SCH_Document.md +809 -0
- package/skill/references/classes/SCH_Drc.md +242 -0
- package/skill/references/classes/SCH_Event.md +583 -0
- package/skill/references/classes/SCH_ManufactureData.md +1205 -0
- package/skill/references/classes/SCH_Net.md +200 -0
- package/skill/references/classes/SCH_Netlist.md +191 -0
- package/skill/references/classes/SCH_Primitive.md +337 -0
- package/skill/references/classes/SCH_PrimitiveArc.md +692 -0
- package/skill/references/classes/SCH_PrimitiveAttribute.md +590 -0
- package/skill/references/classes/SCH_PrimitiveBus.md +624 -0
- package/skill/references/classes/SCH_PrimitiveCircle.md +683 -0
- package/skill/references/classes/SCH_PrimitiveComponent.md +2240 -0
- package/skill/references/classes/SCH_PrimitiveObject.md +666 -0
- package/skill/references/classes/SCH_PrimitivePin.md +754 -0
- package/skill/references/classes/SCH_PrimitivePolygon.md +627 -0
- package/skill/references/classes/SCH_PrimitiveRectangle.md +731 -0
- package/skill/references/classes/SCH_PrimitiveText.md +746 -0
- package/skill/references/classes/SCH_PrimitiveWire.md +703 -0
- package/skill/references/classes/SCH_SelectControl.md +520 -0
- package/skill/references/classes/SCH_SimulationEngine.md +133 -0
- package/skill/references/classes/SCH_Utils.md +121 -0
- package/skill/references/classes/SYS_ClientUrl.md +173 -0
- package/skill/references/classes/SYS_Dialog.md +825 -0
- package/skill/references/classes/SYS_Environment.md +502 -0
- package/skill/references/classes/SYS_FileManager.md +1686 -0
- package/skill/references/classes/SYS_FileSystem.md +1171 -0
- package/skill/references/classes/SYS_FontManager.md +224 -0
- package/skill/references/classes/SYS_FormatConversion.md +349 -0
- package/skill/references/classes/SYS_HeaderMenu.md +479 -0
- package/skill/references/classes/SYS_I18n.md +861 -0
- package/skill/references/classes/SYS_IFrame.md +535 -0
- package/skill/references/classes/SYS_LoadingAndProgressBar.md +246 -0
- package/skill/references/classes/SYS_Log.md +424 -0
- package/skill/references/classes/SYS_Math.md +1565 -0
- package/skill/references/classes/SYS_Message.md +363 -0
- package/skill/references/classes/SYS_MessageBox.md +285 -0
- package/skill/references/classes/SYS_MessageBus.md +1618 -0
- package/skill/references/classes/SYS_PanelControl.md +696 -0
- package/skill/references/classes/SYS_RightClickMenu.md +175 -0
- package/skill/references/classes/SYS_Setting.md +85 -0
- package/skill/references/classes/SYS_ShortcutKey.md +623 -0
- package/skill/references/classes/SYS_Storage.md +484 -0
- package/skill/references/classes/SYS_Timer.md +447 -0
- package/skill/references/classes/SYS_ToastMessage.md +194 -0
- package/skill/references/classes/SYS_Tool.md +241 -0
- package/skill/references/classes/SYS_Unit.md +594 -0
- package/skill/references/classes/SYS_WebSocket.md +401 -0
- package/skill/references/classes/SYS_Window.md +850 -0
- package/skill/references/enums/EDMT_EditorDocumentType.md +279 -0
- package/skill/references/enums/EDMT_EditorSplitScreenDirection.md +48 -0
- package/skill/references/enums/EDMT_EditorTabEventType.md +63 -0
- package/skill/references/enums/EDMT_IndicatorMarkerType.md +81 -0
- package/skill/references/enums/EDMT_ItemType.md +158 -0
- package/skill/references/enums/EDMT_ProjectCollaborationMode.md +48 -0
- package/skill/references/enums/ELIB_DeviceJlcLibraryCategory.md +48 -0
- package/skill/references/enums/ELIB_LibraryType.md +114 -0
- package/skill/references/enums/ELIB_PreviewType.md +70 -0
- package/skill/references/enums/ELIB_SimulationModelType.md +48 -0
- package/skill/references/enums/ELIB_SymbolType.md +125 -0
- package/skill/references/enums/EPCB_AutoRoutingCornerStyle.md +48 -0
- package/skill/references/enums/EPCB_AutoRoutingExistingPrimitiveMode.md +48 -0
- package/skill/references/enums/EPCB_AutoRoutingOptimization.md +48 -0
- package/skill/references/enums/EPCB_DocumentCanvasUpdateCalculationActiveStatus.md +48 -0
- package/skill/references/enums/EPCB_DocumentRatlineCalculatingActiveStatus.md +52 -0
- package/skill/references/enums/EPCB_InactiveLayerDisplayMode.md +59 -0
- package/skill/references/enums/EPCB_LayerColorConfiguration.md +81 -0
- package/skill/references/enums/EPCB_LayerId.md +882 -0
- package/skill/references/enums/EPCB_LayerStatus.md +59 -0
- package/skill/references/enums/EPCB_LayerType.md +114 -0
- package/skill/references/enums/EPCB_MouseEventType.md +59 -0
- package/skill/references/enums/EPCB_NetEventType.md +59 -0
- package/skill/references/enums/EPCB_PcbPlateType.md +48 -0
- package/skill/references/enums/EPCB_PdfOutputMethod.md +59 -0
- package/skill/references/enums/EPCB_PrimitiveArcInteractiveMode.md +48 -0
- package/skill/references/enums/EPCB_PrimitiveDimensionType.md +59 -0
- package/skill/references/enums/EPCB_PrimitiveEventType.md +59 -0
- package/skill/references/enums/EPCB_PrimitiveFillMode.md +63 -0
- package/skill/references/enums/EPCB_PrimitivePadHeatWeldingConnectionMethod.md +59 -0
- package/skill/references/enums/EPCB_PrimitivePadHoleType.md +59 -0
- package/skill/references/enums/EPCB_PrimitivePadShapeType.md +81 -0
- package/skill/references/enums/EPCB_PrimitivePadType.md +59 -0
- package/skill/references/enums/EPCB_PrimitivePourFillMethod.md +59 -0
- package/skill/references/enums/EPCB_PrimitiveRegionRuleType.md +96 -0
- package/skill/references/enums/EPCB_PrimitiveStringAlignMode.md +125 -0
- package/skill/references/enums/EPCB_PrimitiveType.md +202 -0
- package/skill/references/enums/EPCB_PrimitiveViaType.md +59 -0
- package/skill/references/enums/ESCH_DynamicSimulationEnginePullEventType.md +103 -0
- package/skill/references/enums/ESCH_DynamicSimulationEnginePushEventType.md +81 -0
- package/skill/references/enums/ESCH_ExportDocumentFileType.md +59 -0
- package/skill/references/enums/ESCH_MouseEventType.md +48 -0
- package/skill/references/enums/ESCH_PrimitiveComponentType.md +125 -0
- package/skill/references/enums/ESCH_PrimitiveEventType.md +70 -0
- package/skill/references/enums/ESCH_PrimitiveFillStyle.md +114 -0
- package/skill/references/enums/ESCH_PrimitiveLineType.md +70 -0
- package/skill/references/enums/ESCH_PrimitivePinShape.md +70 -0
- package/skill/references/enums/ESCH_PrimitivePinType.md +147 -0
- package/skill/references/enums/ESCH_PrimitiveTextAlignMode.md +125 -0
- package/skill/references/enums/ESCH_PrimitiveType.md +180 -0
- package/skill/references/enums/ESCH_SimulationNetlistType.md +37 -0
- package/skill/references/enums/ESCH_SpiceSimulationEnginePullEventType.md +48 -0
- package/skill/references/enums/ESCH_SpiceSimulationEnginePushEventType.md +70 -0
- package/skill/references/enums/ESYS_BottomPanelTab.md +81 -0
- package/skill/references/enums/ESYS_HeaderMenuEnvironment.md +158 -0
- package/skill/references/enums/ESYS_ImportProjectBoardOutlineSource.md +52 -0
- package/skill/references/enums/ESYS_ImportProjectImportOption.md +59 -0
- package/skill/references/enums/ESYS_ImportProjectSchematicObjectStyle.md +48 -0
- package/skill/references/enums/ESYS_ImportProjectViaSolderMaskExpansion.md +52 -0
- package/skill/references/enums/ESYS_LeftPanelTab.md +81 -0
- package/skill/references/enums/ESYS_LogType.md +103 -0
- package/skill/references/enums/ESYS_NetlistType.md +114 -0
- package/skill/references/enums/ESYS_RightPanelTab.md +202 -0
- package/skill/references/enums/ESYS_ShortcutKeyEffectiveEditorRange.md +191 -0
- package/skill/references/enums/ESYS_ShortcutKeyEffectiveEditorScene.md +92 -0
- package/skill/references/enums/ESYS_StartPageQuickStartItem.md +206 -0
- package/skill/references/enums/ESYS_Theme.md +48 -0
- package/skill/references/enums/ESYS_ToastMessageType.md +81 -0
- package/skill/references/enums/ESYS_Unit.md +103 -0
- package/skill/references/enums/ESYS_WindowEventType.md +48 -0
- package/skill/references/enums/ESYS_WindowOpenTarget.md +48 -0
- package/skill/references/enums/NetportDeviceName.md +147 -0
- package/skill/references/enums/SchToolBarDeviceName.md +279 -0
- package/skill/references/interfaces/BoardProps.md +169 -0
- package/skill/references/interfaces/ButtonProps.md +169 -0
- package/skill/references/interfaces/CheckBoxProps.md +196 -0
- package/skill/references/interfaces/ComponentPropsMap.md +448 -0
- package/skill/references/interfaces/DialogProps.md +385 -0
- package/skill/references/interfaces/FlexItemProps.md +116 -0
- package/skill/references/interfaces/FlexProps.md +224 -0
- package/skill/references/interfaces/GridItemProps.md +143 -0
- package/skill/references/interfaces/GridProps.md +143 -0
- package/skill/references/interfaces/IDMT_BoardItem.md +171 -0
- package/skill/references/interfaces/IDMT_BriefProjectItem.md +171 -0
- package/skill/references/interfaces/IDMT_EditorDocumentItem.md +169 -0
- package/skill/references/interfaces/IDMT_EditorSplitScreenItem.md +173 -0
- package/skill/references/interfaces/IDMT_EditorTabItem.md +169 -0
- package/skill/references/interfaces/IDMT_FolderItem.md +225 -0
- package/skill/references/interfaces/IDMT_IndicatorMarkerShape.md +393 -0
- package/skill/references/interfaces/IDMT_PanelItem.md +144 -0
- package/skill/references/interfaces/IDMT_PcbItem.md +171 -0
- package/skill/references/interfaces/IDMT_ProjectItem.md +143 -0
- package/skill/references/interfaces/IDMT_SchematicItem.md +225 -0
- package/skill/references/interfaces/IDMT_SchematicPageItem.md +198 -0
- package/skill/references/interfaces/IDMT_TeamItem.md +144 -0
- package/skill/references/interfaces/IDMT_WorkspaceItem.md +117 -0
- package/skill/references/interfaces/IDesignPortal.md +103 -0
- package/skill/references/interfaces/ILIB_3DModelItem.md +198 -0
- package/skill/references/interfaces/ILIB_3DModelSearchItem.md +277 -0
- package/skill/references/interfaces/ILIB_CbbItem.md +225 -0
- package/skill/references/interfaces/ILIB_CbbSearchItem.md +277 -0
- package/skill/references/interfaces/ILIB_ClassificationIndex.md +150 -0
- package/skill/references/interfaces/ILIB_DeviceAssociationItem.md +210 -0
- package/skill/references/interfaces/ILIB_DeviceExtendPropertyItem.md +304 -0
- package/skill/references/interfaces/ILIB_DeviceItem.md +279 -0
- package/skill/references/interfaces/ILIB_DevicePropertiesForSearch.md +250 -0
- package/skill/references/interfaces/ILIB_DeviceSearchItem.md +521 -0
- package/skill/references/interfaces/ILIB_ExtendLibrary3DModelFunctions.md +64 -0
- package/skill/references/interfaces/ILIB_ExtendLibraryCbbFunctions.md +99 -0
- package/skill/references/interfaces/ILIB_ExtendLibraryClassificationIndex.md +150 -0
- package/skill/references/interfaces/ILIB_ExtendLibraryDeviceFunctions.md +157 -0
- package/skill/references/interfaces/ILIB_ExtendLibraryFootprintFunctions.md +63 -0
- package/skill/references/interfaces/ILIB_ExtendLibraryFunctions.md +123 -0
- package/skill/references/interfaces/ILIB_ExtendLibraryItem.md +97 -0
- package/skill/references/interfaces/ILIB_ExtendLibraryItemIndex.md +98 -0
- package/skill/references/interfaces/ILIB_ExtendLibrarySearchProperty.md +115 -0
- package/skill/references/interfaces/ILIB_ExtendLibrarySearchResult.md +169 -0
- package/skill/references/interfaces/ILIB_ExtendLibrarySearchResultDataLine.md +234 -0
- package/skill/references/interfaces/ILIB_ExtendLibrarySymbolFunctions.md +105 -0
- package/skill/references/interfaces/ILIB_ExtendLibraryUserIndex.md +96 -0
- package/skill/references/interfaces/ILIB_FootprintItem.md +198 -0
- package/skill/references/interfaces/ILIB_FootprintPropertiesForSearch.md +61 -0
- package/skill/references/interfaces/ILIB_FootprintSearchItem.md +277 -0
- package/skill/references/interfaces/ILIB_LibraryInfo.md +92 -0
- package/skill/references/interfaces/ILIB_LibraryItem.md +115 -0
- package/skill/references/interfaces/ILIB_PanelLibraryItem.md +198 -0
- package/skill/references/interfaces/ILIB_PanelLibrarySearchItem.md +277 -0
- package/skill/references/interfaces/ILIB_SimulationModelItem.md +306 -0
- package/skill/references/interfaces/ILIB_SimulationModelSearchItem.md +304 -0
- package/skill/references/interfaces/ILIB_SymbolItem.md +279 -0
- package/skill/references/interfaces/ILIB_SymbolPropertiesForSearch.md +61 -0
- package/skill/references/interfaces/ILIB_SymbolSearchItem.md +304 -0
- package/skill/references/interfaces/IPCB_AutoLayoutResult.md +169 -0
- package/skill/references/interfaces/IPCB_AutoRoutingProps.md +220 -0
- package/skill/references/interfaces/IPCB_AutoRoutingResult.md +169 -0
- package/skill/references/interfaces/IPCB_BomPropertiesTableColumns.md +169 -0
- package/skill/references/interfaces/IPCB_DifferentialPairItem.md +115 -0
- package/skill/references/interfaces/IPCB_DiscretizeOptions.md +65 -0
- package/skill/references/interfaces/IPCB_DiscretizedPoint.md +88 -0
- package/skill/references/interfaces/IPCB_EqualLengthNetGroupItem.md +115 -0
- package/skill/references/interfaces/IPCB_LayerItem.md +277 -0
- package/skill/references/interfaces/IPCB_NetClassItem.md +115 -0
- package/skill/references/interfaces/IPCB_NetInfo.md +115 -0
- package/skill/references/interfaces/IPCB_PadPairGroupItem.md +88 -0
- package/skill/references/interfaces/IPCB_PadPairMinWireLengthItem.md +88 -0
- package/skill/references/interfaces/IPCB_PhysicalStackingConfiguration.md +115 -0
- package/skill/references/interfaces/IPCB_Primitive.md +218 -0
- package/skill/references/interfaces/IPCB_PrimitiveAPI.md +175 -0
- package/skill/references/interfaces/IPCB_PrimitivePadHeatWelding.md +151 -0
- package/skill/references/interfaces/IPCB_PrimitivePouredPourFill.md +142 -0
- package/skill/references/interfaces/IPCB_PrimitiveSolderMaskAndPasteMaskExpansion.md +154 -0
- package/skill/references/interfaces/IPCB_SubstratePhysicalProperties.md +88 -0
- package/skill/references/interfaces/IRawNet.md +103 -0
- package/skill/references/interfaces/IRawPureSchematic.md +80 -0
- package/skill/references/interfaces/IRawSchematic.md +103 -0
- package/skill/references/interfaces/IRawWire.md +149 -0
- package/skill/references/interfaces/ISCH_DrcError.md +142 -0
- package/skill/references/interfaces/ISCH_DrcErrorPrimitive.md +142 -0
- package/skill/references/interfaces/ISCH_ExportPngResolution.md +94 -0
- package/skill/references/interfaces/ISCH_NetInfo.md +88 -0
- package/skill/references/interfaces/ISCH_Primitive.md +219 -0
- package/skill/references/interfaces/ISCH_PrimitiveAPI.md +175 -0
- package/skill/references/interfaces/ISCH_ProjectNetInfo.md +142 -0
- package/skill/references/interfaces/ISCH_WireInfo.md +169 -0
- package/skill/references/interfaces/ISYS_FileSystemFileList.md +169 -0
- package/skill/references/interfaces/ISYS_HeaderMenuSub1MenuItem.md +174 -0
- package/skill/references/interfaces/ISYS_HeaderMenuSub2MenuItem.md +147 -0
- package/skill/references/interfaces/ISYS_HeaderMenuTopMenuItem.md +115 -0
- package/skill/references/interfaces/ISYS_HeaderMenus.md +408 -0
- package/skill/references/interfaces/ISYS_LogLine.md +115 -0
- package/skill/references/interfaces/ISYS_MathBBox.md +142 -0
- package/skill/references/interfaces/ISYS_MathPoint.md +88 -0
- package/skill/references/interfaces/ISYS_MathPolygonWithHoles.md +92 -0
- package/skill/references/interfaces/ISYS_MessageBusTask.md +115 -0
- package/skill/references/interfaces/ISYS_MultilingualLanguagesData.md +13 -0
- package/skill/references/interfaces/ISYS_PcbComparisonResponse.md +115 -0
- package/skill/references/interfaces/ISYS_RightClickMenuItem.md +174 -0
- package/skill/references/interfaces/ISYS_ShortcutKeyData.md +169 -0
- package/skill/references/interfaces/ISYS_ShortcutKeyDataWithCallFn.md +62 -0
- package/skill/references/interfaces/ISYS_ShortcutKeyDataWithUserDefinedShortcutKey.md +62 -0
- package/skill/references/interfaces/ISYS_WindowEventListenerRemovableObject.md +109 -0
- package/skill/references/interfaces/IconProps.md +88 -0
- package/skill/references/interfaces/ImageProps.md +115 -0
- package/skill/references/interfaces/InputProps.md +520 -0
- package/skill/references/interfaces/ListChildren.md +223 -0
- package/skill/references/interfaces/ListProps.md +223 -0
- package/skill/references/interfaces/ModalProps.md +358 -0
- package/skill/references/interfaces/RadioGroupProps.md +196 -0
- package/skill/references/interfaces/RadioItem.md +115 -0
- package/skill/references/interfaces/ScrollerProps.md +169 -0
- package/skill/references/interfaces/SelectListItem.md +142 -0
- package/skill/references/interfaces/SelectProps.md +169 -0
- package/skill/references/interfaces/SlotProps.md +88 -0
- package/skill/references/interfaces/StyleProps.md +385 -0
- package/skill/references/interfaces/TextAreaProps.md +196 -0
- package/skill/references/interfaces/TextProps.md +169 -0
- package/skill/references/types/ISYS_LanguageKeyValuePairs.md +13 -0
- package/skill/references/types/TPCB_LayerTypesOfInnerLayer.md +12 -0
- package/skill/references/types/TPCB_LayersInTheSelectable.md +43 -0
- package/skill/references/types/TPCB_LayersOfComponent.md +12 -0
- package/skill/references/types/TPCB_LayersOfCopper.md +16 -0
- package/skill/references/types/TPCB_LayersOfCustom.md +42 -0
- package/skill/references/types/TPCB_LayersOfDimension.md +17 -0
- package/skill/references/types/TPCB_LayersOfFill.md +29 -0
- package/skill/references/types/TPCB_LayersOfImage.md +23 -0
- package/skill/references/types/TPCB_LayersOfInner.md +42 -0
- package/skill/references/types/TPCB_LayersOfLine.md +26 -0
- package/skill/references/types/TPCB_LayersOfObject.md +13 -0
- package/skill/references/types/TPCB_LayersOfPad.md +12 -0
- package/skill/references/types/TPCB_LayersOfRegion.md +12 -0
- package/skill/references/types/TPCB_NumberOfCopperLayers.md +10 -0
- package/skill/references/types/TPCB_PolygonSourceArray.md +83 -0
- package/skill/references/types/TPCB_PrimitiveDimensionCoordinateSet.md +67 -0
- package/skill/references/types/TPCB_PrimitivePadHole.md +31 -0
- package/skill/references/types/TPCB_PrimitivePadShape.md +62 -0
- package/skill/references/types/TPCB_PrimitiveSpecialPadShape.md +20 -0
- package/skill/references/types/TSYS_MathPolygonGroup.md +16 -0
- package/skill/references/types/TSYS_MathPolygonInput.md +21 -0
- package/skill/references/types/TSYS_PcbComparisonErrorCode.md +10 -0
- package/skill/references/types/TSYS_ShortcutKeys.md +97 -0
- package/skill/user-guide/using-extension.md +47 -0
|
@@ -0,0 +1,1754 @@
|
|
|
1
|
+
# PCB\_Document class
|
|
2
|
+
|
|
3
|
+
PCB & footprint / document operation class
|
|
4
|
+
|
|
5
|
+
## Signature
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
class PCB_Document
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Remarks
|
|
12
|
+
|
|
13
|
+
Operations performed on the design document as a whole
|
|
14
|
+
|
|
15
|
+
## Methods
|
|
16
|
+
|
|
17
|
+
<table><thead><tr><th>
|
|
18
|
+
|
|
19
|
+
Method
|
|
20
|
+
|
|
21
|
+
</th><th>
|
|
22
|
+
|
|
23
|
+
Modifiers
|
|
24
|
+
|
|
25
|
+
</th><th>
|
|
26
|
+
|
|
27
|
+
Description
|
|
28
|
+
|
|
29
|
+
</th></tr></thead>
|
|
30
|
+
<tbody><tr><td>
|
|
31
|
+
|
|
32
|
+
[autoLayout()](./PCB_Document.md)
|
|
33
|
+
|
|
34
|
+
</td><td>
|
|
35
|
+
|
|
36
|
+
</td><td>
|
|
37
|
+
|
|
38
|
+
**_(BETA)_** Auto layout
|
|
39
|
+
|
|
40
|
+
</td></tr>
|
|
41
|
+
<tr><td>
|
|
42
|
+
|
|
43
|
+
[autoRouting(props)](./PCB_Document.md)
|
|
44
|
+
|
|
45
|
+
</td><td>
|
|
46
|
+
|
|
47
|
+
</td><td>
|
|
48
|
+
|
|
49
|
+
**_(BETA)_** Auto routing
|
|
50
|
+
|
|
51
|
+
</td></tr>
|
|
52
|
+
<tr><td>
|
|
53
|
+
|
|
54
|
+
[clearRouting(type)](./PCB_Document.md)
|
|
55
|
+
|
|
56
|
+
</td><td>
|
|
57
|
+
|
|
58
|
+
</td><td>
|
|
59
|
+
|
|
60
|
+
**_(BETA)_** Clear routing
|
|
61
|
+
|
|
62
|
+
</td></tr>
|
|
63
|
+
<tr><td>
|
|
64
|
+
|
|
65
|
+
[convertCanvasOriginToDataOrigin(x, y)](./PCB_Document.md)
|
|
66
|
+
|
|
67
|
+
</td><td>
|
|
68
|
+
|
|
69
|
+
</td><td>
|
|
70
|
+
|
|
71
|
+
Input a canvas coordinate and return the data coordinate corresponding to that coordinate
|
|
72
|
+
|
|
73
|
+
</td></tr>
|
|
74
|
+
<tr><td>
|
|
75
|
+
|
|
76
|
+
[convertDataOriginToCanvasOrigin(x, y)](./PCB_Document.md)
|
|
77
|
+
|
|
78
|
+
</td><td>
|
|
79
|
+
|
|
80
|
+
</td><td>
|
|
81
|
+
|
|
82
|
+
Input a data coordinate and return the canvas coordinate corresponding to that coordinate
|
|
83
|
+
|
|
84
|
+
</td></tr>
|
|
85
|
+
<tr><td>
|
|
86
|
+
|
|
87
|
+
[getCalculatingRatlineStatus()](./PCB_Document.md)
|
|
88
|
+
|
|
89
|
+
</td><td>
|
|
90
|
+
|
|
91
|
+
</td><td>
|
|
92
|
+
|
|
93
|
+
Get the current ratline calculation function status
|
|
94
|
+
|
|
95
|
+
</td></tr>
|
|
96
|
+
<tr><td>
|
|
97
|
+
|
|
98
|
+
[getCanvasOrigin()](./PCB_Document.md)
|
|
99
|
+
|
|
100
|
+
</td><td>
|
|
101
|
+
|
|
102
|
+
</td><td>
|
|
103
|
+
|
|
104
|
+
Get the offset coordinate of the canvas origin relative to the data origin
|
|
105
|
+
|
|
106
|
+
</td></tr>
|
|
107
|
+
<tr><td>
|
|
108
|
+
|
|
109
|
+
[getCanvasUpdateCalculationStatus()](./PCB_Document.md)
|
|
110
|
+
|
|
111
|
+
</td><td>
|
|
112
|
+
|
|
113
|
+
</td><td>
|
|
114
|
+
|
|
115
|
+
**_(BETA)_** Query the current canvas update calculation status
|
|
116
|
+
|
|
117
|
+
</td></tr>
|
|
118
|
+
<tr><td>
|
|
119
|
+
|
|
120
|
+
[getCurrentFilterConfiguration()](./PCB_Document.md)
|
|
121
|
+
|
|
122
|
+
</td><td>
|
|
123
|
+
|
|
124
|
+
</td><td>
|
|
125
|
+
|
|
126
|
+
**_(BETA)_** Get Current canvas filter configuration
|
|
127
|
+
|
|
128
|
+
</td></tr>
|
|
129
|
+
<tr><td>
|
|
130
|
+
|
|
131
|
+
[getPrimitiveAtPoint(x, y)](./PCB_Document.md)
|
|
132
|
+
|
|
133
|
+
</td><td>
|
|
134
|
+
|
|
135
|
+
</td><td>
|
|
136
|
+
|
|
137
|
+
**_(BETA)_** Get The primitive at the coordinate point
|
|
138
|
+
|
|
139
|
+
</td></tr>
|
|
140
|
+
<tr><td>
|
|
141
|
+
|
|
142
|
+
[getPrimitivesInRegion(left, right, top, bottom, leftToRight)](./PCB_Document.md)
|
|
143
|
+
|
|
144
|
+
</td><td>
|
|
145
|
+
|
|
146
|
+
</td><td>
|
|
147
|
+
|
|
148
|
+
**_(BETA)_** Get All primitives in the region
|
|
149
|
+
|
|
150
|
+
</td></tr>
|
|
151
|
+
<tr><td>
|
|
152
|
+
|
|
153
|
+
[importAutoLayoutJsonFile(autoLayoutFile)](./PCB_Document.md)
|
|
154
|
+
|
|
155
|
+
</td><td>
|
|
156
|
+
|
|
157
|
+
</td><td>
|
|
158
|
+
|
|
159
|
+
**_(BETA)_** Import auto layout file (JSON)
|
|
160
|
+
|
|
161
|
+
</td></tr>
|
|
162
|
+
<tr><td>
|
|
163
|
+
|
|
164
|
+
[importAutoRouteJsonFile(autoRouteFile)](./PCB_Document.md)
|
|
165
|
+
|
|
166
|
+
</td><td>
|
|
167
|
+
|
|
168
|
+
</td><td>
|
|
169
|
+
|
|
170
|
+
**_(BETA)_** Import auto routing file (JSON)
|
|
171
|
+
|
|
172
|
+
</td></tr>
|
|
173
|
+
<tr><td>
|
|
174
|
+
|
|
175
|
+
[importAutoRouteSesFile(autoRouteFile)](./PCB_Document.md)
|
|
176
|
+
|
|
177
|
+
</td><td>
|
|
178
|
+
|
|
179
|
+
</td><td>
|
|
180
|
+
|
|
181
|
+
**_(BETA)_** Import auto routing file (SES)
|
|
182
|
+
|
|
183
|
+
</td></tr>
|
|
184
|
+
<tr><td>
|
|
185
|
+
|
|
186
|
+
[importChanges(uuid)](./PCB_Document.md)
|
|
187
|
+
|
|
188
|
+
</td><td>
|
|
189
|
+
|
|
190
|
+
</td><td>
|
|
191
|
+
|
|
192
|
+
Import changes from the schematic
|
|
193
|
+
|
|
194
|
+
</td></tr>
|
|
195
|
+
<tr><td>
|
|
196
|
+
|
|
197
|
+
[navigateToCoordinates(x, y)](./PCB_Document.md)
|
|
198
|
+
|
|
199
|
+
</td><td>
|
|
200
|
+
|
|
201
|
+
</td><td>
|
|
202
|
+
|
|
203
|
+
Locate to canvas coordinate
|
|
204
|
+
|
|
205
|
+
</td></tr>
|
|
206
|
+
<tr><td>
|
|
207
|
+
|
|
208
|
+
[navigateToRegion(left, right, top, bottom)](./PCB_Document.md)
|
|
209
|
+
|
|
210
|
+
</td><td>
|
|
211
|
+
|
|
212
|
+
</td><td>
|
|
213
|
+
|
|
214
|
+
**_(BETA)_** Locate to canvas region
|
|
215
|
+
|
|
216
|
+
</td></tr>
|
|
217
|
+
<tr><td>
|
|
218
|
+
|
|
219
|
+
[save()](./PCB_Document.md)
|
|
220
|
+
|
|
221
|
+
</td><td>
|
|
222
|
+
|
|
223
|
+
</td><td>
|
|
224
|
+
|
|
225
|
+
Save Document
|
|
226
|
+
|
|
227
|
+
</td></tr>
|
|
228
|
+
<tr><td>
|
|
229
|
+
|
|
230
|
+
[setCanvasOrigin(offsetX, offsetY)](./PCB_Document.md)
|
|
231
|
+
|
|
232
|
+
</td><td>
|
|
233
|
+
|
|
234
|
+
</td><td>
|
|
235
|
+
|
|
236
|
+
Set the offset coordinate of the canvas origin relative to the data origin
|
|
237
|
+
|
|
238
|
+
</td></tr>
|
|
239
|
+
<tr><td>
|
|
240
|
+
|
|
241
|
+
[startCalculatingRatline()](./PCB_Document.md)
|
|
242
|
+
|
|
243
|
+
</td><td>
|
|
244
|
+
|
|
245
|
+
</td><td>
|
|
246
|
+
|
|
247
|
+
Start the ratline calculation function
|
|
248
|
+
|
|
249
|
+
</td></tr>
|
|
250
|
+
<tr><td>
|
|
251
|
+
|
|
252
|
+
[startCanvasUpdateCalculation()](./PCB_Document.md)
|
|
253
|
+
|
|
254
|
+
</td><td>
|
|
255
|
+
|
|
256
|
+
</td><td>
|
|
257
|
+
|
|
258
|
+
**_(BETA)_** Start canvas update calculation
|
|
259
|
+
|
|
260
|
+
</td></tr>
|
|
261
|
+
<tr><td>
|
|
262
|
+
|
|
263
|
+
[stopCalculatingRatline()](./PCB_Document.md)
|
|
264
|
+
|
|
265
|
+
</td><td>
|
|
266
|
+
|
|
267
|
+
</td><td>
|
|
268
|
+
|
|
269
|
+
Stop the ratline calculation function
|
|
270
|
+
|
|
271
|
+
</td></tr>
|
|
272
|
+
<tr><td>
|
|
273
|
+
|
|
274
|
+
[stopCanvasUpdateCalculation()](./PCB_Document.md)
|
|
275
|
+
|
|
276
|
+
</td><td>
|
|
277
|
+
|
|
278
|
+
</td><td>
|
|
279
|
+
|
|
280
|
+
**_(BETA)_** Stop canvas update calculation
|
|
281
|
+
|
|
282
|
+
</td></tr>
|
|
283
|
+
<tr><td>
|
|
284
|
+
|
|
285
|
+
[triggerCanvasUpdateCalculation()](./PCB_Document.md)
|
|
286
|
+
|
|
287
|
+
</td><td>
|
|
288
|
+
|
|
289
|
+
</td><td>
|
|
290
|
+
|
|
291
|
+
**_(BETA)_** Trigger a canvas update calculation
|
|
292
|
+
|
|
293
|
+
</td></tr>
|
|
294
|
+
<tr><td>
|
|
295
|
+
|
|
296
|
+
[zoomToBoardOutline()](./PCB_Document.md)
|
|
297
|
+
|
|
298
|
+
</td><td>
|
|
299
|
+
|
|
300
|
+
</td><td>
|
|
301
|
+
|
|
302
|
+
**_(BETA)_** Zoom to the board outline (fit the board outline)
|
|
303
|
+
|
|
304
|
+
</td></tr>
|
|
305
|
+
</tbody></table>
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
## 方法详情
|
|
310
|
+
|
|
311
|
+
### autolayout
|
|
312
|
+
|
|
313
|
+
# PCB\_Document.autoLayout() method
|
|
314
|
+
|
|
315
|
+
> 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.
|
|
316
|
+
|
|
317
|
+
Auto layout
|
|
318
|
+
|
|
319
|
+
## Signature
|
|
320
|
+
|
|
321
|
+
```typescript
|
|
322
|
+
function autoLayout(): Promise<IPCB_AutoLayoutResult>;
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
## Returns
|
|
326
|
+
|
|
327
|
+
Promise<[IPCB\_AutoLayoutResult](../interfaces/IPCB_AutoLayoutResult.md)<!-- -->>
|
|
328
|
+
|
|
329
|
+
Auto layout result
|
|
330
|
+
|
|
331
|
+
## Remarks
|
|
332
|
+
|
|
333
|
+
ADD since EDA v3.2.162
|
|
334
|
+
|
|
335
|
+
### autorouting
|
|
336
|
+
|
|
337
|
+
# PCB\_Document.autoRouting() method
|
|
338
|
+
|
|
339
|
+
> 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.
|
|
340
|
+
|
|
341
|
+
Auto routing
|
|
342
|
+
|
|
343
|
+
## Signature
|
|
344
|
+
|
|
345
|
+
```typescript
|
|
346
|
+
function autoRouting(props?: IPCB_AutoRoutingProps): Promise<IPCB_AutoRoutingResult>;
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
## Parameters
|
|
350
|
+
|
|
351
|
+
<table><thead><tr><th>
|
|
352
|
+
|
|
353
|
+
Parameter
|
|
354
|
+
|
|
355
|
+
</th><th>
|
|
356
|
+
|
|
357
|
+
Type
|
|
358
|
+
|
|
359
|
+
</th><th>
|
|
360
|
+
|
|
361
|
+
Description
|
|
362
|
+
|
|
363
|
+
</th></tr></thead>
|
|
364
|
+
<tbody><tr><td>
|
|
365
|
+
|
|
366
|
+
props
|
|
367
|
+
|
|
368
|
+
</td><td>
|
|
369
|
+
|
|
370
|
+
[IPCB\_AutoRoutingProps](../interfaces/IPCB_AutoRoutingProps.md)
|
|
371
|
+
|
|
372
|
+
</td><td>
|
|
373
|
+
|
|
374
|
+
_(Optional)_ Auto routing parameter
|
|
375
|
+
|
|
376
|
+
</td></tr>
|
|
377
|
+
</tbody></table>
|
|
378
|
+
|
|
379
|
+
## Returns
|
|
380
|
+
|
|
381
|
+
Promise<[IPCB\_AutoRoutingResult](../interfaces/IPCB_AutoRoutingResult.md)<!-- -->>
|
|
382
|
+
|
|
383
|
+
Auto routing result
|
|
384
|
+
|
|
385
|
+
## Remarks
|
|
386
|
+
|
|
387
|
+
If no parameters are passed in, auto routing will be performed for all unrouted nets ADD since EDA v3.2.162
|
|
388
|
+
|
|
389
|
+
## Example
|
|
390
|
+
|
|
391
|
+
```javascript
|
|
392
|
+
// 对所有未布线的网络进行自动布线
|
|
393
|
+
const result = await eda.pcb_Document.autoRouting();
|
|
394
|
+
console.log(`布线完成:${result.routedNets}/${result.totalNets}`);
|
|
395
|
+
|
|
396
|
+
// 指定网络进行自动布线,并忽略部分网络
|
|
397
|
+
const result = await eda.pcb_Document.autoRouting({
|
|
398
|
+
nets: ['VCC', 'GND', 'SDA', 'SCL'],
|
|
399
|
+
ignoreNets: ['NC'],
|
|
400
|
+
cornerStyle: EPCB_AutoRoutingCornerStyle.DEGREE_45,
|
|
401
|
+
optimization: EPCB_AutoRoutingOptimization.COMPLETION,
|
|
402
|
+
});
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
### clearrouting
|
|
406
|
+
|
|
407
|
+
# PCB\_Document.clearRouting() method
|
|
408
|
+
|
|
409
|
+
> 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.
|
|
410
|
+
|
|
411
|
+
Clear routing
|
|
412
|
+
|
|
413
|
+
## Signature
|
|
414
|
+
|
|
415
|
+
```typescript
|
|
416
|
+
function clearRouting(type?: 'all' | 'net' | 'connection'): Promise<boolean>;
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
## Parameters
|
|
420
|
+
|
|
421
|
+
<table><thead><tr><th>
|
|
422
|
+
|
|
423
|
+
Parameter
|
|
424
|
+
|
|
425
|
+
</th><th>
|
|
426
|
+
|
|
427
|
+
Type
|
|
428
|
+
|
|
429
|
+
</th><th>
|
|
430
|
+
|
|
431
|
+
Description
|
|
432
|
+
|
|
433
|
+
</th></tr></thead>
|
|
434
|
+
<tbody><tr><td>
|
|
435
|
+
|
|
436
|
+
type
|
|
437
|
+
|
|
438
|
+
</td><td>
|
|
439
|
+
|
|
440
|
+
'all' \| 'net' \| 'connection'
|
|
441
|
+
|
|
442
|
+
</td><td>
|
|
443
|
+
|
|
444
|
+
_(Optional)_ Clear type. If you need to specify a clear type, select the specified primitive in advance
|
|
445
|
+
|
|
446
|
+
</td></tr>
|
|
447
|
+
</tbody></table>
|
|
448
|
+
|
|
449
|
+
## Returns
|
|
450
|
+
|
|
451
|
+
Promise<boolean>
|
|
452
|
+
|
|
453
|
+
### convertcanvasorigintodataorigin
|
|
454
|
+
|
|
455
|
+
# PCB\_Document.convertCanvasOriginToDataOrigin() method
|
|
456
|
+
|
|
457
|
+
Input a canvas coordinate and return the data coordinate corresponding to that coordinate
|
|
458
|
+
|
|
459
|
+
## Signature
|
|
460
|
+
|
|
461
|
+
```typescript
|
|
462
|
+
function convertCanvasOriginToDataOrigin(x: number, y: number): Promise<{ x: number; y: number }>;
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
## Parameters
|
|
466
|
+
|
|
467
|
+
<table><thead><tr><th>
|
|
468
|
+
|
|
469
|
+
Parameter
|
|
470
|
+
|
|
471
|
+
</th><th>
|
|
472
|
+
|
|
473
|
+
Type
|
|
474
|
+
|
|
475
|
+
</th><th>
|
|
476
|
+
|
|
477
|
+
Description
|
|
478
|
+
|
|
479
|
+
</th></tr></thead>
|
|
480
|
+
<tbody><tr><td>
|
|
481
|
+
|
|
482
|
+
x
|
|
483
|
+
|
|
484
|
+
</td><td>
|
|
485
|
+
|
|
486
|
+
number
|
|
487
|
+
|
|
488
|
+
</td><td>
|
|
489
|
+
|
|
490
|
+
</td></tr>
|
|
491
|
+
<tr><td>
|
|
492
|
+
|
|
493
|
+
y
|
|
494
|
+
|
|
495
|
+
</td><td>
|
|
496
|
+
|
|
497
|
+
number
|
|
498
|
+
|
|
499
|
+
</td><td>
|
|
500
|
+
|
|
501
|
+
</td></tr>
|
|
502
|
+
</tbody></table>
|
|
503
|
+
|
|
504
|
+
## Returns
|
|
505
|
+
|
|
506
|
+
Promise<{ x: number; y: number }>
|
|
507
|
+
|
|
508
|
+
Data origin coordinate
|
|
509
|
+
|
|
510
|
+
## Remarks
|
|
511
|
+
|
|
512
|
+
The coordinates displayed on the EasyEDA front end are all relative to the canvas origin; the EasyEDA API uses the data origin; when creating a PCB, the default canvas origin equals the data origin
|
|
513
|
+
|
|
514
|
+
## Example
|
|
515
|
+
|
|
516
|
+
```javascript
|
|
517
|
+
// 1. 创建测试 PCB 并打开(文档级 API 作用于当前激活的 PCB)
|
|
518
|
+
const pcbUuid = await eda.dmt_Pcb.createPcb();
|
|
519
|
+
await new Promise(r => setTimeout(r, 1500));
|
|
520
|
+
await eda.dmt_EditorControl.openDocument(pcbUuid);
|
|
521
|
+
await new Promise(r => setTimeout(r, 1000));
|
|
522
|
+
|
|
523
|
+
// 2. 换算画布坐标 (300, 400)。新建 PCB 画布原点与数据原点重合,换算值不变
|
|
524
|
+
const before = await eda.pcb_Document.convertCanvasOriginToDataOrigin(300, 400);
|
|
525
|
+
console.log('before:', JSON.stringify(before));
|
|
526
|
+
|
|
527
|
+
// 3. 设置画布原点偏移后再换算同一坐标,观察映射随之变化
|
|
528
|
+
await eda.pcb_Document.setCanvasOrigin(50, 100);
|
|
529
|
+
const after = await eda.pcb_Document.convertCanvasOriginToDataOrigin(300, 400);
|
|
530
|
+
console.log('after:', JSON.stringify(after));
|
|
531
|
+
|
|
532
|
+
// 4. 清理测试 PCB(偏移随文档一起删除)
|
|
533
|
+
await eda.dmt_Pcb.deletePcb(pcbUuid);
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
### convertdataorigintocanvasorigin
|
|
537
|
+
|
|
538
|
+
# PCB\_Document.convertDataOriginToCanvasOrigin() method
|
|
539
|
+
|
|
540
|
+
Input a data coordinate and return the canvas coordinate corresponding to that coordinate
|
|
541
|
+
|
|
542
|
+
## Signature
|
|
543
|
+
|
|
544
|
+
```typescript
|
|
545
|
+
function convertDataOriginToCanvasOrigin(x: number, y: number): Promise<{ x: number; y: number }>;
|
|
546
|
+
```
|
|
547
|
+
|
|
548
|
+
## Parameters
|
|
549
|
+
|
|
550
|
+
<table><thead><tr><th>
|
|
551
|
+
|
|
552
|
+
Parameter
|
|
553
|
+
|
|
554
|
+
</th><th>
|
|
555
|
+
|
|
556
|
+
Type
|
|
557
|
+
|
|
558
|
+
</th><th>
|
|
559
|
+
|
|
560
|
+
Description
|
|
561
|
+
|
|
562
|
+
</th></tr></thead>
|
|
563
|
+
<tbody><tr><td>
|
|
564
|
+
|
|
565
|
+
x
|
|
566
|
+
|
|
567
|
+
</td><td>
|
|
568
|
+
|
|
569
|
+
number
|
|
570
|
+
|
|
571
|
+
</td><td>
|
|
572
|
+
|
|
573
|
+
Data origin X
|
|
574
|
+
|
|
575
|
+
</td></tr>
|
|
576
|
+
<tr><td>
|
|
577
|
+
|
|
578
|
+
y
|
|
579
|
+
|
|
580
|
+
</td><td>
|
|
581
|
+
|
|
582
|
+
number
|
|
583
|
+
|
|
584
|
+
</td><td>
|
|
585
|
+
|
|
586
|
+
Data origin Y
|
|
587
|
+
|
|
588
|
+
</td></tr>
|
|
589
|
+
</tbody></table>
|
|
590
|
+
|
|
591
|
+
## Returns
|
|
592
|
+
|
|
593
|
+
Promise<{ x: number; y: number }>
|
|
594
|
+
|
|
595
|
+
Canvas origin coordinate
|
|
596
|
+
|
|
597
|
+
## Remarks
|
|
598
|
+
|
|
599
|
+
The coordinates displayed on the EasyEDA front end are all relative to the canvas origin; the EasyEDA API uses the data origin; when creating a PCB, the default canvas origin equals the data origin
|
|
600
|
+
|
|
601
|
+
## Example
|
|
602
|
+
|
|
603
|
+
```javascript
|
|
604
|
+
// 1. 创建测试 PCB 并打开(文档级 API 作用于当前激活的 PCB)
|
|
605
|
+
const pcbUuid = await eda.dmt_Pcb.createPcb();
|
|
606
|
+
await new Promise(r => setTimeout(r, 1500));
|
|
607
|
+
await eda.dmt_EditorControl.openDocument(pcbUuid);
|
|
608
|
+
await new Promise(r => setTimeout(r, 1000));
|
|
609
|
+
|
|
610
|
+
// 2. 换算数据坐标 (300, 400)。新建 PCB 画布原点与数据原点重合,换算值不变
|
|
611
|
+
const before = await eda.pcb_Document.convertDataOriginToCanvasOrigin(300, 400);
|
|
612
|
+
console.log('before:', JSON.stringify(before));
|
|
613
|
+
|
|
614
|
+
// 3. 设置画布原点偏移后再换算同一坐标,观察映射随之变化
|
|
615
|
+
await eda.pcb_Document.setCanvasOrigin(50, 100);
|
|
616
|
+
const after = await eda.pcb_Document.convertDataOriginToCanvasOrigin(300, 400);
|
|
617
|
+
console.log('after:', JSON.stringify(after));
|
|
618
|
+
|
|
619
|
+
// 4. 清理测试 PCB(偏移随文档一起删除)
|
|
620
|
+
await eda.dmt_Pcb.deletePcb(pcbUuid);
|
|
621
|
+
```
|
|
622
|
+
|
|
623
|
+
### getcalculatingratlinestatus
|
|
624
|
+
|
|
625
|
+
# PCB\_Document.getCalculatingRatlineStatus() method
|
|
626
|
+
|
|
627
|
+
> Warning: This API is now obsolete.
|
|
628
|
+
>
|
|
629
|
+
> since EDA v4.2
|
|
630
|
+
|
|
631
|
+
Get the current ratline calculation function status
|
|
632
|
+
|
|
633
|
+
## Signature
|
|
634
|
+
|
|
635
|
+
```typescript
|
|
636
|
+
function getCalculatingRatlineStatus(): Promise<
|
|
637
|
+
EPCB_DocumentRatlineCalculatingActiveStatus | undefined
|
|
638
|
+
>;
|
|
639
|
+
```
|
|
640
|
+
|
|
641
|
+
## Returns
|
|
642
|
+
|
|
643
|
+
Promise<[EPCB\_DocumentRatlineCalculatingActiveStatus](../enums/EPCB_DocumentRatlineCalculatingActiveStatus.md) \| undefined>
|
|
644
|
+
|
|
645
|
+
Function state
|
|
646
|
+
|
|
647
|
+
### getcanvasorigin
|
|
648
|
+
|
|
649
|
+
# PCB\_Document.getCanvasOrigin() method
|
|
650
|
+
|
|
651
|
+
Get the offset coordinate of the canvas origin relative to the data origin
|
|
652
|
+
|
|
653
|
+
## Signature
|
|
654
|
+
|
|
655
|
+
```typescript
|
|
656
|
+
function getCanvasOrigin(): Promise<{ offsetX: number; offsetY: number }>;
|
|
657
|
+
```
|
|
658
|
+
|
|
659
|
+
## Returns
|
|
660
|
+
|
|
661
|
+
Promise<{ offsetX: number; offsetY: number }>
|
|
662
|
+
|
|
663
|
+
The offset coordinate of the canvas origin relative to the data origin
|
|
664
|
+
|
|
665
|
+
## Remarks
|
|
666
|
+
|
|
667
|
+
The coordinates displayed on the EasyEDA Pro front end are all relative to the canvas origin;
|
|
668
|
+
|
|
669
|
+
The EasyEDA Pro API uses the data origin;
|
|
670
|
+
|
|
671
|
+
If the returned data is `{ canvasOriginOffsetX: 100, canvasOriginOffsetY: 200 }`<!-- -->, it means the canvas origin is at a position 100 units to the right and 200 units up from the data origin;
|
|
672
|
+
|
|
673
|
+
The units here are data-level units, which are equivalent to mil on the canvas level in span
|
|
674
|
+
|
|
675
|
+
### getcanvasupdatecalculationstatus
|
|
676
|
+
|
|
677
|
+
# PCB\_Document.getCanvasUpdateCalculationStatus() method
|
|
678
|
+
|
|
679
|
+
> 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.
|
|
680
|
+
|
|
681
|
+
Query the current canvas update calculation status
|
|
682
|
+
|
|
683
|
+
## Signature
|
|
684
|
+
|
|
685
|
+
```typescript
|
|
686
|
+
function getCanvasUpdateCalculationStatus(): Promise<
|
|
687
|
+
EPCB_DocumentCanvasUpdateCalculationActiveStatus | undefined
|
|
688
|
+
>;
|
|
689
|
+
```
|
|
690
|
+
|
|
691
|
+
## Returns
|
|
692
|
+
|
|
693
|
+
Promise<[EPCB\_DocumentCanvasUpdateCalculationActiveStatus](../enums/EPCB_DocumentCanvasUpdateCalculationActiveStatus.md) \| undefined>
|
|
694
|
+
|
|
695
|
+
Canvas update calculation function status
|
|
696
|
+
|
|
697
|
+
## Remarks
|
|
698
|
+
|
|
699
|
+
Canvas update calculation includes canvas render updates, property panel updates, etc. ADD since EDA v4.2
|
|
700
|
+
|
|
701
|
+
### getcurrentfilterconfiguration
|
|
702
|
+
|
|
703
|
+
# PCB\_Document.getCurrentFilterConfiguration() method
|
|
704
|
+
|
|
705
|
+
> 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.
|
|
706
|
+
|
|
707
|
+
Get Current canvas filter configuration
|
|
708
|
+
|
|
709
|
+
## Signature
|
|
710
|
+
|
|
711
|
+
```typescript
|
|
712
|
+
function getCurrentFilterConfiguration(): Promise<Record<string, any> | undefined>;
|
|
713
|
+
```
|
|
714
|
+
|
|
715
|
+
## Returns
|
|
716
|
+
|
|
717
|
+
Promise<Record<string, any> \| undefined>
|
|
718
|
+
|
|
719
|
+
Current canvas filter configuration; `undefined` indicates that the retrieval failed
|
|
720
|
+
|
|
721
|
+
### getprimitiveatpoint
|
|
722
|
+
|
|
723
|
+
# PCB\_Document.getPrimitiveAtPoint() method
|
|
724
|
+
|
|
725
|
+
> 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.
|
|
726
|
+
|
|
727
|
+
Get The primitive at the coordinate point
|
|
728
|
+
|
|
729
|
+
## Signature
|
|
730
|
+
|
|
731
|
+
```typescript
|
|
732
|
+
function getPrimitiveAtPoint(x: number, y: number): Promise<IPCB_Primitive | undefined>;
|
|
733
|
+
```
|
|
734
|
+
|
|
735
|
+
## Parameters
|
|
736
|
+
|
|
737
|
+
<table><thead><tr><th>
|
|
738
|
+
|
|
739
|
+
Parameter
|
|
740
|
+
|
|
741
|
+
</th><th>
|
|
742
|
+
|
|
743
|
+
Type
|
|
744
|
+
|
|
745
|
+
</th><th>
|
|
746
|
+
|
|
747
|
+
Description
|
|
748
|
+
|
|
749
|
+
</th></tr></thead>
|
|
750
|
+
<tbody><tr><td>
|
|
751
|
+
|
|
752
|
+
x
|
|
753
|
+
|
|
754
|
+
</td><td>
|
|
755
|
+
|
|
756
|
+
number
|
|
757
|
+
|
|
758
|
+
</td><td>
|
|
759
|
+
|
|
760
|
+
Coordinate point X
|
|
761
|
+
|
|
762
|
+
</td></tr>
|
|
763
|
+
<tr><td>
|
|
764
|
+
|
|
765
|
+
y
|
|
766
|
+
|
|
767
|
+
</td><td>
|
|
768
|
+
|
|
769
|
+
number
|
|
770
|
+
|
|
771
|
+
</td><td>
|
|
772
|
+
|
|
773
|
+
Coordinate point Y
|
|
774
|
+
|
|
775
|
+
</td></tr>
|
|
776
|
+
</tbody></table>
|
|
777
|
+
|
|
778
|
+
## Returns
|
|
779
|
+
|
|
780
|
+
Promise<[IPCB\_Primitive](../interfaces/IPCB_Primitive.md) \| undefined>
|
|
781
|
+
|
|
782
|
+
The primitive at the coordinate point. If no primitive can be found at the coordinate point, `undefined` will be returned
|
|
783
|
+
|
|
784
|
+
## Remarks
|
|
785
|
+
|
|
786
|
+
This operation is similar to clicking with the mouse on the front end; it will get the primitive at the specified coordinate point
|
|
787
|
+
|
|
788
|
+
## Example
|
|
789
|
+
|
|
790
|
+
```javascript
|
|
791
|
+
// 1. 创建测试 PCB 并打开
|
|
792
|
+
const pcbUuid = await eda.dmt_Pcb.createPcb();
|
|
793
|
+
await new Promise(r => setTimeout(r, 1500));
|
|
794
|
+
await eda.dmt_EditorControl.openDocument(pcbUuid);
|
|
795
|
+
await new Promise(r => setTimeout(r, 1000));
|
|
796
|
+
|
|
797
|
+
// 2. 在 (500, 500) 放一个测试焊盘作为拾取目标
|
|
798
|
+
const pad = await eda.pcb_PrimitivePad.create(1, '1', 500, 500, 0, ['ELLIPSE', 60, 60], '', null, 0, 0, 0, false, 0);
|
|
799
|
+
const padId = pad.getState_PrimitiveId();
|
|
800
|
+
|
|
801
|
+
// 3. 拾取焊盘中心点,返回该焊盘图元
|
|
802
|
+
const hit = await eda.pcb_Document.getPrimitiveAtPoint(500, 500);
|
|
803
|
+
console.log('hitPrimitiveId:', hit.getState_PrimitiveId());
|
|
804
|
+
|
|
805
|
+
// 4. 拾取空白坐标点,返回 undefined
|
|
806
|
+
const miss = await eda.pcb_Document.getPrimitiveAtPoint(90000, 90000);
|
|
807
|
+
console.log('空白坐标点:', miss === undefined ? '未找到图元' : '找到图元');
|
|
808
|
+
|
|
809
|
+
// 5. 清理测试图元和测试 PCB
|
|
810
|
+
await eda.pcb_PrimitivePad.delete([padId]);
|
|
811
|
+
await eda.dmt_Pcb.deletePcb(pcbUuid);
|
|
812
|
+
```
|
|
813
|
+
|
|
814
|
+
### getprimitivesinregion
|
|
815
|
+
|
|
816
|
+
# PCB\_Document.getPrimitivesInRegion() method
|
|
817
|
+
|
|
818
|
+
> 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.
|
|
819
|
+
|
|
820
|
+
Get All primitives in the region
|
|
821
|
+
|
|
822
|
+
## Signature
|
|
823
|
+
|
|
824
|
+
```typescript
|
|
825
|
+
function getPrimitivesInRegion(
|
|
826
|
+
left: number,
|
|
827
|
+
right: number,
|
|
828
|
+
top: number,
|
|
829
|
+
bottom: number,
|
|
830
|
+
leftToRight?: boolean,
|
|
831
|
+
): Promise<Array<IPCB_Primitive>>;
|
|
832
|
+
```
|
|
833
|
+
|
|
834
|
+
## Parameters
|
|
835
|
+
|
|
836
|
+
<table><thead><tr><th>
|
|
837
|
+
|
|
838
|
+
Parameter
|
|
839
|
+
|
|
840
|
+
</th><th>
|
|
841
|
+
|
|
842
|
+
Type
|
|
843
|
+
|
|
844
|
+
</th><th>
|
|
845
|
+
|
|
846
|
+
Description
|
|
847
|
+
|
|
848
|
+
</th></tr></thead>
|
|
849
|
+
<tbody><tr><td>
|
|
850
|
+
|
|
851
|
+
left
|
|
852
|
+
|
|
853
|
+
</td><td>
|
|
854
|
+
|
|
855
|
+
number
|
|
856
|
+
|
|
857
|
+
</td><td>
|
|
858
|
+
|
|
859
|
+
First X coordinate of the rectangle
|
|
860
|
+
|
|
861
|
+
</td></tr>
|
|
862
|
+
<tr><td>
|
|
863
|
+
|
|
864
|
+
right
|
|
865
|
+
|
|
866
|
+
</td><td>
|
|
867
|
+
|
|
868
|
+
number
|
|
869
|
+
|
|
870
|
+
</td><td>
|
|
871
|
+
|
|
872
|
+
Second X coordinate of the rectangle
|
|
873
|
+
|
|
874
|
+
</td></tr>
|
|
875
|
+
<tr><td>
|
|
876
|
+
|
|
877
|
+
top
|
|
878
|
+
|
|
879
|
+
</td><td>
|
|
880
|
+
|
|
881
|
+
number
|
|
882
|
+
|
|
883
|
+
</td><td>
|
|
884
|
+
|
|
885
|
+
First Y coordinate of the rectangle
|
|
886
|
+
|
|
887
|
+
</td></tr>
|
|
888
|
+
<tr><td>
|
|
889
|
+
|
|
890
|
+
bottom
|
|
891
|
+
|
|
892
|
+
</td><td>
|
|
893
|
+
|
|
894
|
+
number
|
|
895
|
+
|
|
896
|
+
</td><td>
|
|
897
|
+
|
|
898
|
+
Second Y coordinate of the rectangle
|
|
899
|
+
|
|
900
|
+
</td></tr>
|
|
901
|
+
<tr><td>
|
|
902
|
+
|
|
903
|
+
leftToRight
|
|
904
|
+
|
|
905
|
+
</td><td>
|
|
906
|
+
|
|
907
|
+
boolean
|
|
908
|
+
|
|
909
|
+
</td><td>
|
|
910
|
+
|
|
911
|
+
_(Optional)_ Whether to only get primitives that are fully enclosed by the box selection. If `false`<!-- -->, primitives touched by the selection are also obtained
|
|
912
|
+
|
|
913
|
+
</td></tr>
|
|
914
|
+
</tbody></table>
|
|
915
|
+
|
|
916
|
+
## Returns
|
|
917
|
+
|
|
918
|
+
Promise<Array<[IPCB\_Primitive](../interfaces/IPCB_Primitive.md)<!-- -->>>
|
|
919
|
+
|
|
920
|
+
All primitives in the region
|
|
921
|
+
|
|
922
|
+
## Example
|
|
923
|
+
|
|
924
|
+
```javascript
|
|
925
|
+
// 1. 创建测试 PCB 并打开
|
|
926
|
+
const pcbUuid = await eda.dmt_Pcb.createPcb();
|
|
927
|
+
await new Promise(r => setTimeout(r, 1500));
|
|
928
|
+
await eda.dmt_EditorControl.openDocument(pcbUuid);
|
|
929
|
+
await new Promise(r => setTimeout(r, 1000));
|
|
930
|
+
|
|
931
|
+
// 2. 放两个测试焊盘:一个在 (500, 500),一个在 (3000, 3000)
|
|
932
|
+
const padA = await eda.pcb_PrimitivePad.create(1, '1', 500, 500, 0, ['ELLIPSE', 60, 60], '', null, 0, 0, 0, false, 0);
|
|
933
|
+
const padB = await eda.pcb_PrimitivePad.create(1, '2', 3000, 3000, 0, ['ELLIPSE', 60, 60], '', null, 0, 0, 0, false, 0);
|
|
934
|
+
|
|
935
|
+
// 3. 小区域 (0,1000,1000,0) 只盖住第一个焊盘
|
|
936
|
+
const small = await eda.pcb_Document.getPrimitivesInRegion(0, 1000, 1000, 0);
|
|
937
|
+
console.log('smallRegionCount:', small.length);
|
|
938
|
+
|
|
939
|
+
// 4. 大区域 (0,4000,4000,0) 盖住两个焊盘,完全框选模式
|
|
940
|
+
const big = await eda.pcb_Document.getPrimitivesInRegion(0, 4000, 4000, 0, true);
|
|
941
|
+
console.log('bigRegionCount:', big.length);
|
|
942
|
+
|
|
943
|
+
// 5. 清理测试图元和测试 PCB
|
|
944
|
+
await eda.pcb_PrimitivePad.delete([padA.getState_PrimitiveId(), padB.getState_PrimitiveId()]);
|
|
945
|
+
await eda.dmt_Pcb.deletePcb(pcbUuid);
|
|
946
|
+
```
|
|
947
|
+
|
|
948
|
+
### importautolayoutjsonfile
|
|
949
|
+
|
|
950
|
+
# PCB\_Document.importAutoLayoutJsonFile() method
|
|
951
|
+
|
|
952
|
+
> 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.
|
|
953
|
+
|
|
954
|
+
Import auto layout file (JSON)
|
|
955
|
+
|
|
956
|
+
## Signature
|
|
957
|
+
|
|
958
|
+
```typescript
|
|
959
|
+
function importAutoLayoutJsonFile(autoLayoutFile: File): Promise<boolean>;
|
|
960
|
+
```
|
|
961
|
+
|
|
962
|
+
## Parameters
|
|
963
|
+
|
|
964
|
+
<table><thead><tr><th>
|
|
965
|
+
|
|
966
|
+
Parameter
|
|
967
|
+
|
|
968
|
+
</th><th>
|
|
969
|
+
|
|
970
|
+
Type
|
|
971
|
+
|
|
972
|
+
</th><th>
|
|
973
|
+
|
|
974
|
+
Description
|
|
975
|
+
|
|
976
|
+
</th></tr></thead>
|
|
977
|
+
<tbody><tr><td>
|
|
978
|
+
|
|
979
|
+
autoLayoutFile
|
|
980
|
+
|
|
981
|
+
</td><td>
|
|
982
|
+
|
|
983
|
+
File
|
|
984
|
+
|
|
985
|
+
</td><td>
|
|
986
|
+
|
|
987
|
+
The JSON file to import
|
|
988
|
+
|
|
989
|
+
</td></tr>
|
|
990
|
+
</tbody></table>
|
|
991
|
+
|
|
992
|
+
## Returns
|
|
993
|
+
|
|
994
|
+
Promise<boolean>
|
|
995
|
+
|
|
996
|
+
Whether the import operation is successful
|
|
997
|
+
|
|
998
|
+
## Remarks
|
|
999
|
+
|
|
1000
|
+
You can use to read in a file
|
|
1001
|
+
|
|
1002
|
+
## Example
|
|
1003
|
+
|
|
1004
|
+
```javascript
|
|
1005
|
+
// 1. 创建测试 PCB 并打开(导入作用于当前激活的 PCB)
|
|
1006
|
+
const pcbUuid = await eda.dmt_Pcb.createPcb();
|
|
1007
|
+
await new Promise(r => setTimeout(r, 1500));
|
|
1008
|
+
await eda.dmt_EditorControl.openDocument(pcbUuid);
|
|
1009
|
+
await new Promise(r => setTimeout(r, 1000));
|
|
1010
|
+
|
|
1011
|
+
// 2. 构造布局 JSON 文件对象(真实场景:readFileFromFileSystem 读取外部导出的文件)
|
|
1012
|
+
const layoutFile = new File([JSON.stringify({})], 'auto-layout.json', { type: 'application/json' });
|
|
1013
|
+
|
|
1014
|
+
// 3. 导入自动布局文件
|
|
1015
|
+
const imported = await eda.pcb_Document.importAutoLayoutJsonFile(layoutFile);
|
|
1016
|
+
console.log('imported:', imported);
|
|
1017
|
+
|
|
1018
|
+
// 4. 清理测试 PCB
|
|
1019
|
+
await eda.dmt_Pcb.deletePcb(pcbUuid);
|
|
1020
|
+
```
|
|
1021
|
+
|
|
1022
|
+
### importautoroutejsonfile
|
|
1023
|
+
|
|
1024
|
+
# PCB\_Document.importAutoRouteJsonFile() method
|
|
1025
|
+
|
|
1026
|
+
> 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.
|
|
1027
|
+
|
|
1028
|
+
Import auto routing file (JSON)
|
|
1029
|
+
|
|
1030
|
+
## Signature
|
|
1031
|
+
|
|
1032
|
+
```typescript
|
|
1033
|
+
function importAutoRouteJsonFile(autoRouteFile: File): Promise<boolean>;
|
|
1034
|
+
```
|
|
1035
|
+
|
|
1036
|
+
## Parameters
|
|
1037
|
+
|
|
1038
|
+
<table><thead><tr><th>
|
|
1039
|
+
|
|
1040
|
+
Parameter
|
|
1041
|
+
|
|
1042
|
+
</th><th>
|
|
1043
|
+
|
|
1044
|
+
Type
|
|
1045
|
+
|
|
1046
|
+
</th><th>
|
|
1047
|
+
|
|
1048
|
+
Description
|
|
1049
|
+
|
|
1050
|
+
</th></tr></thead>
|
|
1051
|
+
<tbody><tr><td>
|
|
1052
|
+
|
|
1053
|
+
autoRouteFile
|
|
1054
|
+
|
|
1055
|
+
</td><td>
|
|
1056
|
+
|
|
1057
|
+
File
|
|
1058
|
+
|
|
1059
|
+
</td><td>
|
|
1060
|
+
|
|
1061
|
+
The JSON file to import
|
|
1062
|
+
|
|
1063
|
+
</td></tr>
|
|
1064
|
+
</tbody></table>
|
|
1065
|
+
|
|
1066
|
+
## Returns
|
|
1067
|
+
|
|
1068
|
+
Promise<boolean>
|
|
1069
|
+
|
|
1070
|
+
Whether the import operation is successful
|
|
1071
|
+
|
|
1072
|
+
## Remarks
|
|
1073
|
+
|
|
1074
|
+
You can use to read in a file
|
|
1075
|
+
|
|
1076
|
+
## Example
|
|
1077
|
+
|
|
1078
|
+
```javascript
|
|
1079
|
+
// 1. 创建测试 PCB 并打开(导入作用于当前激活的 PCB)
|
|
1080
|
+
const pcbUuid = await eda.dmt_Pcb.createPcb();
|
|
1081
|
+
await new Promise(r => setTimeout(r, 1500));
|
|
1082
|
+
await eda.dmt_EditorControl.openDocument(pcbUuid);
|
|
1083
|
+
await new Promise(r => setTimeout(r, 1000));
|
|
1084
|
+
|
|
1085
|
+
// 2. 构造布线 JSON 文件对象(真实场景:readFileFromFileSystem 读取外部导出的文件)
|
|
1086
|
+
const routeFile = new File([JSON.stringify({})], 'auto-route.json', { type: 'application/json' });
|
|
1087
|
+
|
|
1088
|
+
// 3. 导入自动布线文件
|
|
1089
|
+
const imported = await eda.pcb_Document.importAutoRouteJsonFile(routeFile);
|
|
1090
|
+
console.log('imported:', imported);
|
|
1091
|
+
|
|
1092
|
+
// 4. 清理测试 PCB
|
|
1093
|
+
await eda.dmt_Pcb.deletePcb(pcbUuid);
|
|
1094
|
+
```
|
|
1095
|
+
|
|
1096
|
+
### importautoroutesesfile
|
|
1097
|
+
|
|
1098
|
+
# PCB\_Document.importAutoRouteSesFile() method
|
|
1099
|
+
|
|
1100
|
+
> 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.
|
|
1101
|
+
|
|
1102
|
+
Import auto routing file (SES)
|
|
1103
|
+
|
|
1104
|
+
## Signature
|
|
1105
|
+
|
|
1106
|
+
```typescript
|
|
1107
|
+
function importAutoRouteSesFile(autoRouteFile: File): Promise<boolean>;
|
|
1108
|
+
```
|
|
1109
|
+
|
|
1110
|
+
## Parameters
|
|
1111
|
+
|
|
1112
|
+
<table><thead><tr><th>
|
|
1113
|
+
|
|
1114
|
+
Parameter
|
|
1115
|
+
|
|
1116
|
+
</th><th>
|
|
1117
|
+
|
|
1118
|
+
Type
|
|
1119
|
+
|
|
1120
|
+
</th><th>
|
|
1121
|
+
|
|
1122
|
+
Description
|
|
1123
|
+
|
|
1124
|
+
</th></tr></thead>
|
|
1125
|
+
<tbody><tr><td>
|
|
1126
|
+
|
|
1127
|
+
autoRouteFile
|
|
1128
|
+
|
|
1129
|
+
</td><td>
|
|
1130
|
+
|
|
1131
|
+
File
|
|
1132
|
+
|
|
1133
|
+
</td><td>
|
|
1134
|
+
|
|
1135
|
+
The SES file to import
|
|
1136
|
+
|
|
1137
|
+
</td></tr>
|
|
1138
|
+
</tbody></table>
|
|
1139
|
+
|
|
1140
|
+
## Returns
|
|
1141
|
+
|
|
1142
|
+
Promise<boolean>
|
|
1143
|
+
|
|
1144
|
+
Whether the import operation is successful
|
|
1145
|
+
|
|
1146
|
+
## Remarks
|
|
1147
|
+
|
|
1148
|
+
You can use to read in a file
|
|
1149
|
+
|
|
1150
|
+
### importchanges
|
|
1151
|
+
|
|
1152
|
+
# PCB\_Document.importChanges() method
|
|
1153
|
+
|
|
1154
|
+
Import changes from the schematic
|
|
1155
|
+
|
|
1156
|
+
## Signature
|
|
1157
|
+
|
|
1158
|
+
```typescript
|
|
1159
|
+
function importChanges(uuid?: string): Promise<boolean>;
|
|
1160
|
+
```
|
|
1161
|
+
|
|
1162
|
+
## Parameters
|
|
1163
|
+
|
|
1164
|
+
<table><thead><tr><th>
|
|
1165
|
+
|
|
1166
|
+
Parameter
|
|
1167
|
+
|
|
1168
|
+
</th><th>
|
|
1169
|
+
|
|
1170
|
+
Type
|
|
1171
|
+
|
|
1172
|
+
</th><th>
|
|
1173
|
+
|
|
1174
|
+
Description
|
|
1175
|
+
|
|
1176
|
+
</th></tr></thead>
|
|
1177
|
+
<tbody><tr><td>
|
|
1178
|
+
|
|
1179
|
+
uuid
|
|
1180
|
+
|
|
1181
|
+
</td><td>
|
|
1182
|
+
|
|
1183
|
+
string
|
|
1184
|
+
|
|
1185
|
+
</td><td>
|
|
1186
|
+
|
|
1187
|
+
_(Optional)_ Schematic UUID. By default, the schematic associated with the same Board is used
|
|
1188
|
+
|
|
1189
|
+
</td></tr>
|
|
1190
|
+
</tbody></table>
|
|
1191
|
+
|
|
1192
|
+
## Returns
|
|
1193
|
+
|
|
1194
|
+
Promise<boolean>
|
|
1195
|
+
|
|
1196
|
+
Whether the import operation was successful. If the import fails or the free PCB has no schematic UUID passed in, `false` is returned
|
|
1197
|
+
|
|
1198
|
+
## Example
|
|
1199
|
+
|
|
1200
|
+
```javascript
|
|
1201
|
+
// 1. 创建测试原理图和测试 PCB
|
|
1202
|
+
const schUuid = await eda.dmt_Schematic.createSchematic();
|
|
1203
|
+
await new Promise(r => setTimeout(r, 1500));
|
|
1204
|
+
const pcbUuid = await eda.dmt_Pcb.createPcb();
|
|
1205
|
+
await new Promise(r => setTimeout(r, 1500));
|
|
1206
|
+
|
|
1207
|
+
// 2. 创建板子把原理图与 PCB 关联起来(返回板子名称)
|
|
1208
|
+
const boardName = await eda.dmt_Board.createBoard(schUuid, pcbUuid);
|
|
1209
|
+
await new Promise(r => setTimeout(r, 1500));
|
|
1210
|
+
console.log('boardName:', boardName);
|
|
1211
|
+
|
|
1212
|
+
// 3. 打开 PCB 并从关联原理图导入变更
|
|
1213
|
+
await eda.dmt_EditorControl.openDocument(pcbUuid);
|
|
1214
|
+
await new Promise(r => setTimeout(r, 1000));
|
|
1215
|
+
const imported = await eda.pcb_Document.importChanges();
|
|
1216
|
+
console.log('imported:', imported);
|
|
1217
|
+
|
|
1218
|
+
// 4. 清理:删板子、删 PCB、删原理图
|
|
1219
|
+
await eda.dmt_Board.deleteBoard(boardName);
|
|
1220
|
+
await new Promise(r => setTimeout(r, 1000));
|
|
1221
|
+
await eda.dmt_Pcb.deletePcb(pcbUuid);
|
|
1222
|
+
await eda.dmt_Schematic.deleteSchematic(schUuid);
|
|
1223
|
+
```
|
|
1224
|
+
|
|
1225
|
+
### navigatetocoordinates
|
|
1226
|
+
|
|
1227
|
+
# PCB\_Document.navigateToCoordinates() method
|
|
1228
|
+
|
|
1229
|
+
Locate to canvas coordinate
|
|
1230
|
+
|
|
1231
|
+
## Signature
|
|
1232
|
+
|
|
1233
|
+
```typescript
|
|
1234
|
+
function navigateToCoordinates(x: number, y: number): Promise<boolean>;
|
|
1235
|
+
```
|
|
1236
|
+
|
|
1237
|
+
## Parameters
|
|
1238
|
+
|
|
1239
|
+
<table><thead><tr><th>
|
|
1240
|
+
|
|
1241
|
+
Parameter
|
|
1242
|
+
|
|
1243
|
+
</th><th>
|
|
1244
|
+
|
|
1245
|
+
Type
|
|
1246
|
+
|
|
1247
|
+
</th><th>
|
|
1248
|
+
|
|
1249
|
+
Description
|
|
1250
|
+
|
|
1251
|
+
</th></tr></thead>
|
|
1252
|
+
<tbody><tr><td>
|
|
1253
|
+
|
|
1254
|
+
x
|
|
1255
|
+
|
|
1256
|
+
</td><td>
|
|
1257
|
+
|
|
1258
|
+
number
|
|
1259
|
+
|
|
1260
|
+
</td><td>
|
|
1261
|
+
|
|
1262
|
+
X coordinate
|
|
1263
|
+
|
|
1264
|
+
</td></tr>
|
|
1265
|
+
<tr><td>
|
|
1266
|
+
|
|
1267
|
+
y
|
|
1268
|
+
|
|
1269
|
+
</td><td>
|
|
1270
|
+
|
|
1271
|
+
number
|
|
1272
|
+
|
|
1273
|
+
</td><td>
|
|
1274
|
+
|
|
1275
|
+
Y coordinate
|
|
1276
|
+
|
|
1277
|
+
</td></tr>
|
|
1278
|
+
</tbody></table>
|
|
1279
|
+
|
|
1280
|
+
## Returns
|
|
1281
|
+
|
|
1282
|
+
Promise<boolean>
|
|
1283
|
+
|
|
1284
|
+
Whether the operation is successful
|
|
1285
|
+
|
|
1286
|
+
## Remarks
|
|
1287
|
+
|
|
1288
|
+
This API positions on the front-end canvas to the specified data-level coordinate;
|
|
1289
|
+
|
|
1290
|
+
If you want the front-end canvas coordinate to be consistent with the passed-in data during this operation, it is recommended to call the [PCB\_Document.setCanvasOrigin()](./PCB_Document.md) method and set the offset to zero;
|
|
1291
|
+
|
|
1292
|
+
The units here are data-level units, which are equivalent to mil on the canvas level in span
|
|
1293
|
+
|
|
1294
|
+
## Example
|
|
1295
|
+
|
|
1296
|
+
```javascript
|
|
1297
|
+
// 1. 创建测试 PCB 并打开(视口操作作用于当前激活的 PCB)
|
|
1298
|
+
const pcbUuid = await eda.dmt_Pcb.createPcb();
|
|
1299
|
+
await new Promise(r => setTimeout(r, 1500));
|
|
1300
|
+
await eda.dmt_EditorControl.openDocument(pcbUuid);
|
|
1301
|
+
await new Promise(r => setTimeout(r, 1000));
|
|
1302
|
+
|
|
1303
|
+
// 2. 定位到数据坐标 (1000, 800)
|
|
1304
|
+
const navigated = await eda.pcb_Document.navigateToCoordinates(1000, 800);
|
|
1305
|
+
console.log('navigated:', navigated);
|
|
1306
|
+
|
|
1307
|
+
// 3. 清理测试 PCB
|
|
1308
|
+
await eda.dmt_Pcb.deletePcb(pcbUuid);
|
|
1309
|
+
```
|
|
1310
|
+
|
|
1311
|
+
### navigatetoregion
|
|
1312
|
+
|
|
1313
|
+
# PCB\_Document.navigateToRegion() method
|
|
1314
|
+
|
|
1315
|
+
> 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.
|
|
1316
|
+
|
|
1317
|
+
Locate to canvas region
|
|
1318
|
+
|
|
1319
|
+
## Signature
|
|
1320
|
+
|
|
1321
|
+
```typescript
|
|
1322
|
+
function navigateToRegion(
|
|
1323
|
+
left: number,
|
|
1324
|
+
right: number,
|
|
1325
|
+
top: number,
|
|
1326
|
+
bottom: number,
|
|
1327
|
+
): Promise<boolean>;
|
|
1328
|
+
```
|
|
1329
|
+
|
|
1330
|
+
## Parameters
|
|
1331
|
+
|
|
1332
|
+
<table><thead><tr><th>
|
|
1333
|
+
|
|
1334
|
+
Parameter
|
|
1335
|
+
|
|
1336
|
+
</th><th>
|
|
1337
|
+
|
|
1338
|
+
Type
|
|
1339
|
+
|
|
1340
|
+
</th><th>
|
|
1341
|
+
|
|
1342
|
+
Description
|
|
1343
|
+
|
|
1344
|
+
</th></tr></thead>
|
|
1345
|
+
<tbody><tr><td>
|
|
1346
|
+
|
|
1347
|
+
left
|
|
1348
|
+
|
|
1349
|
+
</td><td>
|
|
1350
|
+
|
|
1351
|
+
number
|
|
1352
|
+
|
|
1353
|
+
</td><td>
|
|
1354
|
+
|
|
1355
|
+
First X coordinate of the rectangle
|
|
1356
|
+
|
|
1357
|
+
</td></tr>
|
|
1358
|
+
<tr><td>
|
|
1359
|
+
|
|
1360
|
+
right
|
|
1361
|
+
|
|
1362
|
+
</td><td>
|
|
1363
|
+
|
|
1364
|
+
number
|
|
1365
|
+
|
|
1366
|
+
</td><td>
|
|
1367
|
+
|
|
1368
|
+
Second X coordinate of the rectangle
|
|
1369
|
+
|
|
1370
|
+
</td></tr>
|
|
1371
|
+
<tr><td>
|
|
1372
|
+
|
|
1373
|
+
top
|
|
1374
|
+
|
|
1375
|
+
</td><td>
|
|
1376
|
+
|
|
1377
|
+
number
|
|
1378
|
+
|
|
1379
|
+
</td><td>
|
|
1380
|
+
|
|
1381
|
+
First Y coordinate of the rectangle
|
|
1382
|
+
|
|
1383
|
+
</td></tr>
|
|
1384
|
+
<tr><td>
|
|
1385
|
+
|
|
1386
|
+
bottom
|
|
1387
|
+
|
|
1388
|
+
</td><td>
|
|
1389
|
+
|
|
1390
|
+
number
|
|
1391
|
+
|
|
1392
|
+
</td><td>
|
|
1393
|
+
|
|
1394
|
+
Second Y coordinate of the rectangle
|
|
1395
|
+
|
|
1396
|
+
</td></tr>
|
|
1397
|
+
</tbody></table>
|
|
1398
|
+
|
|
1399
|
+
## Returns
|
|
1400
|
+
|
|
1401
|
+
Promise<boolean>
|
|
1402
|
+
|
|
1403
|
+
Whether the operation is successful
|
|
1404
|
+
|
|
1405
|
+
## Remarks
|
|
1406
|
+
|
|
1407
|
+
This API positions on the front-end canvas to the specified region. The region data is an offset relative to the data origin;
|
|
1408
|
+
|
|
1409
|
+
For example: the passed-in data is `{left: 0, right: 60, top: 100, bottom: -20}` =<!-- -->> `navigateToRegion(0, 60, 100, -20)`<!-- -->, then the canvas will be positioned to a rectangular range centered at `[30, 40]` with a length of `60` in the x-axis direction and `120` in the y-axis direction;
|
|
1410
|
+
|
|
1411
|
+
This API does not perform zooming, but it will generate a rectangle frame indicating the positioning center and the region range;
|
|
1412
|
+
|
|
1413
|
+
The units here are data-level units, which are equivalent to mil on the canvas level in span
|
|
1414
|
+
|
|
1415
|
+
## Example
|
|
1416
|
+
|
|
1417
|
+
```javascript
|
|
1418
|
+
// 1. 创建测试 PCB 并打开(视口操作作用于当前激活的 PCB)
|
|
1419
|
+
const pcbUuid = await eda.dmt_Pcb.createPcb();
|
|
1420
|
+
await new Promise(r => setTimeout(r, 1500));
|
|
1421
|
+
await eda.dmt_EditorControl.openDocument(pcbUuid);
|
|
1422
|
+
await new Promise(r => setTimeout(r, 1000));
|
|
1423
|
+
|
|
1424
|
+
// 2. 定位到矩形区域:X 从 0 到 2000,Y 从 2000 到 0(视口将以中心 (1000,1000) 呈现)
|
|
1425
|
+
const navigated = await eda.pcb_Document.navigateToRegion(0, 2000, 2000, 0);
|
|
1426
|
+
console.log('navigated:', navigated);
|
|
1427
|
+
|
|
1428
|
+
// 3. 清理测试 PCB
|
|
1429
|
+
await eda.dmt_Pcb.deletePcb(pcbUuid);
|
|
1430
|
+
```
|
|
1431
|
+
|
|
1432
|
+
### save
|
|
1433
|
+
|
|
1434
|
+
# PCB\_Document.save() method
|
|
1435
|
+
|
|
1436
|
+
Save Document
|
|
1437
|
+
|
|
1438
|
+
## Signature
|
|
1439
|
+
|
|
1440
|
+
```typescript
|
|
1441
|
+
function save(): Promise<boolean>;
|
|
1442
|
+
```
|
|
1443
|
+
|
|
1444
|
+
## Returns
|
|
1445
|
+
|
|
1446
|
+
Promise<boolean>
|
|
1447
|
+
|
|
1448
|
+
Whether the save operation was successful. Errors such as save failure and upload failure all return `false`
|
|
1449
|
+
|
|
1450
|
+
## Example
|
|
1451
|
+
|
|
1452
|
+
```javascript
|
|
1453
|
+
// 1. 创建测试 PCB 并打开(保存作用于当前激活的 PCB)
|
|
1454
|
+
const pcbUuid = await eda.dmt_Pcb.createPcb();
|
|
1455
|
+
await new Promise(r => setTimeout(r, 1500));
|
|
1456
|
+
await eda.dmt_EditorControl.openDocument(pcbUuid);
|
|
1457
|
+
await new Promise(r => setTimeout(r, 1000));
|
|
1458
|
+
|
|
1459
|
+
// 2. 保存当前 PCB
|
|
1460
|
+
const saved = await eda.pcb_Document.save();
|
|
1461
|
+
console.log('saved:', saved);
|
|
1462
|
+
|
|
1463
|
+
// 3. 清理测试 PCB
|
|
1464
|
+
await eda.dmt_Pcb.deletePcb(pcbUuid);
|
|
1465
|
+
```
|
|
1466
|
+
|
|
1467
|
+
### setcanvasorigin
|
|
1468
|
+
|
|
1469
|
+
# PCB\_Document.setCanvasOrigin() method
|
|
1470
|
+
|
|
1471
|
+
Set the offset coordinate of the canvas origin relative to the data origin
|
|
1472
|
+
|
|
1473
|
+
## Signature
|
|
1474
|
+
|
|
1475
|
+
```typescript
|
|
1476
|
+
function setCanvasOrigin(offsetX: number, offsetY: number): Promise<boolean>;
|
|
1477
|
+
```
|
|
1478
|
+
|
|
1479
|
+
## Parameters
|
|
1480
|
+
|
|
1481
|
+
<table><thead><tr><th>
|
|
1482
|
+
|
|
1483
|
+
Parameter
|
|
1484
|
+
|
|
1485
|
+
</th><th>
|
|
1486
|
+
|
|
1487
|
+
Type
|
|
1488
|
+
|
|
1489
|
+
</th><th>
|
|
1490
|
+
|
|
1491
|
+
Description
|
|
1492
|
+
|
|
1493
|
+
</th></tr></thead>
|
|
1494
|
+
<tbody><tr><td>
|
|
1495
|
+
|
|
1496
|
+
offsetX
|
|
1497
|
+
|
|
1498
|
+
</td><td>
|
|
1499
|
+
|
|
1500
|
+
number
|
|
1501
|
+
|
|
1502
|
+
</td><td>
|
|
1503
|
+
|
|
1504
|
+
X coordinate offset of the canvas origin relative to the data origin
|
|
1505
|
+
|
|
1506
|
+
</td></tr>
|
|
1507
|
+
<tr><td>
|
|
1508
|
+
|
|
1509
|
+
offsetY
|
|
1510
|
+
|
|
1511
|
+
</td><td>
|
|
1512
|
+
|
|
1513
|
+
number
|
|
1514
|
+
|
|
1515
|
+
</td><td>
|
|
1516
|
+
|
|
1517
|
+
Y coordinate offset of the canvas origin relative to the data origin
|
|
1518
|
+
|
|
1519
|
+
</td></tr>
|
|
1520
|
+
</tbody></table>
|
|
1521
|
+
|
|
1522
|
+
## Returns
|
|
1523
|
+
|
|
1524
|
+
Promise<boolean>
|
|
1525
|
+
|
|
1526
|
+
Whether the operation is successful
|
|
1527
|
+
|
|
1528
|
+
## Remarks
|
|
1529
|
+
|
|
1530
|
+
The coordinates displayed on the EasyEDA Pro front end are all relative to the canvas origin;
|
|
1531
|
+
|
|
1532
|
+
The EasyEDA Pro API uses the data origin;
|
|
1533
|
+
|
|
1534
|
+
If you want the front-end canvas coordinate to be consistent with the data during API operations, it is recommended to call this method and set the offset to zero, i.e. `setCanvasOrigin(0, 0)`<!-- -->;
|
|
1535
|
+
|
|
1536
|
+
The units here are data-level units, which are equivalent to mil on the canvas level in span
|
|
1537
|
+
|
|
1538
|
+
## Example
|
|
1539
|
+
|
|
1540
|
+
```javascript
|
|
1541
|
+
// 1. 创建测试 PCB 并打开(原点设置作用于当前激活的 PCB)
|
|
1542
|
+
const pcbUuid = await eda.dmt_Pcb.createPcb();
|
|
1543
|
+
await new Promise(r => setTimeout(r, 1500));
|
|
1544
|
+
await eda.dmt_EditorControl.openDocument(pcbUuid);
|
|
1545
|
+
await new Promise(r => setTimeout(r, 1000));
|
|
1546
|
+
|
|
1547
|
+
// 2. 设置画布原点偏移为 (50, 100)
|
|
1548
|
+
const set = await eda.pcb_Document.setCanvasOrigin(50, 100);
|
|
1549
|
+
console.log('set:', set);
|
|
1550
|
+
|
|
1551
|
+
// 3. 读回偏移验证已生效
|
|
1552
|
+
const origin = await eda.pcb_Document.getCanvasOrigin();
|
|
1553
|
+
console.log('origin:', JSON.stringify(origin));
|
|
1554
|
+
|
|
1555
|
+
// 4. 清理测试 PCB(偏移随文档一起删除)
|
|
1556
|
+
await eda.dmt_Pcb.deletePcb(pcbUuid);
|
|
1557
|
+
```
|
|
1558
|
+
|
|
1559
|
+
### startcalculatingratline
|
|
1560
|
+
|
|
1561
|
+
# PCB\_Document.startCalculatingRatline() method
|
|
1562
|
+
|
|
1563
|
+
> Warning: This API is now obsolete.
|
|
1564
|
+
>
|
|
1565
|
+
> since EDA v4.2
|
|
1566
|
+
|
|
1567
|
+
Start the ratline calculation function
|
|
1568
|
+
|
|
1569
|
+
## Signature
|
|
1570
|
+
|
|
1571
|
+
```typescript
|
|
1572
|
+
function startCalculatingRatline(): Promise<boolean>;
|
|
1573
|
+
```
|
|
1574
|
+
|
|
1575
|
+
## Returns
|
|
1576
|
+
|
|
1577
|
+
Promise<boolean>
|
|
1578
|
+
|
|
1579
|
+
Whether the operation is successful
|
|
1580
|
+
|
|
1581
|
+
## Remarks
|
|
1582
|
+
|
|
1583
|
+
A ratline calculation will be triggered when starting
|
|
1584
|
+
|
|
1585
|
+
## Example
|
|
1586
|
+
|
|
1587
|
+
```javascript
|
|
1588
|
+
// 1. 创建测试 PCB 并打开(飞线开关作用于当前激活的 PCB)
|
|
1589
|
+
const pcbUuid = await eda.dmt_Pcb.createPcb();
|
|
1590
|
+
await new Promise(r => setTimeout(r, 1500));
|
|
1591
|
+
await eda.dmt_EditorControl.openDocument(pcbUuid);
|
|
1592
|
+
await new Promise(r => setTimeout(r, 1000));
|
|
1593
|
+
|
|
1594
|
+
// 2. 启动飞线计算
|
|
1595
|
+
const started = await eda.pcb_Document.startCalculatingRatline();
|
|
1596
|
+
console.log('started:', started);
|
|
1597
|
+
|
|
1598
|
+
// 3. 清理测试 PCB
|
|
1599
|
+
await eda.dmt_Pcb.deletePcb(pcbUuid);
|
|
1600
|
+
```
|
|
1601
|
+
|
|
1602
|
+
### startcanvasupdatecalculation
|
|
1603
|
+
|
|
1604
|
+
# PCB\_Document.startCanvasUpdateCalculation() method
|
|
1605
|
+
|
|
1606
|
+
> 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.
|
|
1607
|
+
|
|
1608
|
+
Start canvas update calculation
|
|
1609
|
+
|
|
1610
|
+
## Signature
|
|
1611
|
+
|
|
1612
|
+
```typescript
|
|
1613
|
+
function startCanvasUpdateCalculation(): Promise<boolean>;
|
|
1614
|
+
```
|
|
1615
|
+
|
|
1616
|
+
## Returns
|
|
1617
|
+
|
|
1618
|
+
Promise<boolean>
|
|
1619
|
+
|
|
1620
|
+
Whether the operation is successful
|
|
1621
|
+
|
|
1622
|
+
## Remarks
|
|
1623
|
+
|
|
1624
|
+
Canvas update calculation includes canvas render updates, property panel updates, etc.
|
|
1625
|
+
|
|
1626
|
+
If you do not understand the meaning of this switch, do not call this API for any operation ADD since EDA v4.2
|
|
1627
|
+
|
|
1628
|
+
### stopcalculatingratline
|
|
1629
|
+
|
|
1630
|
+
# PCB\_Document.stopCalculatingRatline() method
|
|
1631
|
+
|
|
1632
|
+
> Warning: This API is now obsolete.
|
|
1633
|
+
>
|
|
1634
|
+
> since EDA v4.2
|
|
1635
|
+
|
|
1636
|
+
Stop the ratline calculation function
|
|
1637
|
+
|
|
1638
|
+
## Signature
|
|
1639
|
+
|
|
1640
|
+
```typescript
|
|
1641
|
+
function stopCalculatingRatline(): Promise<boolean>;
|
|
1642
|
+
```
|
|
1643
|
+
|
|
1644
|
+
## Returns
|
|
1645
|
+
|
|
1646
|
+
Promise<boolean>
|
|
1647
|
+
|
|
1648
|
+
Whether the operation is successful
|
|
1649
|
+
|
|
1650
|
+
## Example
|
|
1651
|
+
|
|
1652
|
+
```javascript
|
|
1653
|
+
// 1. 创建测试 PCB 并打开(飞线开关作用于当前激活的 PCB)
|
|
1654
|
+
const pcbUuid = await eda.dmt_Pcb.createPcb();
|
|
1655
|
+
await new Promise(r => setTimeout(r, 1500));
|
|
1656
|
+
await eda.dmt_EditorControl.openDocument(pcbUuid);
|
|
1657
|
+
await new Promise(r => setTimeout(r, 1000));
|
|
1658
|
+
|
|
1659
|
+
// 2. 停止飞线计算
|
|
1660
|
+
const stopped = await eda.pcb_Document.stopCalculatingRatline();
|
|
1661
|
+
console.log('stopped:', stopped);
|
|
1662
|
+
|
|
1663
|
+
// 3. 清理测试 PCB
|
|
1664
|
+
await eda.dmt_Pcb.deletePcb(pcbUuid);
|
|
1665
|
+
```
|
|
1666
|
+
|
|
1667
|
+
### stopcanvasupdatecalculation
|
|
1668
|
+
|
|
1669
|
+
# PCB\_Document.stopCanvasUpdateCalculation() method
|
|
1670
|
+
|
|
1671
|
+
> 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.
|
|
1672
|
+
|
|
1673
|
+
Stop canvas update calculation
|
|
1674
|
+
|
|
1675
|
+
## Signature
|
|
1676
|
+
|
|
1677
|
+
```typescript
|
|
1678
|
+
function stopCanvasUpdateCalculation(): Promise<boolean>;
|
|
1679
|
+
```
|
|
1680
|
+
|
|
1681
|
+
## Returns
|
|
1682
|
+
|
|
1683
|
+
Promise<boolean>
|
|
1684
|
+
|
|
1685
|
+
Whether the operation is successful
|
|
1686
|
+
|
|
1687
|
+
## Remarks
|
|
1688
|
+
|
|
1689
|
+
Canvas update calculation includes canvas render updates, property panel updates, etc.
|
|
1690
|
+
|
|
1691
|
+
If you do not understand the meaning of this switch, do not call this API for any operation ADD since EDA v4.2
|
|
1692
|
+
|
|
1693
|
+
### triggercanvasupdatecalculation
|
|
1694
|
+
|
|
1695
|
+
# PCB\_Document.triggerCanvasUpdateCalculation() method
|
|
1696
|
+
|
|
1697
|
+
> 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.
|
|
1698
|
+
|
|
1699
|
+
Trigger a canvas update calculation
|
|
1700
|
+
|
|
1701
|
+
## Signature
|
|
1702
|
+
|
|
1703
|
+
```typescript
|
|
1704
|
+
function triggerCanvasUpdateCalculation(): Promise<boolean>;
|
|
1705
|
+
```
|
|
1706
|
+
|
|
1707
|
+
## Returns
|
|
1708
|
+
|
|
1709
|
+
Promise<boolean>
|
|
1710
|
+
|
|
1711
|
+
Whether the operation is successful
|
|
1712
|
+
|
|
1713
|
+
## Remarks
|
|
1714
|
+
|
|
1715
|
+
Canvas update calculation includes canvas render updates, property panel updates, etc.
|
|
1716
|
+
|
|
1717
|
+
If you do not understand the meaning of this switch, do not call this API for any operation ADD since EDA v4.2
|
|
1718
|
+
|
|
1719
|
+
### zoomtoboardoutline
|
|
1720
|
+
|
|
1721
|
+
# PCB\_Document.zoomToBoardOutline() method
|
|
1722
|
+
|
|
1723
|
+
> 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.
|
|
1724
|
+
|
|
1725
|
+
Zoom to the board outline (fit the board outline)
|
|
1726
|
+
|
|
1727
|
+
## Signature
|
|
1728
|
+
|
|
1729
|
+
```typescript
|
|
1730
|
+
function zoomToBoardOutline(): Promise<boolean>;
|
|
1731
|
+
```
|
|
1732
|
+
|
|
1733
|
+
## Returns
|
|
1734
|
+
|
|
1735
|
+
Promise<boolean>
|
|
1736
|
+
|
|
1737
|
+
Whether the operation is successful
|
|
1738
|
+
|
|
1739
|
+
## Example
|
|
1740
|
+
|
|
1741
|
+
```javascript
|
|
1742
|
+
// 1. 创建测试 PCB 并打开(视口操作作用于当前激活的 PCB)
|
|
1743
|
+
const pcbUuid = await eda.dmt_Pcb.createPcb();
|
|
1744
|
+
await new Promise(r => setTimeout(r, 1500));
|
|
1745
|
+
await eda.dmt_EditorControl.openDocument(pcbUuid);
|
|
1746
|
+
await new Promise(r => setTimeout(r, 1000));
|
|
1747
|
+
|
|
1748
|
+
// 2. 缩放到板框
|
|
1749
|
+
const zoomed = await eda.pcb_Document.zoomToBoardOutline();
|
|
1750
|
+
console.log('zoomed:', zoomed);
|
|
1751
|
+
|
|
1752
|
+
// 3. 清理测试 PCB
|
|
1753
|
+
await eda.dmt_Pcb.deletePcb(pcbUuid);
|
|
1754
|
+
```
|