PyEDB: how to get minimum via diameter?

ansys-satyajeet
ansys-satyajeet Member, Employee Posts: 14
Photogenic First Anniversary Ansys Employee First Comment
✭✭✭

How to get min via diameter in an ECAD using PyEDB?

Tagged:

Answers

  • ansys-satyajeet
    ansys-satyajeet Member, Employee Posts: 14
    Photogenic First Anniversary Ansys Employee First Comment
    ✭✭✭
    edited July 22

    Start with import pyedb which is a python library to handle ECAD files.

    import pyedb
    

    Import ECAD using pyedb. The session is run in a non-graphical mode.

    edb = pyedb.Edb(ecad_path, edbversion=2024.2)
    

    Get the min via diameter using the following lines

    unique_padstack_defs = {via.padstack_definition for via in edb.padstacks.vias.values()}
    min_via_dia = min(edb.padstacks.definitions[name].hole_diameter for name in unique_padstack_defs)
    

    Close the edb session

    edb.close()
    
  • svandenb-dev
    svandenb-dev Member, Employee Posts: 4
    First Anniversary Ansys Employee First Answer Name Dropper
    ✭✭✭

    Thanks @ansys-satyajeet,
    I guess you posted this code for sharing the information ?
    If you are interested I can also add you as contributor in PyEDB and you could write examples on PyEDB online doc. Thanks