|
16 | 16 |
|
17 | 17 | import os |
18 | 18 | import tempfile |
19 | | - |
20 | | -from ansys.aedt.core.hfss3dlayout import Hfss3dLayout |
21 | | -from pyedb.dotnet.edb import Edb |
22 | | -from pyedb.generic.settings import settings |
| 19 | +from pyedb import Edb |
23 | 20 | from pyedb.misc.downloads import download_file |
| 21 | +from ansys.aedt.core.hfss3dlayout import Hfss3dLayout |
24 | 22 |
|
25 | | -# ### Define constants |
| 23 | +# ### Define constant |
26 | 24 | # Constants help ensure consistency and avoid repetition throughout the example. |
27 | 25 |
|
28 | | -AEDT_VERSION = "2025.2" |
29 | | -settings.specified_version = AEDT_VERSION |
| 26 | +AEDT_VERSION= "2025.2" |
30 | 27 | NG_MODE = False # Open AEDT UI when it is launched. |
31 | 28 |
|
32 | 29 | # ### Create temporary directory |
|
41 | 38 |
|
42 | 39 | # ### Import a GDS file. |
43 | 40 | # |
44 | | -# Download the test case folder and copy it to the working directory. The |
45 | | -# method ``download_file()`` retrieves example data from the |
| 41 | +# Download the test case folder and copy it to the working directory. The |
| 42 | +# method ``download_file()`` retrieves example data from the |
46 | 43 | # [Ansys GitHub "example_data" repository](https://github.com/ansys/example-data/tree/main/pyaedt). |
47 | 44 | # |
48 | 45 | # The following files are used in this example: |
|
72 | 69 | # |
73 | 70 | # Open the EDB by creating an instance of the ``Edb`` class. |
74 | 71 |
|
75 | | -edb = Edb(gds_in, control_file=control_file, map_file=map_file) |
| 72 | +edb = Edb(gds_in, control_file=control_file, map_file=map_file, version=AEDT_VERSION) |
76 | 73 |
|
77 | 74 | # ### View the layer stackup |
78 | 75 |
|
|
81 | 78 | # ### Save and close the EDB |
82 | 79 | # |
83 | 80 | # The GDS file has been converted to an EDB and is ready for subsequent processing either in the |
84 | | -# 3D Layout UI of Electronics Desktop or using |
85 | | -# PyEDB. |
86 | | -# The following commands save and close the EDB. |
| 81 | +# 3D Layout UI of Electronics Desktop or using |
| 82 | +# PyEDB. |
| 83 | +# The following commands save and close the EDB. |
87 | 84 |
|
88 | 85 | edb_path = os.path.join(temp_folder.name, "gds_design.aedb") |
89 | 86 | edb.save_as(edb_path) |
|
96 | 93 | # |
97 | 94 | # <img src="_static/layout.png" width="800"> |
98 | 95 |
|
99 | | -h3d = Hfss3dLayout( |
100 | | - project=edb_path, version=settings.specified_version, new_desktop=NG_MODE |
101 | | -) |
| 96 | +h3d = Hfss3dLayout(project=edb_path, version=AEDT_VERSION, new_desktop=NG_MODE) |
102 | 97 |
|
103 | | -# ### Close the HFSS 3D Layout |
| 98 | +# ### Close the HFSS 3D Layout |
104 | 99 | # The following command releases Ansys Electronics Desktop and closes the project. |
105 | 100 |
|
106 | 101 | h3d.release_desktop() |
107 | | - |
108 | | -# ### Clean up |
109 | | -# |
110 | | -# All project files are saved in the folder ``temp_folder.name``. |
111 | | -# If you've run this example as a Jupyter notebook, you |
112 | | -# can retrieve those project files. The following cell |
113 | | -# removes all temporary files, including the project folder. |
114 | | - |
115 | | -temp_folder.cleanup() |
0 commit comments