0% found this document useful (0 votes)
4 views16 pages

ScriptFactory_2024

The document provides an overview of the Altair® FluxMotor® 2024 Script Factory, which is designed for creating and managing Python scripts related to electrical motor design. It includes functionalities for file management, such as creating, editing, duplicating, and deleting scripts, as well as running and stopping scripts. Additionally, it discusses the use of scripts for automating tasks and assessing the feasibility of winding architectures and slot filling in motor designs.

Uploaded by

Cầu Cao
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views16 pages

ScriptFactory_2024

The document provides an overview of the Altair® FluxMotor® 2024 Script Factory, which is designed for creating and managing Python scripts related to electrical motor design. It includes functionalities for file management, such as creating, editing, duplicating, and deleting scripts, as well as running and stopping scripts. Additionally, it discusses the use of scripts for automating tasks and assessing the feasibility of winding architectures and slot filling in motor designs.

Uploaded by

Cầu Cao
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Altair® FluxMotor® 2024

Script Factory
General user information

Altairhyperworks.com
Altair® FluxMotor® 2024 p. 2

Contents

1 Script Factory overview --------------------------------------------------------------------------------------------------------3


1.1 Main areas of Script Factory ---------------------------------------------------------------------------------------------------------- 3
1.2 How to get into Script Factory? ------------------------------------------------------------------------------------------------------ 3
1.3 Advice for use ----------------------------------------------------------------------------------------------------------------------------- 4
2 Python file management ------------------------------------------------------------------------------------------------------5
2.1 New file ------------------------------------------------------------------------------------------------------------------------------------- 5
2.2 Edit a file. ----------------------------------------------------------------------------------------------------------------------------------- 6
2.3 Duplicate a file. --------------------------------------------------------------------------------------------------------------------------- 7
2.4 Delete a file. ------------------------------------------------------------------------------------------------------------------------------- 8
2.5 Store a file. --------------------------------------------------------------------------------------------------------------------------------- 9
2.6 Save a file. -------------------------------------------------------------------------------------------------------------------------------- 10
2.7 Run and Stop ---------------------------------------------------------------------------------------------------------------------------- 11
2.8 Editor -------------------------------------------------------------------------------------------------------------------------------------- 12
Editor main functionality ---------------------------------------------------------------------------------------------------------------------------- 12
FluxMotor command help files. ------------------------------------------------------------------------------------------------------------------- 12
Log and error ------------------------------------------------------------------------------------------------------------------------------------------- 13
Open a file in system explorer. -------------------------------------------------------------------------------------------------------------------- 14

3 Miscellaneous topics ---------------------------------------------------------------------------------------------------------- 15


3.1 Script for filling the slots. ------------------------------------------------------------------------------------------------------------ 15
3.2 Feasibility of the winding architecture and the slot filling ------------------------------------------------------------------ 16

Proprietary Information of Altair Engineering


Altair® FluxMotor® 2024 p. 3

1 SCRIPT FACTORY OVERVIEW


1.1 Main areas of Script Factory

“Script Factory” is a dedicated application to create and manage python Altair® FluxMotor® scripts.

The application includes:

 Workspace in tree format


 Script files functionality as “New, Duplicate and Delete”.
 Launcher of python script with “Run and Stop” function.

Classical functions such as “Save, Undo, Redo and Store” are also available.

1.2 How to get into Script Factory?

Two ways are possible:

From Supervisor, click on “Script Factory” button

From Motor Factory / Export environment / Script, it is possible to open the python script of a current motor with all the needed
commands defining it.

1 Click on “Script Factory” on the left part of the supervisor to open the “Script Factory” application

Proprietary Information of Altair Engineering


Altair® FluxMotor® 2024 p. 4

How to get into “Script Factory” from Motor Factory?


1 In Motor Factory, select EXPORT environment
2 In EXPORT environment, select SCRIPT in the DOCUMENT menu
3 In “SCRIPT” panel of Motor Factory, open the python script of the current motor by clicking on this button

1.3 Advice for use


Altair® FluxMotor® is a dedicated platform, which can be used for the predesign of electrical motors. The target of Altair® FluxMotor® is to
get a quick overview of technical and economic potential of motors.

The motive of the Script Factory is to give the possibility to automate some study such as lunch serial tests or serial design winding
configurations.

Proprietary Information of Altair Engineering


Altair® FluxMotor® 2024 p. 5

2 PYTHON FILE MANAGEMENT


2.1 New file
In Script Factory application, a new python file can be created and stored in the selected workspace.

How to create a new python Script?


1 By clicking on the icon - NEW in the FILES menu.
2 Give a name to the python script.
3 Select a parent working directory (The default one is the current workspace).

Proprietary Information of Altair Engineering


Altair® FluxMotor® 2024 p. 6

2.2 Edit a file.


In Script Factory application, a selected python file from the workspace tree can be edited.

How to edit a python Script from the workspace tree?


1 Select a python file in the workspace tree.
2 Right click on the selected python file and select “Edit” option.
3 The python script is edited in the editor.

Note: A double click on the python file directly open it in the editor.

Proprietary Information of Altair Engineering


Altair® FluxMotor® 2024 p. 7

2.3 Duplicate a file.


In Script Factory application, a selected python file from the workspace tree can be duplicated in a parent directory.

How to duplicate a python Script from the workspace tree?


1 Select a python file in the workspace tree.
Click on the icon DUPLICATE in the FILES menu or right click on the selected python file and then select the
2
“Duplicate” option.
3 Give a name to the python script.
4 Select a parent working directory (The default one is the current workspace).

