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
-
[S0051] Export project files with selecting studies
Select studies from the active project and export the project file.
-
[S0050] Create an arc section graph and obtain the result
Create a section graph retrieving the result values along an arc and display the result data table.
-
[S0049] Configure the response table creation for an efficiency map analysis study using a reduced order model method
Configure the settings of the response table creation for efficiency map analysis using a reduced order model method.
-
[S0048] Set the parametric variable ranges for optimization
In the optimization settings, configure the parametric variable ranges and select CAD parameters to modify the range using the range finder.
-
[S0047] Select faces oriented in the specified normal direction located within the cylindrical range
Specify a cylindrical region in the model coordinate space, then select faces within that region and match to the specified normal direction.
-
[S0046] Group the selected parts by specifying a box area
Select parts by specifying a box range in the model coordinate space and create a part group from the selected parts.
-
[S0045] Get the number of mesh elements and nodes
Get the number of elements and nodes of the mesh created in a study.
-
[S0044] Create a sphere solid in the Geometry Editor
Create a spherical solid part with its center position and radius defined by equation variables.
-
[S0043] Set parameter using a function to a condition of transient response analysis
Set parameters such as current and electric potential, which change depending on time, angle, etc., using functions.
-
[S0042] Create an efficiency map that has the drive cycle
Create an efficiency map with a drive cycle for the result evaluation of the efficiency map study.
-
[S0041] Create composite result display definition to display multiple distribution plots on a single screen
Create a composite result definition to plot different result types or different components for each part and display on a single screen.
-
[S0040] Create an equation in the case control
Create an equation of an expression type with specifying the display order on equation list.
-
[S0039] Create a full model from a partial model using the assembly pattern feature
Load a CAD file prepared as a partial model and create a full model using assembly pattern features.
-
[S0038] Retrieve the parts and sets information of the analysis template, associate them and apply to a model
Retrieve information on parts and sets from the analysis template, including parts and sets that are not automatically associated. If the names match within certain rules, create pairs and the analysis template is applied to the model.
-
[S0037] Create a 2D shape of the I-shaped rotor of an IPM motor
Create the 2D shape of the I-shaped rotor of an IPM motor as a 1/4 model with 4 poles and mirror symmetry.
-
[S0036] Set the Halbach array as the magnetization pattern for a permanent magnet
Set a parallel pattern (circular Halbach array) to permanent magnets arranged in the circumferential direction.
-
[S0035] Create a response table with corrections and skew applied in an efficiency map study
Apply correction parameters to the results of the efficiency map analysis study and create a new response table.
-
[S0034] Get the settings of measurement variables
Retrieved and display the settings of the measurement variables according to the measurement type.
-
[S0033] Define a 2D harmonic amplitude response value from a section graph data set
Create and register a 2D harmonic amplitude response value from a dataset of calculation results obtained on the time and spatial axes.
-
[S0032] Create a rectangular prism in the Geometry Editor
Create a solid part of a rectangular prism by specifying the length, width and height.


