:class:`Definitions` ==================== .. py:class:: pyedb.grpc.database.definitions.Definitions(pedb) .. py:currentmodule:: Definitions Overview -------- .. tab-set:: .. tab-item:: Methods .. list-table:: :header-rows: 0 :widths: auto * - :py:attr:`~add_package_def` - Add a package definition. .. tab-item:: Properties .. list-table:: :header-rows: 0 :widths: auto * - :py:attr:`~component` - Component definitions * - :py:attr:`~package` - Package definitions. Import detail ------------- .. code-block:: python from pyedb.grpc.database.definitions import Definitions Property detail --------------- .. py:property:: component :type: Dict[str, pyedb.grpc.database.definition.component_def.ComponentDef] Component definitions .. rubric:: Examples >>> from pyedb import Edb >>> edb = Edb() >>> component_defs = edb.definitions.component >>> for name, comp_def in component_defs.items(): ... print(f"Component: {name}, Part: {comp_def.part}") .. !! processed by numpydoc !! .. py:property:: package :type: Dict[str, pyedb.grpc.database.definition.package_def.PackageDef] Package definitions. .. rubric:: Examples >>> from pyedb import Edb >>> edb = Edb() >>> package_defs = edb.definitions.package >>> for name, pkg_def in package_defs.items(): ... print(f"Package: {name}, Boundary: {pkg_def.exterior_boundary}") .. !! processed by numpydoc !! Method detail ------------- .. py:method:: add_package_def(name: str, component_part_name: Optional[str] = None, boundary_points: Optional[List[List[float]]] = None) -> Union[pyedb.grpc.database.definition.package_def.PackageDef, bool] Add a package definition. :Parameters: **name: str** Name of the package definition. **component_part_name** : :class:`python:str`, :obj:`optional` Part name of the component. **boundary_points** : :class:`python:list`, :obj:`optional` Boundary points which define the shape of the package. :Returns: :obj:`PackageDef` object. .. .. rubric:: Examples >>> from pyedb import Edb >>> edb = Edb() Example 1: Create package using component's bounding box >>> comp_def = edb.definitions.add_package_def("QFP64", "QFP64_COMPONENT") >>> if comp_def: # Check if created successfully ... print(f"Created package: {comp_def.name}") Example 2: Create package with custom boundary >>> boundary = [[0, 0], [10e-3, 0], [10e-3, 10e-3], [0, 10e-3]] >>> custom_pkg = edb.definitions.add_package_def("CustomIC", boundary_points=boundary) >>> if custom_pkg: ... print(f"Custom package boundary: {custom_pkg.exterior_boundary}") .. !! processed by numpydoc !!