Proprietary Information of Altair Engineering


Altair® FluxMotor® 2024 p. 8

2.4 Delete a file.


In Script Factory application, a selected python file from the workspace tree can be deleted.

How to delete a python Script from the workspace tree?


1 Select a python file in the workspace tree.
2 Click on the icon DELETE in the FILES menu or right click on the selected python file and then select the “Delete” option.
3 Click on “Yes” to confirm the file delete.

Proprietary Information of Altair Engineering


Altair® FluxMotor® 2024 p. 9

2.5 Store a file.


In Script Factory application, a selected python file from the workspace tree can be stored.

How to store a python Script from the workspace tree?


1 Select a python file in the workspace tree.
2 Click on the icon STORE via the top expanded menu.
3 Give a name to the python script you want to store.
4 Select a parent working directory (The default one is the current workspace).

Note:
 To “Store” a file you can also use the classical shortcut keyboard “Ctrl+T”

Proprietary Information of Altair Engineering


Altair® FluxMotor® 2024 p. 10

2.6 Save a file.


Save As and Save functions:
In Script Factory application, an edited python file can be saved with a new name (Save As function) or with the same name (Save
function).

How to “Save As” a python Script ?


1 Click on the dropdown menu select the function “Save As”
2 Click on the function “Save As” via the dropdown menu.
3 Give a name to the python script you want to save.
4 Select a working folder to store the new file (The default one is the current workspace).
5 A python file can be saved with the same name with the “Save” function.

Note:
 To “Save” a file you can also use the classical shortcut keyboard “Ctrl+S”
 To “Save as” a file you can also use the classical shortcut keyboard “Ctrl+E”

Proprietary Information of Altair Engineering


Altair® FluxMotor® 2024 p. 11

2.7 Run and Stop


In Script Factory application, there is a launcher of python file, that means an edited python file can be run and stop.

How to run and stop a python Script from the workspace tree?
1 Click on the icon RUN via the LAUNCHER menu to run the Edited file.
2 The LOG folder scrolls during the run and a ping-pong bar appears.
3 To stop the file execution, click on the icon STOP via the LAUNCHER menu.

Proprietary Information of Altair Engineering


Altair® FluxMotor® 2024 p. 12

2.8 Editor
Script Factory editor is located at the center panel of the application, and it allows to edit the python script in the usual way.

Editor main functionality


The editor proposed the following basic functionality through shortcut keyboard:

 “Save” a file - “Ctrl+S”


 “Save as” a file - “Ctrl+E”
 “Store” a file - “Ctrl+T”
 “Find and replace” a string - “Ctrl+F”
 “Undo” an action - “Ctrl+Z”
 “Redo” an action - “Ctrl+Y”
 “Close” the application Script Factory - “Ctrl+Q”

FluxMotor command help files.

How to access to FluxMotor python script command help?


1 Click on the icon “Script Factory” on the top left dropdown menu.
2 Select “Open FluxMotor command help files” option.
List of available DSL (Domain Specific Language) commands dedicated to the main applications of FluxMotor.
3
One must select the one in which are stored the targeted commands.
4 The command list is displayed. One must click on the command name to see the corresponding description.

Proprietary Information of Altair Engineering


Altair® FluxMotor® 2024 p. 13

Log and error

LOG and ERROR tabs


LOG tab gives the information for each command executed in the software and to check whether the command has
1
been executed correctly or not.
2 ERROR tabs give the error message (as popup does in GUI environments)

Proprietary Information of Altair Engineering


Altair® FluxMotor® 2024 p. 14

Open a file in system explorer.


In Script Factory application, a selected python file from the workspace tree can open in system explorer.

How to open a python Script from the workspace tree in system explorer?
1 Select a python file in the workspace tree.
2 Right click on the selected python file and select “Open in the system explorer” option.
3 The system explorer window of the selected file is opened.

Proprietary Information of Altair Engineering


Altair® FluxMotor® 2024 p. 15

3 MISCELLANEOUS TOPICS
3.1 Script for filling the slots.
From the drop-down menu available on the left top part of Motor Factory, it is possible to open a “Debug” dialog box, in which the script
commands can be written and executed.
A new command dedicated to the slot filling has been implemented. It allows to define and apply the geometric slot filling (height filling
factor).

Here is the definition, Geometric fill factor = Height filling factor

Definition of the geometric fill factor = Height filling factor

The script command is:

setDiameterBasedOnGeometricalFillFactor(geoFF=0.65,noTurnsPerCoil =12,noWiresInHand=4)

In this example, the goal is to find the wire diameter, which allows to define a geometric fill factor equal to 0.65 by considering a coil built
with 12 turns and 4 wires in hand (in parallel).

Debug dialog box to execute the script commands

Proprietary Information of Altair Engineering


Altair® FluxMotor® 2024 p. 16

Result, one gets while applying the above command

Note: This script command can run for tooth winding slot a well. In that case the definition of the geometric fill factor = Height filling factor,
can be illustrated as below:

Definition of the geometric fill factor for the tooth winding = Height filling factor

Result one gets while applying the command below:


setDiameterBasedOnGeometricalFillFactor(geoFF=0.55,noTurnsPerCoil=12,noWiresInHand=4)

3.2 Feasibility of the winding architecture and the slot filling


For information, a script command (isWindingValid()) allows to know if the winding is feasible or not.
This is useful from the winding architecture point of view and for the slot filling as well. This command will be able to be used inside an
optimization process to select only the relevant winding configurations for example.

Proprietary Information of Altair Engineering

You might also like