Skip to content

Commit 44ebcb3

Browse files
authored
REFACTOR: Update GDS workflow to match pyedb new API (#422)
1 parent 49ad140 commit 44ebcb3

File tree

1 file changed

+12
-26
lines changed

1 file changed

+12
-26
lines changed

examples/edb/legacy_standalone/gds_workflow.py

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,14 @@
1616

1717
import os
1818
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
2320
from pyedb.misc.downloads import download_file
21+
from ansys.aedt.core.hfss3dlayout import Hfss3dLayout
2422

25-
# ### Define constants
23+
# ### Define constant
2624
# Constants help ensure consistency and avoid repetition throughout the example.
2725

28-
AEDT_VERSION = "2025.2"
29-
settings.specified_version = AEDT_VERSION
26+
AEDT_VERSION= "2025.2"
3027
NG_MODE = False # Open AEDT UI when it is launched.
3128

3229
# ### Create temporary directory
@@ -41,8 +38,8 @@
4138

4239
# ### Import a GDS file.
4340
#
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
4643
# [Ansys GitHub "example_data" repository](https://github.com/ansys/example-data/tree/main/pyaedt).
4744
#
4845
# The following files are used in this example:
@@ -72,7 +69,7 @@
7269
#
7370
# Open the EDB by creating an instance of the ``Edb`` class.
7471

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)
7673

7774
# ### View the layer stackup
7875

@@ -81,9 +78,9 @@
8178
# ### Save and close the EDB
8279
#
8380
# 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.
8784

8885
edb_path = os.path.join(temp_folder.name, "gds_design.aedb")
8986
edb.save_as(edb_path)
@@ -96,20 +93,9 @@
9693
#
9794
# <img src="_static/layout.png" width="800">
9895

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)
10297

103-
# ### Close the HFSS 3D Layout
98+
# ### Close the HFSS 3D Layout
10499
# The following command releases Ansys Electronics Desktop and closes the project.
105100

106101
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

Comments
 (0)