# Copyright (c) 2026 JSOL CORPORATION # # This script is released under the MIT License. # See the full license text at: # https://www.jmag-international.com/scriptlibrary/jmag_script_library_mit/ def isTransient(targetStudy): """Checks whether the argument study is transient""" isTR = False type = targetStudy.GetScriptTypeName() # The return string of GetScriptTypeName is language independent if type.lower().find('transient') != -1: isTR = True return isTR def getAndDisplayResultTableData(resultTable, tableDataName, isTR): """The table results are displayed in column->row order with units assigned""" tableData = resultTable.GetData(tableDataName) print(u"") print(tableData.GetName(), u":") for i in range(tableData.GetCols()): print(tableData.GetColName(i), u":") for j in range(tableData.GetRows()): # A row corresponds to a step if isTR: print(tableData.GetTime(j), tableData.GetTimeUnit(), ";", tableData.GetValue(j, i), tableData.GetValueUnit()) # For transient results, time is also displayed else: print(tableData.GetStep(j), u";", tableData.GetValue(j, i), tableData.GetValueUnit()) app = designer.GetApplication() targetStudy = app.GetCurrentStudy() isTR = isTransient(targetStudy) table = targetStudy.GetResultTable() getAndDisplayResultTableData(table, u"CoilFlux", isTR) getAndDisplayResultTableData(table, u"JouleLoss", isTR)