add_sub_mcad_component#

ECADComponent.add_sub_mcad_component(name: str, model: str) → MCADComponent#

Add a child MCAD (3D) subcomponent.

Create and register an MCAD (3D model) subcomponent as a child of this component. This creates a hierarchical relationship where the new component is subordinate to the current component in the assembly tree.

Parameters:
namestr

Instance name for this child component.

modelstr

Reference name of a registered MCAD model.

Returns:
MCADComponent

The created MCAD component instance, ready for configuration.

Examples

Add a connector subcomponent to a PCB component:

>>> pcb = MCADComponent(name="main_pcb", model="PCB_Model")
>>> connector = pcb.add_sub_mcad_component(name="usb_connector", model="USB_TypeA")
>>> connector.target_coordinate_system = "USB_Mount_Point"