For efficiency map analysis studies in Speed Priority mode, an RTT file can be output from the response table.
In addition to a lookup table based on the analysis results, it also supports adding information such as the author and whether the file is publicly available.
This script exports an RTT file from the response table, adding information such as the author and winding conductor information.
Preconditions
- One or more speed-priority type efficiency map analysis study has been calculated.
This script runs on the active study in the project tree.
Script Function
- Set the parameters for exporting an RTT file from the response table.
The source response table is set to the “Calculated Table” output from the efficiency map analysis study.
The RTT file output path is set to the same folder as the opened project file.
Set “Winding Conductor Information Public” to ON.
Set the number of conductors in slot height to 6, the number of conductors in slot width to 4, the number of slots per phase to 2, the average slot width to 12 mm, the conductor type to round, the conductor diameter to 1.8 mm, the core stack length to 15 mm, and the electrical conductivity to 59,600,000 S/m.
# 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/
import os
app = designer.GetApplication()
def getFolderpathOfOpenedProjectFile():
"""Get folder path of opened jproj file"""
openedJprojFilePath = app.GetProjectPath()
folderPath = os.path.dirname(openedJprojFilePath)
return folderPath
def createRttExportParameters(filePath):
"""Set the information to be exported from the calculation table to an RTT file"""
fileExporter = app.CreateRttFileParameter()
fileExporter.SetResponseTableName(u"Calculated Table")
fileExporter.SetOutputFilepath(filePath)
fileExporter.SetTitle(u"MutualInductance")
fileExporter.SetAuthor(u"JMAG User")
fileExporter.SetIsWindingSettingsPublic(True)
fileExporter.SetConductorsSlotHeight(6)
fileExporter.SetConductorsSlotWidth(4)
fileExporter.SetSlotsPerPhase(2)
fileExporter.SetAveragedSlotWidth(12)
# Conductor Type
# 0:Rectangle
# 1:Round
fileExporter.SetConductorType(1)
fileExporter.SetConductorDiameter(1.8)
fileExporter.SetCoreStackLength(15)
fileExporter.SetConductivity(59600000)
return fileExporter
study = app.GetCurrentStudy()
rttFileName = u"saves.rtt"
rttFilePath = os.path.join(getFolderpathOfOpenedProjectFile(), rttFileName)
fileExporter = createRttExportParameters(rttFilePath)
study.ExportRttFile(fileExporter)


