add_ecad_component_model#

MCADAssembly.add_ecad_component_model(name: str, path: str)#

Register an ECAD component model.

Add a named ECAD (layout/PCB) component model that can be referenced when instantiating components in the assembly. This is the first step in using a PCB layout - register it before creating instances.

Parameters:
namestr

Model name used as a reference when adding components. Should be unique within the assembly configuration.

pathstr

File path to the ECAD component file (e.g., .aedb). Can be absolute or relative to the configuration directory.

Examples

Register PCB layout models:

>>> assembly = MCADAssembly()
>>> assembly.add_ecad_component_model(name="MainBoard", path="pcb/main_assembly.aedb")
>>> assembly.add_ecad_component_model(name="DaughterBoard", path="pcb/daughter_card.aedb")

Create instances from registered models:

>>> main_pcb = assembly.add_sub_ecad_component(name="PCB_1", model="MainBoard")