EDB Parametric Via Creation

This example shows how to use EDB to create a layout.

# sphinx_gallery_thumbnail_path = 'Resources/3dlayout.png'

Import the EDB Layout Object

This example imports the EDB layout object and initializes it on version 2021.1.

import time
import os
import tempfile
from pyaedt import Edb
from pyaedt.generic.general_methods import generate_unique_name

start = time.time()

tmpfold = tempfile.gettempdir()
aedb_path = os.path.join(tmpfold, generate_unique_name("pcb") + ".aedb")
print(aedb_path)
edb = Edb(edbpath=aedb_path, edbversion="2021.1")

Out:

C:\Users\ansys\AppData\Local\Temp\pcb_FWEVPG.aedb
pyaedt info: Logger Started on C:\Users\ansys\AppData\Local\Temp\pyaedt20211026_140500.log
pyaedt info: Logger Initialized in EDB
pyaedt info: Refreshing the Components dictionary.
pyaedt info: Refreshing the Components dictionary.
pyaedt info: Refreshing the Components dictionary.
pyaedt info: Refreshing the Components dictionary.
pyaedt info: Refreshing the Components dictionary.
pyaedt info: Refreshing the Components dictionary.
pyaedt info: Refreshing the Components dictionary.
pyaedt info: Objects Initialized
pyaedt info: Edb C:\Users\ansys\AppData\Local\Temp\pcb_FWEVPG.aedb Created Correctly
pyaedt info: Edb Initialized

Create a Stackup

This method adds the stackup layers.

if edb:
    edb.core_stackup.stackup_layers.add_layer("GND")
    edb.core_stackup.stackup_layers.add_layer("Diel", "GND", layerType=1, thickness="0.1mm", material="FR4_epoxy")
    edb.core_stackup.stackup_layers.add_layer("TOP", "Diel", thickness="0.05mm")

Create a Signal Net and Ground Planes

This example creates a signal net and ground planes.

if edb:
    points = [
        [0.0, 0],
        [100e-3, 0.0],
    ]
    path = edb.core_primitives.Shape("polygon", points=points)
    edb.core_primitives.create_path(path, "TOP", width=1e-3)
    points = [[0.0, 1e-3], [0.0, 10e-3], [100e-3, 10e-3], [100e-3, 1e-3], [0.0, 1e-3]]
    plane = edb.core_primitives.Shape("polygon", points=points)
    edb.core_primitives.create_polygon(plane, "TOP")

    points = [[0.0, -1e-3], [0.0, -10e-3], [100e-3, -10e-3], [100e-3, -1e-3], [0.0, -1e-3]]
    plane = edb.core_primitives.Shape("polygon", points=points)
    edb.core_primitives.create_polygon(plane, "TOP")

Out:

pyaedt info: Primitives Updated

Create Vias with Parametric Positions

This example creates vias with parametric positions.

if edb:
    edb.core_padstack.create_padstack("MyVia")
    edb.core_padstack.place_padstack([5e-3, 5e-3], "MyVia")
    edb.core_padstack.place_padstack([15e-3, 5e-3], "MyVia")
    edb.core_padstack.place_padstack([35e-3, 5e-3], "MyVia")
    edb.core_padstack.place_padstack([45e-3, 5e-3], "MyVia")
    edb.core_padstack.place_padstack([5e-3, -5e-3], "MyVia")
    edb.core_padstack.place_padstack([15e-3, -5e-3], "MyVia")
    edb.core_padstack.place_padstack([35e-3, -5e-3], "MyVia")
    edb.core_padstack.place_padstack([45e-3, -5e-3], "MyVia")

Out:

pyaedt info: Padstack MyVia create correctly

Save and Close EDB

This example saves and closes EDB.

if edb:
    edb.save_edb()
    edb.close_edb()
print("EDB saved correctly to {}. You can import in AEDT.".format(aedb_path))
end = time.time() - start
print(end)

Out:

pyaedt info: EDB file release time: 0.00ms
EDB saved correctly to C:\Users\ansys\AppData\Local\Temp\pcb_FWEVPG.aedb. You can import in AEDT.
16.1832435131073

Total running time of the script: ( 0 minutes 16.183 seconds)

Gallery generated by Sphinx-Gallery