import simetrix as sx # Get Schematic object. If schematic is not already visible, it will be opened # for display schem = sx.openSchematic("Freq_Response_2.sxsch", [sx.SchematicOptions.VISIBLE]) # Values for load resistance (R19) R19values = ["20","24","50"] # Save original value so it can be restored R19_orig_value = schem.getComponentValue("R19.value").value # Iterate through required load values for R19 in R19values : schem.setComponentValue("R19.value", R19) sim = schem.run() if sim.status==sx.RunStatus.success : # get graph graph = sx.currentGraph() # get curves curves = graph.curves # for each curve obtain the measurement objects print("\nResults with Load = ", R19) 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("Run failed, status =", sim.status) # Restore R19 to original value schem.setComponentValue("R19.value", R19_orig_value)