Download this example
Download this example as a Jupyter Notebook or as a Python script.
GDS Import#
Integrated circuit layout data is defined in GDS data which specifies the layout geometry. Additionally, layer mapping and layer material information is defined in a technology file.
This example demonstrates how to import GDS files and translate GDS data into an EDB file along with some simplified technology data for subsequent use in HFSS 3D Layout.
Keywords: GDS, RFIC
Prerequisites#
Perform imports#
[1]:
import os
import tempfile
from pyedb import Edb
from pyedb.misc.downloads import download_file
from ansys.aedt.core.hfss3dlayout import Hfss3dLayout
Define constant#
Constants help ensure consistency and avoid repetition throughout the example.
[2]:
AEDT_VERSION= "2025.2"
NG_MODE = False # Open AEDT UI when it is launched.
Create temporary directory#
Create a temporary working directory. The name of the working folder is stored in temp_folder.name.
Note: The final cell in the notebook cleans up the temporary folder. If you want to retrieve the AEDT project and data, do so before executing the final cell in the notebook.
[3]:
temp_folder = tempfile.TemporaryDirectory(suffix=".ansys")
Import a GDS file.#
Download the test case folder and copy it to the working directory. The method download_file() retrieves example data from the Ansys GitHub “example_data” repository.
The following files are used in this example:
Model.xmldefines physical information such as material properties, stackup layer names, and boundary conditions.Model.gdscontains the GDS data for the layout.Model.mapmaps properties to stackup layers.
[4]:
control_fn = "Model.xml"
gds_fn = "Model.gds"
layer_map = "Model.map"
local_path = download_file("gds", destination=temp_folder.name)
control_file = os.path.join(local_path, control_fn)
map_file = os.path.join(local_path, layer_map)
gds_in = os.path.join(local_path, gds_fn)
Open the EDB#
Each GDS file requires a control file (XML) or a technology file (IRCX, VLC.TECH, or ITF) that maps the GDS geometry to a physical layer in the stackup. The MAP file is also regularly used to map the stackup layers, and finally in some cases a layer filter (XML) is deployed, when only a part of the stackup is needed.
Open the EDB by creating an instance of the Edb class.
[5]:
edb = Edb(gds_in, control_file=control_file, map_file=map_file, version=AEDT_VERSION)
C:\actions-runner\_work\pyaedt-examples\pyaedt-examples\.venv\lib\site-packages\pyedb\generic\design_types.py:301: UserWarning: Your ANSYS AEDT version is eligible to gRPC version.You might consider switching to that version for better user experience.For more information please check this link: https://edb.docs.pyansys.com/version/dev/grpc_api/index.html
warnings.warn(GRPC_GENERAL_WARNING, UserWarning)
PyEDB INFO: Star initializing Edb 13:09:18.211461
INFO:Edb:Star initializing Edb 13:09:18.211461
PyEDB INFO: Edb version 2025.2
INFO:Edb:Edb version 2025.2
PyEDB INFO: Logger is initialized. Log file is saved to C:\Users\ansys\AppData\Local\Temp\pyedb_ansys.log.
INFO:Edb:Logger is initialized. Log file is saved to C:\Users\ansys\AppData\Local\Temp\pyedb_ansys.log.
PyEDB INFO: legacy v0.61.0
INFO:Edb:legacy v0.61.0
PyEDB INFO: Python version 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
INFO:Edb:Python version 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
PyEDB INFO: Translation correctly completed
INFO:Edb:Translation correctly completed
PyEDB INFO: Database Model.aedb Opened in 2025.2
INFO:Edb:Database Model.aedb Opened in 2025.2
PyEDB INFO: Cell IC_Wo_Component1 Opened
INFO:Edb:Cell IC_Wo_Component1 Opened
PyEDB INFO: Builder was initialized.
INFO:Edb:Builder was initialized.
PyEDB INFO: open_edb completed in 8.6802 seconds.
INFO:Edb:open_edb completed in 8.6802 seconds.
PyEDB INFO: import_layout_file completed in 10.1571 seconds.
INFO:Edb:import_layout_file completed in 10.1571 seconds.
PyEDB INFO: EDB C:\Users\ansys\AppData\Local\Temp\tmptftn7x4q.ansys\gds\Model.aedb was created correctly from ds file.
INFO:Edb:EDB C:\Users\ansys\AppData\Local\Temp\tmptftn7x4q.ansys\gds\Model.aedb was created correctly from ds file.
PyEDB INFO: EDB initialization completed in 10.2367 seconds.
INFO:Edb:EDB initialization completed in 10.2367 seconds.
View the layer stackup#
[6]:
edb.stackup.plot()
[6]:
<module 'matplotlib.pyplot' from 'C:\\actions-runner\\_work\\pyaedt-examples\\pyaedt-examples\\.venv\\lib\\site-packages\\matplotlib\\pyplot.py'>
Save and close the EDB#
The GDS file has been converted to an EDB and is ready for subsequent processing either in the 3D Layout UI of Electronics Desktop or using PyEDB. The following commands save and close the EDB.
[7]:
edb_path = os.path.join(temp_folder.name, "gds_design.aedb")
edb.save_as(edb_path)
edb.close()
PyEDB INFO: EDB file save completed in 0.0313 seconds.
INFO:Edb:EDB file save completed in 0.0313 seconds.
PyEDB INFO: Close Edb file completed in 0.0000 seconds.
INFO:Edb:Close Edb file completed in 0.0000 seconds.
[7]:
True
View the layout#
Open the EDB in Electronics Desktop#
The following command opens the EDB in Electronics Desktop. If you’re running this example locally, you should see something like this:

