add_mcad_component_model#

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

Register an MCAD component model.

Add a named MCAD (3D) component model that can be referenced when instantiating components in the assembly. This is the first step in using a 3D component model - 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 MCAD component file (e.g., .a3dcomp, .step). Can be absolute or relative to the configuration directory.

Examples

Register multiple MCAD models:

>>> assembly = MCADAssembly()
>>> assembly.add_mcad_component_model(name="USB_Connector", path="models/connectors/usb_type_a.a3dcomp")
>>> assembly.add_mcad_component_model(name="RF_Shield", path="models/shields/rf_cage.step")

Create instances from registered models:

>>> connector = assembly.add_sub_mcad_component(name="J1", model="USB_Connector")