|
25 | 25 | AEDT_VERSION = "2024.2"
|
26 | 26 | NG_MODE = False # Open Electronics UI when the application is launched.
|
27 | 27 |
|
28 |
| -# Create temporary directory |
| 28 | +# ## Create temporary directory |
| 29 | +# |
| 30 | +# Create temporary directory. |
| 31 | +# If you'd like to retrieve the project data for subsequent use, |
| 32 | +# the temporary folder name is given by ``temp_folder.name``. |
29 | 33 |
|
30 |
| -temp_dir = tempfile.TemporaryDirectory(suffix=".ansys") |
| 34 | +temp_folder = tempfile.TemporaryDirectory(suffix=".ansys") |
31 | 35 |
|
32 | 36 | # Create an HFSS object.
|
33 | 37 |
|
|
37 | 41 | close_on_exit=True,
|
38 | 42 | non_graphical=NG_MODE,
|
39 | 43 | )
|
40 |
| -hfss.save_project(os.path.join(temp_dir.name, "example.aedt")) |
| 44 | +hfss.save_project(os.path.join(temp_folder.name, "example.aedt")) |
41 | 45 |
|
42 | 46 | # ## Variable definition
|
43 | 47 | #
|
|
121 | 125 | # Multiple options are available to partially select objects, cs, boundaries and mesh operations.
|
122 | 126 | # Furthermore, encrypted 3d comp can be created too.
|
123 | 127 |
|
124 |
| -component_path = os.path.join(temp_dir.name, "component_test.aedbcomp") |
| 128 | +component_path = os.path.join(temp_folder.name, "component_test.aedbcomp") |
125 | 129 | hfss.modeler.create_3dcomponent(component_path, "patch_antenna")
|
126 | 130 |
|
127 | 131 | # ## Multiple project management
|
128 | 132 | #
|
129 | 133 | # PyAEDT allows to control multiple projects, design and solution type at the same time.
|
130 | 134 |
|
131 |
| -new_project = os.path.join(temp_dir.name, "new_project.aedt") |
| 135 | +new_project = os.path.join(temp_folder.name, "new_project.aedt") |
132 | 136 | hfss2 = Hfss(version=AEDT_VERSION, project=new_project, design="new_design")
|
133 | 137 |
|
134 | 138 | # ## Insert 3D component
|
|
195 | 199 |
|
196 | 200 | # ## Cleanup
|
197 | 201 | #
|
198 |
| -# All project files are saved in the folder ``temp_dir.name``. |
| 202 | +# All project files are saved in the folder ``temp_folder.name``. |
199 | 203 | # If you've run this example as a Jupyter notebook you
|
200 | 204 | # can retrieve those project files. The following cell removes
|
201 | 205 | # all temporary files, including the project folder.
|
202 | 206 |
|
203 |
| -temp_dir.cleanup() |
| 207 | +temp_folder.cleanup() |
0 commit comments