[8]:
h3d = Hfss3dLayout(project=edb_path, version=AEDT_VERSION, new_desktop=NG_MODE)
PyAEDT INFO: Python version 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)].
INFO:Global:Python version 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)].
PyAEDT INFO: PyAEDT version 0.22.dev0.
INFO:Global:PyAEDT version 0.22.dev0.
PyAEDT INFO: Initializing new Desktop session.
INFO:Global:Initializing new Desktop session.
PyAEDT INFO: Log on console is enabled.
INFO:Global:Log on console is enabled.
PyAEDT INFO: Log on file C:\Users\ansys\AppData\Local\Temp\pyaedt_ansys_8c165088-b419-4b94-8018-dd1236aad960.log is enabled.
INFO:Global:Log on file C:\Users\ansys\AppData\Local\Temp\pyaedt_ansys_8c165088-b419-4b94-8018-dd1236aad960.log is enabled.
PyAEDT INFO: Log on AEDT is disabled.
INFO:Global:Log on AEDT is disabled.
PyAEDT INFO: Debug logger is disabled. PyAEDT methods will not be logged.
INFO:Global:Debug logger is disabled. PyAEDT methods will not be logged.
PyAEDT INFO: Launching PyAEDT with gRPC plugin.
INFO:Global:Launching PyAEDT with gRPC plugin.
PyAEDT INFO: New AEDT session is starting on gRPC port 52058.
INFO:Global:New AEDT session is starting on gRPC port 52058.
PyAEDT INFO: Electronics Desktop started on gRPC port: 52058 after 10.908788681030273 seconds.
INFO:Global:Electronics Desktop started on gRPC port: 52058 after 10.908788681030273 seconds.
PyAEDT INFO: AEDT installation Path C:\Program Files\ANSYS Inc\v252\AnsysEM
INFO:Global:AEDT installation Path C:\Program Files\ANSYS Inc\v252\AnsysEM
PyAEDT INFO: Ansoft.ElectronicsDesktop.2025.2 version started with process ID 6024.
INFO:Global:Ansoft.ElectronicsDesktop.2025.2 version started with process ID 6024.
PyAEDT INFO: EDB folder C:\Users\ansys\AppData\Local\Temp\tmptftn7x4q.ansys\gds_design.aedb has been imported to project gds_design
INFO:Global:EDB folder C:\Users\ansys\AppData\Local\Temp\tmptftn7x4q.ansys\gds_design.aedb has been imported to project gds_design
PyAEDT INFO: Active Design set to 0;IC_Wo_Component1
INFO:Global:Active Design set to 0;IC_Wo_Component1
PyAEDT INFO: Active Design set to 0;IC_Wo_Component1
INFO:Global:Active Design set to 0;IC_Wo_Component1
PyAEDT INFO: Aedt Objects correctly read
INFO:Global:Aedt Objects correctly read
Close the HFSS 3D Layout#
The following command releases Ansys Electronics Desktop and closes the project.
[9]:
h3d.release_desktop()
PyAEDT INFO: Desktop has been released and closed.
INFO:Global:Desktop has been released and closed.
[9]:
True
Download this example
Download this example as a Jupyter Notebook or as a Python script.