Skip to content

Commit e8ec429

Browse files
Save project in temp folder
1 parent 1e67a1d commit e8ec429

4 files changed

+8
-6
lines changed

examples/03-Maxwell/Maxwell2D_Electrostatic.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@
6565
# the solver, and the version. The following code also creates an instance of the
6666
# ``Maxwell2d`` class named ``m2d``.
6767

68+
project_name = os.path.join(temp_dir.name, "M2D_Electrostatic.aedt")
6869
m2d = pyaedt.Maxwell2d(
69-
project=pyaedt.generate_unique_project_name(),
70+
project=project_name,
7071
version=AEDT_VERSION,
7172
design="Design1",
7273
solution_type="Electrostatic",

examples/03-Maxwell/Maxwell2D_PMSynchronousMotor.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,9 @@
109109
# the solver, and the version. The following code also creates an instance of the
110110
# ``Maxwell2d`` class named ``m2d``.
111111

112+
project_name = os.path.join(temp_dir.name, "PM_Motor.aedt")
112113
m2d = pyaedt.Maxwell2d(
113-
project=pyaedt.generate_unique_project_name(),
114+
project=project_name,
114115
version=AEDT_VERSION,
115116
design="Sinusoidal",
116117
solution_type="TransientXY",

examples/03-Maxwell/Maxwell2D_Transient.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,13 @@
4444
#
4545
# Insert a Maxwell 2D design.
4646

47+
project_name = os.path.join(temp_dir.name, "Transient.aedt")
4748
m2d = pyaedt.Maxwell2d(
4849
solution_type="TransientXY",
4950
version=AEDT_VERSION,
5051
non_graphical=NG_MODE,
5152
new_desktop=True,
52-
project=pyaedt.generate_unique_project_name(),
53+
project=project_name,
5354
)
5455

5556
# ## Create rectangle and duplicate it

examples/03-Maxwell/Maxwell2D_transformer_LL.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@
88

99
# ## Perform required imports
1010

11-
# +
11+
import os
1212
import tempfile
1313
import time
1414

1515
from pyaedt import Maxwell2d
1616

17-
# -
18-
1917
# ## Define constants
2018

2119
AEDT_VERSION = "2024.2"
@@ -36,6 +34,7 @@
3634
# name and type.
3735

3836
# +
37+
3938
project_name = os.path.join(temp_dir.name, "Magnetostatic.aedt")
4039
m2d = Maxwell2d(
4140
version=AEDT_VERSION,

0 commit comments

Comments
 (0)