To Store and Obtain Power via a Script

You may want to get the power threshold for each autosolve analysis without reading the entire breakdown status table and figuring out the power threshold through a complicated script. You can access the power threshold through a single line of script. Although the power threshold should not be time-dependent, with the current implementation we can sample the value at t = 0.

# ----------------------------------------------

# Script Recorded by Ansys Electronics Desktop Version 2025.2.0

# 10:55:07 Jun 05, 2024

# ----------------------------------------------

import ScriptEnv

import ctypes

ScriptEnv.Initialize("Ansoft.ElectronicsDesktop")

oDesktop.RestoreWindow()

oProject = oDesktop.SetActiveProject("JPL_coax_power_threshold_r251")

oDesign = oProject.SetActiveDesign("Coaxial_7-8")

oModule = oDesign.GetModule("OutputVariable")

oModule.CreateOutputVariable("GetPowerThreshold", "PowerThreshold", "100MHz_low : Power", "Multipaction", [])

PowerThreshold = oModule.GetOutputVariableValue("GetPowerThreshold","Time='0","100MHz_low : Power", "Multipaction", [])

ctypes.windll.user32.MessageBoxW(0, str(PowerThreshold), "Power Threshold", 1)