create_port_on_pins#

Components.create_port_on_pins(refdes, pins, reference_pins, impedance=50.0, port_name=None, pec_boundary=False, pingroup_on_single_pin=False)[source]#

Create circuit port between pins and reference ones.

Parameters:
refdesComponent reference designator

str or EDBComponent object.

pinspin name where the terminal has to be created. Single pin or several ones can be provided.If several
pins are provided a pin group will is created. Pin names can be the EDB name or the EDBPadstackInstance one.
For instance the pin called ``Pin1`` located on component ``U1``, ``U1-Pin1`` or ``Pin1`` can be provided and
will be handled.

str, [str], EDBPadstackInstance, [EDBPadstackInstance]

reference_pinsreference pin name used for terminal reference. Single pin or several ones can be provided.
If several pins are provided a pin group will is created. Pin names can be the EDB name or the
EDBPadstackInstance one. For instance the pin called ``Pin1`` located on component ``U1``, ``U1-Pin1``
or ``Pin1`` can be provided and will be handled.

str, [str], EDBPadstackInstance, [EDBPadstackInstance]

impedancePort impedance

str, float

port_namestr, optional

Port name. The default is None, in which case a name is automatically assigned.

pec_boundarybool, optional
Whether to define the PEC boundary, The default is ``False``. If set to ``True``,
a perfect short is created between the pin and impedance is ignored. This
parameter is only supported on a port created between two pins, such as
when there is no pin group.
pingroup_on_single_pinbool

If True force using pingroup definition on single pin to have the port created at the pad center. If False the port is created at the pad edge. Default value is False.

Returns:
EDB terminal created, or False if failed to create.
Example:
>>> :obj:`from` :obj:`pyedb` :obj:`import` :obj:`Edb`
    ..
>>> :obj:`edb` = :obj:`Edb`\(:obj:`path_to_edb_file`)
    ..
>>> :obj:`pin` = "AJ6"
    ..
>>> :obj:`ref_pins` = ["AM7", "AM4"]
    ..
Or to take all reference pins
>>> :obj:`ref_pins` = [:obj:`pin` :obj:`for` :obj:`pin` :obj:`in` :class:`python:list`\(:obj:`edb.components`\["U2A5"]:obj:`.pins.values`\()) :obj:`if` :obj:`pin.net_name` == "GND"]
    ..
>>> :obj:`edb.components.create_port_on_pins`\(refdes="U2A5", pins=pin, reference_pins=ref_pins)
    ..
>>> :obj:`edb.save_edb`\()
    ..
>>> :obj:`edb.close_edb`\()
    ..