Users can operate almost every feature in JMAG through scripts. Although the JMAG website previously restricted access to sample scripts to authenticated users, we would now like to make this library available to everyone.
Most of the sample scripts written in Python are easy to use with some general programming knowledge. In addition, we are also releasing instructional materials that describe various scripting methods alongside usage examples. These materials should give even those new to JMAG confidence to use the scripting tools to easily automate and streamline analyses and design processes. Going forward, we will continue to enhance this library so that everyone can realize more flexible workflows through scripts.
JMAG Script Library
Add magnetic field strength contour definition to the current study.
Run all studies in the project.
Set a current condition on all parts named "Coil" in the current study.
Sets the material for parts in the current study named "Coil" to copper.
Create mesh for all cases if the case does not have a mesh.
Outputs the capacitance coefficient of a system consisting of multiple conductors in CSV file format.
This script will replace all FEM coils with FEM conductor in the current study. Requires Version 15.1 or later.
Apply recommended settings for 3D FEM conductor conditions.
This script replace all FEM conductors with FEM coils in the current study. Requires Version 15.1 or later
Create a csv file of a transfer function.
Uses results of the efficiency map analysis study to calculate efficiency of electric vehicles in a specified drive mode.
Export Jcf For External Circuit Link.
Make anomalous eddy current loss coefficient table from a Custom material.
Generate sampling cases.
This script highlights parts where eddy currents will be calculated.
Loading selected topology optimization geometry
Export toque and force to the CSV file for motor NVH.
Export toque and force to the CSV file for motor NVH.
Search for the maximum value and the minimum value of the parametric variable range of optimization.
This script sets the "Allow Eddy Current" flag for selected parts.
This script set FEM conductor conditions on all wires of a set in the current study. Requires V15.1 or later.
Set up a frequency analysis study for transfer function creation.
Evaluate the vibration of an observation point using the transfer function.
Set Heat Transfer at Airgap
Set Cooling by Forced Convection
Set Contact Heat Resistance between Magnet and Rotor Core
Set Cooling by Natural Convection
Contact Resistance between Stator Core and Case
JMAG Script Library Terms of Use This is an agreement between JSOL Corporation (hereinafter referred to as “JSOL”) and the user who is licensed to use this script library (hereinafter referred to as “the user”). The user acknowledges that they are bound by the terms and conditions in this agreement when the user saves all […]
The following is an example of a script to export a CSV file after setting up a new arc graph from the displayed model using “Results” > ‘Section’ > “Arbitrary Region” > “New Arc ...”.
The following is an example of a script that adds three cases and sets the direction of the reference axis for the magnetization direction for each.
I want to automate the process of performing FFT on the results and outputting them as a CSV file.
The following is an example script that adds cases with different current amplitude values and outputs the results of each case to a csv file.
The following is an example script to obtain the maximum flux density of a contour plot on an arbitrary part.
The following is an example of a script that retrieves the value of the magnetic flux in the current condition from the results of a magnetic field static analysis.
The following is an example of a script that outputs the results of a multi-case probe in a batch to a csv file.
The following is an example of a script that reads CSV files on conditions, circuits, and materials.
The following is an example of a script that writes the results of any case from multiple cases to a single CSV file.
The following is an example of a script that uses JMAG-Scheduler to specify a folder and execute analysis.
Open in JMAG-Designer the model that contains the study to be calculated using JMAG-Scheduler in advance, and then run it from the script editor.
The following is an example of a script that checks the storage location of project files (.jproj).
The following is an example of a script that manipulates the perspective of the model display.
The following is an example of a script that performs Boolean operations on specified parts using the Geometry Editor.
Obtain area/volume of a part or group of parts
The following is an example of a script that specifies part colors and performs grouping.
I want to specify model ID, study ID and case number in a script and export the results in csv.
The following is an example of a script for checking the number of jobs that have not been completed in JMAG-Scheduler.
The following is an example of a script that exports images to the same directory as the JPROJ file.
The following is an example of a script that obtains the coordinates of vertices in the Geometry Editor.
The following is an example of a script that specifies parts by coordinates and sets conditions.
The following is an example of a script that launches multiple JMAG-Designer instances.
The following is an example of a script that displays the results of section graphs for all cases in a single graph and outputs a CSV file.
The following is an example of a script that checks for duplicates, creates response data, and creates a response graph.
The following is an example of a script that obtains the setting values of conditions whose names and indexes are unknown.
I want to use a script to select elements by circular selection and write out the result table.
I want to get the setting value information of [Current Source (1 Terminal)] or [Electric Potential Source (1 Terminal)] by a script.
The following is an example of a script that performs FFT on torque waveforms and extracts the maximum amplitude from each frequency component.
I want to add a case and change design parameters including geometry dimensions with a script.
I want to create probes in 1deg increments in the circumferential direction in a script.
The following is an example of a script that changes the background color.
The following is an example of a script that obtains the coordinates of the vertices of parts.
I want to create a project file in the folder where the script is located using a script.
I want to register the rotation angle at which the torque is maximum in the response value in the script.
I want to calculate the induced voltage (dφ/dt) using a script and display a graph.
The following is an example of a script that places the starting point of the flux line rendering in a circular direction in a 3D model.
The following is an example of a script that calculates the induced voltage constant Ke from the analysis results and registers it in the response value.
The following is an example of a script that outputs a result table of nodes with nodal forces above the threshold.
The following is an example of a script for setting concentrated load conditions at nodes on a circle.
The following is an example of a script for performing an assembly circular pattern copy in the Geometry Editor.
The following is an example of a script for removing duplicate nodes in the Geometry Editor.
The following is an example of a script for setting the skin depth based on material and frequency.
I want to create a DC superimposed current sequence using a script and set it as the current condition.
The following is an example of a script for setting the switching timing of a PAM inverter.


