Components#
- class pyedb.grpc.database.components.Components(p_edb: Any)#
Bases:
objectManages EDB components and related methods accessible from Edb.components.
- Parameters:
- p_edb
pyedb.grpc.edb.Edb EDB object.
- p_edb
Examples
>>> from pyedb import Edb >>> edbapp = Edb("myaedbfolder") >>> edbapp.components
Overview#
Import component definitions from a JSON file. |
|
Export component definitions to a JSON file. |
|
Refresh the component dictionary. |
|
Retrieve a component by name. |
|
Get pins from a component with optional filtering. |
|
Get components connected to specified nets. |
|
Get placement vector between two components. |
|
Get solder ball height of a component. |
|
Get vendor component libraries. |
|
Create sources on components. |
|
Create port on pins. |
|
Create ports on a component. |
|
Create a new component. |
|
Create component from pins. |
|
Set component model. |
|
Create pin group from pins. |
|
Delete or deactivate single-pin RLC components. |
|
Delete a component. |
|
Disable RLC component. |
|
Set solder ball properties for a component. |
|
Set RLC values for a component. |
|
Update RLC values from BOM file. |
|
Import BOM file. |
|
Export BOM file. |
|
Find component by reference designator. |
|
Get AEDT pin name. |
|
Get pins of a component. |
|
Get pin position. |
|
Get pin names from net. |
|
Get nets from pin list. |
|
Get net connection info for a component. |
|
Get RATS (Reference Designator, Pin, Net) information. |
|
Get through resistors below threshold. |
|
Short component pins with traces. |
|
Create pin group on a component. |
|
Create pin group by net name. |
|
Deactivate RLC component with a possibility to convert it to a circuit port. |
|
Deactivate RLC component and replace it with a circuit port. |
|
Replace RLC component by RLC gap boundaries. These boundary types are compatible with 3D modeler export. |
|
Add RLC gap boundary on component and replace it with a circuit port. |
Dictionary of all component instances in the layout. |
|
Dictionary of all component definitions. |
|
Dictionary of N-port component definitions. |
|
Dictionary of resistor components. |
|
Dictionary of capacitor components. |
|
Dictionary of inductor components. |
|
Dictionary of integrated circuit components. |
|
Dictionary of I/O components. |
|
Dictionary of other components. |
|
Dictionary of components grouped by part name. |
Get a component or component definition by name. |
Import detail#
from pyedb.grpc.database.components import Components
Property detail#
- property Components.instances: Dict[str, pyedb.grpc.database.hierarchy.component.Component]#
Dictionary of all component instances in the layout.
- Returns:
dict[str,pyedb.grpc.database.hierarchy.component.Component]Dictionary of component instances keyed by name.
Examples
>>> edbapp.components.instances
- property Components.definitions: Dict[str, pyedb.grpc.database.definition.component_def.ComponentDef]#
Dictionary of all component definitions.
- Returns:
dict[str,pyedb.grpc.database.definition.component_def.ComponentDef]Dictionary of component definitions keyed by name.
Examples
>>> edbapp.components.definitions
- property Components.nport_comp_definition: Dict[str, pyedb.grpc.database.hierarchy.component.Component]#
Dictionary of N-port component definitions.
- Returns:
dict[str,pyedb.grpc.database.hierarchy.component.Component]Dictionary of N-port component definitions keyed by name.
- property Components.resistors: Dict[str, pyedb.grpc.database.hierarchy.component.Component]#
Dictionary of resistor components.
- Returns:
dict[str,pyedb.grpc.database.hierarchy.component.Component]Dictionary of resistor components keyed by name.
Examples
>>> edbapp.components.resistors
- property Components.capacitors: Dict[str, pyedb.grpc.database.hierarchy.component.Component]#
Dictionary of capacitor components.
- Returns:
dict[str,pyedb.grpc.database.hierarchy.component.Component]Dictionary of capacitor components keyed by name.
Examples
>>> edbapp.components.capacitors
- property Components.inductors: Dict[str, pyedb.grpc.database.hierarchy.component.Component]#
Dictionary of inductor components.
- Returns:
dict[str,pyedb.grpc.database.hierarchy.component.Component]Dictionary of inductor components keyed by name.
Examples
>>> edbapp.components.inductors
- property Components.ICs: Dict[str, pyedb.grpc.database.hierarchy.component.Component]#
Dictionary of integrated circuit components.
- Returns:
dict[str,pyedb.grpc.database.hierarchy.component.Component]Dictionary of IC components keyed by name.
Examples
>>> edbapp.components.ICs
- property Components.IOs: Dict[str, pyedb.grpc.database.hierarchy.component.Component]#
Dictionary of I/O components.
- Returns:
dict[str,pyedb.grpc.database.hierarchy.component.Component]Dictionary of I/O components keyed by name.
Examples
>>> edbapp.components.IOs
- property Components.Others: Dict[str, pyedb.grpc.database.hierarchy.component.Component]#
Dictionary of other components.
- Returns:
dict[str,pyedb.grpc.database.hierarchy.component.Component]Dictionary of other components keyed by name.
Examples
>>> edbapp.components.Others
- property Components.components_by_partname: Dict[str, List[pyedb.grpc.database.hierarchy.component.Component]]#
Dictionary of components grouped by part name.
- Returns:
dict[str,list[pyedb.grpc.database.hierarchy.component.Component]]Dictionary of components lists keyed by part name.
Examples
>>> edbapp.components.components_by_partname
Method detail#
- Components.__getitem__(name: str) pyedb.grpc.database.hierarchy.component.Component | pyedb.grpc.database.definition.component_def.ComponentDef | None#
Get a component or component definition by name.
- Parameters:
- name
str Name of the component or definition.
- name
- Returns:
pyedb.grpc.database.hierarchy.component.Componentorpyedb.grpc.database.definition.component_def.ComponentDeforNoneComponent instance if found, component definition if found by name, otherwise None.
Examples
>>> component = edbapp.components["R1"]
- Components.import_definition(file_path) bool#
Import component definitions from a JSON file.
Examples
>>> edbapp.components.import_definition("definitions.json")
- Components.export_definition(file_path) bool#
Export component definitions to a JSON file.
- Parameters:
- file_path
str Path to the output JSON file.
- file_path
- Returns:
- bool
True if successful, False otherwise.
Examples
>>> edbapp.components.export_definition("exported_definitions.json")
- Components.refresh_components() bool#
Refresh the component dictionary.
- Returns:
- bool
True if successful, False otherwise.
Examples
>>> edbapp.components.refresh_components()
- Components.get_component_by_name(name) pyedb.grpc.database.hierarchy.component.Component#
Retrieve a component by name.
- Parameters:
- name
str Name of the component.
- name
- Returns:
pyedb.grpc.database.hierarchy.component.ComponentComponent instance.
Examples
>>> comp = edbapp.components.get_component_by_name("R1")
- Components.get_pin_from_component(component: str | pyedb.grpc.database.hierarchy.component.Component, net_name: str | List[str] | None = None, pin_name: str | None = None) List[Any]#
Get pins from a component with optional filtering.
- Parameters:
- Returns:
list[pyedb.grpc.database.padstacks.PadstackInstance]List of pin instances.
Examples
>>> pins = edbapp.components.get_pin_from_component("R1", net_name="GND")
- Components.get_components_from_nets(netlist=None) list[str]#
Get components connected to specified nets.
- Parameters:
- Returns:
Examples
>>> comps = edbapp.components.get_components_from_nets(["GND", "VCC"])
- Components.get_component_placement_vector(mounted_component: pyedb.grpc.database.hierarchy.component.Component, hosting_component: pyedb.grpc.database.hierarchy.component.Component, mounted_component_pin1: str, mounted_component_pin2: str, hosting_component_pin1: str, hosting_component_pin2: str, flipped: bool = False) Tuple[bool, List[float], float, float]#
Get placement vector between two components.
- Parameters:
- mounted_component
pyedb.grpc.database.hierarchy.component.Component Mounted component.
- hosting_component
pyedb.grpc.database.hierarchy.component.Component Hosting component.
- mounted_component_pin1
str Pin name on mounted component.
- mounted_component_pin2
str Pin name on mounted component.
- hosting_component_pin1
str Pin name on hosting component.
- hosting_component_pin2
str Pin name on hosting component.
- flippedbool,
optional Whether the component is flipped.
- mounted_component
- Returns:
tuple(success, vector, rotation, solder_ball_height)
Examples
>>> vec, rot, height = edbapp.components.get_component_placement_vector(...)
- Components.get_solder_ball_height(cmp: str | pyedb.grpc.database.hierarchy.component.Component) float#
Get solder ball height of a component.
- Parameters:
- cmp
strorpyedb.grpc.database.hierarchy.component.Component Component name or instance.
- cmp
- Returns:
floatSolder ball height in meters.
Examples
>>> height = edbapp.components.get_solder_ball_height("U1")
- Components.get_vendor_libraries() pyedb.component_libraries.ansys_components.ComponentLib#
Get vendor component libraries.
- Returns:
pyedb.component_libraries.ansys_components.ComponentLibComponent library object.
Examples
>>> lib = edbapp.components.get_vendor_libraries()
- Components.create_source_on_component(sources=None)#
Create sources on components.
Deprecated since version 0.28.0: Use
pyedb.grpc.core.excitations.create_source_on_component()instead.
- Components.create_port_on_pins(refdes, pins, reference_pins, impedance=50.0, port_name=None, pec_boundary=False, pingroup_on_single_pin=False)#
Create port on pins.
Deprecated since version 0.28.0: Use
pyedb.grpc.core.excitations.create_port_on_pins()instead.- Parameters:
- Returns:
- bool
True if successful, False otherwise.
- Components.create_port_on_component(component, net_list, port_type=SourceType.CoaxPort, do_pingroup=True, reference_net='gnd', port_name=None, solder_balls_height=None, solder_balls_size=None, solder_balls_mid_size=None, extend_reference_pins_outside_component=False)#
Create ports on a component.
Deprecated since version 0.28.0: Use
pyedb.grpc.core.excitations.create_port_on_component()instead.- Parameters:
- component
str Component name.
- net_list
list List of nets.
- port_type
SourceType,optional Port type.
- do_pingroupbool,
optional Use pin groups.
- reference_net
str,optional Reference net.
- port_name
str,optional Port name.
- solder_balls_height
float,optional Solder ball height.
- solder_balls_size
float,optional Solder ball size.
- solder_balls_mid_size
float,optional Solder ball mid size.
- extend_reference_pins_outside_componentbool,
optional Extend reference pins outside component.
- component
- Returns:
- bool
True if successful, False otherwise.
- Components.create(pins: List[Any], component_name: str | None = None, placement_layer: str | None = None, component_part_name: str | None = None, is_rlc: bool = False, r_value: float | None = None, c_value: float | None = None, l_value: float | None = None, is_parallel: bool = False) pyedb.grpc.database.hierarchy.component.Component | bool#
Create a new component.
- Parameters:
- pins
list[pyedb.grpc.database.padstacks.PadstackInstance] List of pins.
- component_name
str,optional Component name.
- placement_layer
str,optional Placement layer name.
- component_part_name
str,optional Part name.
- is_rlcbool,
optional Whether the component is RLC.
- r_value
float,optional Resistance value.
- c_value
float,optional Capacitance value.
- l_value
float,optional Inductance value.
- is_parallelbool,
optional Whether RLC is parallel.
- pins
- Returns:
pyedb.grpc.database.hierarchy.component.Componentor boolNew component instance if successful, False otherwise.
Examples
>>> new_comp = edbapp.components.create(pins, "R1")
- Components.create_component_from_pins(pins, component_name, placement_layer=None, component_part_name=None) pyedb.grpc.database.hierarchy.component.Component | bool#
Create component from pins.
Deprecated since version 0.6.62: Use
create()instead.
- Components.set_component_model(componentname: str, model_type: str = 'Spice', modelpath: str | None = None, modelname: str | None = None) bool#
Set component model.
- Parameters:
- Returns:
- bool
True if successful, False otherwise.
Examples
>>> edbapp.components.set_component_model("U1", "Spice", "path/to/model.sp")
- Components.create_pingroup_from_pins(pins: List[Any], group_name: str | None = None) pyedb.grpc.database.hierarchy.pingroup.PinGroup | bool#
Create pin group from pins.
- Parameters:
- Returns:
pyedb.grpc.database.hierarchy.pingroup.PinGroupor boolPin group instance if successful, False otherwise.
Examples
>>> pingroup = edbapp.components.create_pingroup_from_pins(pins, "GND_pins")
- Components.delete_single_pin_rlc(deactivate_only: bool = False) List[str]#
Delete or deactivate single-pin RLC components.
- Parameters:
- deactivate_onlybool,
optional Whether to only deactivate instead of deleting.
- deactivate_onlybool,
- Returns:
Examples
>>> deleted = edbapp.components.delete_single_pin_rlc()
- Components.delete(component_name: str) bool#
Delete a component.
Examples
>>> edbapp.components.delete("R1")
- Components.disable_rlc_component(component_name: str) bool#
Disable RLC component.
Examples
>>> edbapp.components.disable_rlc_component("R1")
- Components.set_solder_ball(component: str | pyedb.grpc.database.hierarchy.component.Component = '', sball_diam: float | None = None, sball_height: float | None = None, shape: str = 'Cylinder', sball_mid_diam: float | None = None, chip_orientation: str = 'chip_down', auto_reference_size: bool = True, reference_size_x: float = 0, reference_size_y: float = 0, reference_height: float = 0) bool#
Set solder ball properties for a component.
- Parameters:
- component
strorpyedb.grpc.database.hierarchy.component.Component,optional Component name or instance.
- sball_diam
float,optional Solder ball diameter.
- sball_height
float,optional Solder ball height.
- shape
str,optional Solder ball shape (“Cylinder” or “Spheroid”).
- sball_mid_diam
float,optional Solder ball mid diameter.
- chip_orientation
str,optional Chip orientation (“chip_down” or “chip_up”).
- auto_reference_sizebool,
optional Use auto reference size.
- reference_size_x
float,optional Reference size X.
- reference_size_y
float,optional Reference size Y.
- reference_height
float,optional Reference height.
- component
- Returns:
- bool
True if successful, False otherwise.
Examples
>>> edbapp.components.set_solder_ball("U1", sball_diam=0.5e-3)
- Components.set_component_rlc(componentname: str, res_value: float | None = None, ind_value: float | None = None, cap_value: float | None = None, isparallel: bool = False) bool#
Set RLC values for a component.
- Parameters:
- Returns:
- bool
True if successful, False otherwise.
Examples
>>> edbapp.components.set_component_rlc("R1", res_value=50)
- Components.update_rlc_from_bom(bom_file: str, delimiter: str = ';', valuefield: str = 'Func des', comptype: str = 'Prod name', refdes: str = 'Pos / Place') bool#
Update RLC values from BOM file.
- Parameters:
- Returns:
- bool
True if successful, False otherwise.
Examples
>>> edbapp.components.update_rlc_from_bom("bom.csv")
- Components.import_bom(bom_file: str, delimiter: str = ',', refdes_col: int = 0, part_name_col: int = 1, comp_type_col: int = 2, value_col: int = 3) bool#
Import BOM file.
- Parameters:
- Returns:
- bool
True if successful, False otherwise.
Examples
>>> edbapp.components.import_bom("bom.csv")
- Components.export_bom(bom_file: str, delimiter: str = ',') bool#
Export BOM file.
- Parameters:
- Returns:
- bool
True if successful, False otherwise.
Examples
>>> edbapp.components.export_bom("exported_bom.csv")
- Components.find_by_reference_designator(reference_designator: str) pyedb.grpc.database.hierarchy.component.Component#
Find component by reference designator.
- Parameters:
- reference_designator
str Reference designator.
- reference_designator
- Returns:
pyedb.grpc.database.hierarchy.component.ComponentComponent instance.
Examples
>>> comp = edbapp.components.find_by_reference_designator("R1")
- Components.get_aedt_pin_name(pin: Any) str#
Get AEDT pin name.
- Parameters:
- pin
pyedb.grpc.database.padstacks.PadstackInstance Pin instance.
- pin
- Returns:
strAEDT pin name.
Examples
>>> name = edbapp.components.get_aedt_pin_name(pin)
- Components.get_pins(reference_designator: str, net_name: str | None = None, pin_name: str | None = None) Dict[str, Any]#
Get pins of a component.
- Parameters:
- Returns:
dictDictionary of pins.
Examples
>>> pins = edbapp.components.get_pins("U1", net_name="GND")
- Components.get_pin_position(pin: Any) List[float]#
Get pin position.
- Parameters:
- pin
pyedb.grpc.database.padstacks.PadstackInstance Pin instance.
- pin
- Returns:
Examples
>>> pos = edbapp.components.get_pin_position(pin)
- Components.get_pins_name_from_net(net_name: str, pin_list: List[Any] | None = None) List[str]#
Get pin names from net.
- Parameters:
- Returns:
Examples
>>> pins = edbapp.components.get_pins_name_from_net("GND")
- Components.get_nets_from_pin_list(pins: List[Any]) List[str]#
Get nets from pin list.
Examples
>>> nets = edbapp.components.get_nets_from_pin_list(pins)
- Components.get_component_net_connection_info(refdes: str) Dict[str, List[str]]#
Get net connection info for a component.
- Parameters:
- refdes
str Reference designator.
- refdes
- Returns:
dictDictionary with refdes, pin_name, and net_name.
Examples
>>> info = edbapp.components.get_component_net_connection_info("U1")
- Components.get_rats() List[Dict[str, List[str]]]#
Get RATS (Reference Designator, Pin, Net) information.
Examples
>>> rats = edbapp.components.get_rats()
- Components.get_through_resistor_list(threshold: float = 1) List[str]#
Get through resistors below threshold.
- Parameters:
- threshold
float,optional Resistance threshold.
- threshold
- Returns:
Examples
>>> resistors = edbapp.components.get_through_resistor_list(1)
- Components.short_component_pins(component_name: str, pins_to_short: List[str] | None = None, width: float = 0.001) bool#
Short component pins with traces.
- Parameters:
- Returns:
- bool
True if successful, False otherwise.
Examples
>>> edbapp.components.short_component_pins("J4A2", ["G4", "9", "3"])
- Components.create_pin_group(reference_designator: str, pin_numbers: str | List[str], group_name: str | None = None) Tuple[str, pyedb.grpc.database.hierarchy.pingroup.PinGroup] | bool#
Create pin group on a component.
- Parameters:
- Returns:
tuple[str,pyedb.grpc.database.hierarchy.pingroup.PinGroup]orbool(group_name, PinGroup) if successful, False otherwise.
Examples
>>> name, group = edbapp.components.create_pin_group("U1", ["1", "2"])
- Components.create_pin_group_on_net(reference_designator: str, net_name: str, group_name: str | None = None) pyedb.grpc.database.hierarchy.pingroup.PinGroup#
Create pin group by net name.
- Parameters:
- Returns:
pyedb.grpc.database.hierarchy.pingroup.PinGroupPin group instance.
Examples
>>> group = edbapp.components.create_pin_group_on_net("U1", "GND")
- Components.deactivate_rlc_component(component: str | None = None, create_circuit_port: bool = False, pec_boundary: bool = False) bool#
Deactivate RLC component with a possibility to convert it to a circuit port.
- Parameters:
- component
str Reference designator of the RLC component.
- create_circuit_portbool,
optional Whether to replace the deactivated RLC component with a circuit port. The default is
False.- pec_boundarybool,
optional Whether to define the PEC boundary, The default is
False. If set toTrue, 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.
- component
- Returns:
- bool
Truewhen successful,Falsewhen failed.
Examples
>>> from pyedb import Edb >>> edb_file = r"C:\my_edb_file.aedb" >>> edb = Edb(edb_file) >>> for cmp in list(edb.components.instances.keys()): >>> edb.components.deactivate_rlc_component(component=cmp, create_circuit_port=False) >>> edb.save_edb() >>> edb.close_edb()
- Components.add_port_on_rlc_component(component: str | pyedb.grpc.database.hierarchy.component.Component | None = None, circuit_ports: bool = True, pec_boundary: bool = False) bool#
Deactivate RLC component and replace it with a circuit port. The circuit port supports only two-pin components.
- Parameters:
- component
str Reference designator of the RLC component.
- circuit_portsbool
Truewill replace RLC component by circuit ports,Falsegap ports compatible with HFSS 3D modeler export.- pec_boundarybool,
optional Whether to define the PEC boundary, The default is
False. If set toTrue, 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.
- component
- Returns:
- bool
Truewhen successful,Falsewhen failed.
Examples
>>> from pyedb import Edb >>> edb = Edb() >>> edb.source_excitation.add_port_on_rlc_component("R1")
- Components.replace_rlc_by_gap_boundaries(component: str | pyedb.grpc.database.hierarchy.component.Component | None = None) bool#
Replace RLC component by RLC gap boundaries. These boundary types are compatible with 3D modeler export. Only 2 pins RLC components are supported in this command.
- Parameters:
- component
str Reference designator of the RLC component.
- component
- Returns:
- bool
Truewhensucceed,Falseifitfailed.
Examples
>>> from pyedb import Edb >>> edb = Edb(edb_file) >>> for refdes, cmp in edb.components.capacitors.items(): >>> edb.components.replace_rlc_by_gap_boundaries(refdes) >>> edb.save_edb() >>> edb.close_edb()
- Components.add_rlc_boundary(component: str | pyedb.grpc.database.hierarchy.component.Component | None = None, circuit_type: bool = True) bool#
Add RLC gap boundary on component and replace it with a circuit port. The circuit port supports only 2-pin components.
. deprecated:: pyedb 0.28.0 Use
pyedb.grpc.core.excitations.add_rlc_boundary()instead.