Repository navigation
Tutorial_chapter_1_introduction
PyEDB is a Python API provided by Ansys for interacting with the Electronic Database (EDB), which is the underlying data structure of PCB designs.
In a traditional workflow, engineers perform tasks manually through a graphical interface, such as:
- Inspecting nets
- Modifying stackup
- Creating vias
- Defining ports
With PyEDB, all of these operations can be automated using Python scripts.
To understand the value of PyEDB, it is essential to see its role in the overall simulation flow.
A typical SI/PI workflow looks like this:
PCB Design (Allegro / Altium)
↓
EDB Database
↓
PyEDB (Data Processing / Automation)
↓
PyAEDT (Simulation Control)
↓
HFSS / SIwave Simulation
Key Responsibilities - PyEDB - Focus: Pre-processing and model preparation - Objects: Nets, Vias, Stackup, Components - PyAEDT - Focus: Simulation setup and execution - Objects: Setups, Sweeps, Reports
👉 In short:
PyEDB = “Pre-processing engine”
PyAEDT = “Simulation automation engine”
A common question is:
“If I can do everything in the GUI, why should I use PyEDB?”
The answer lies in three key advantages:
-
Scalability
Example tasks: - Modify the width of hundreds of nets - Automatically widen all power nets - Create ports in batch
👉 GUI: repetitive manual work
👉 PyEDB: one script, fully automated
-
Pre-Simulation Cleanup
Before SIwave or HFSS simulations, common issues include:
- Unused nets
- Floating copper
- Redundant vias
PyEDB can clean up the design automatically, improving simulation robustness and convergence.
-
Pre-Simulation Stackup Update
Common issues with stackup include:
- Wrong layer thicknesses
- Wrong materials
PyEDB can update stackup automatically from a pre-prepared stackup file.
-
Workflow Integration
In enterprise environments, simulations are rarely one-off tasks. Instead, they are part of automated pipelines:
Input Design → Automated Processing → Simulation → Report Generation👉 PyEDB serves as the entry point of this pipeline.
Below are the most commonly used capabilities, organized by practical relevance:
-
Net Operations
- Iterate over all nets
- Search for specific nets (e.g., GND, VDD)
- Rename or delete nets
-
Stackup Manipulation
- Read layer stackup
- Modify dielectric thickness
- Add or remove layers
-
Via and Padstack Operations
- Create vias
- Modify drill sizes
- Batch-edit padstack parameters
-
Component Handling
- Query components
- Access pin information
- Identify power vs signal nets
- Assign SPICE/S-parameter models
-
Layout-Level Operations
- Route signal lines
- Create power planes
-
Setup Simulations
- Place ports
- Create SIwave/HFSS setups
Below is a simple script demonstrating basic usage:
from pyedb import Edb
# Open EDB database
edb = Edb("demo.aedb", version="2026.1")
# Access all nets
nets = edb.nets
# Print net names
for net_name in nets.netlist:
print(net_name)
# Print components on nets
for reference_designator in nets["1V0"].components.keys():
print(reference_designator)This script performs three steps:
- Opens a PCB database
- Retrieves all nets
- Prints their names and components on the nets
👉 Even this minimal example highlights the key capability:
Direct programmatic access to PCB structures
-
Headless Operation
- No GUI required
- Can run on servers
- Ideal for batch processing
-
Object-Oriented API
- Nets, Vias, Stackup are all objects
- Easy to extend and customize workflows
-
Native Python Integration
PyEDB can be combined with:
- numpy for data analysis
- pandas for reporting
- Custom scripts for automation
A common mistake is:
❌ Starting from API documentation
❌ Trying to memorize all functions
👉 A more effective approach:
Examples:
- all signal nets
- vias
- Modify stackup
- Only learn what you need
- Avoid unnecessary abstraction
Over time, you will accumulate reusable tools:
- generation scripts
- modification tools
- preprocessing pipelines
👉 This is where PyEDB delivers real value
In the following chapters, you will learn how to:
- and analyze PCB data
- Nets, Stackup, and Vias
- automation workflows
- with PyAEDT for simulation
The ultimate goal:
Enable you to build a complete PCB automation workflow using PyEDB
This chapter focuses on three key ideas:
- PyEDB is a tool for PCB database manipulation
- It operates in the pre-processing stage of simulation
- Its core value lies in automation, scalability, and reusability
In the next chapter, we will move to hands-on practice:
👉 Environment setup and your first runnable PyEDB script