import simetrix as sx # This demonstration will work for any schematic that simulates and plots # results with measurements. Both SIMetrix and SIMPLIS simulators will # work without modification. # Before running, open a suitable schematic # Get current schematic schem = sx.currentSchematic() if schem : # Run simulation sim = schem.run() # get graph graph = sx.currentGraph() # get curves curves = graph.curves # for each curve obtain the measurement objects print("\nMeasurements") for curve in curves() : # measurement_objects is the list of measurement objects for curve measurement_objects = curve.prop("MeasurementIds").objects # Iterate through each measurement for v in measurement_objects : # Print curve name followed by measurement label then measurement value print(curve.prop("Name").string, v.prop("Label").string, "=", v.prop("RawValues").strings[0]) else : print("No schematic is open. Open a schematic to run simulation")