Assembly.add_part

Assembly.add_part(part, key=None, **kwargs)[source]

Add a part to the assembly.

Parameters:
partcompas.datastructures.Part

The part to add.

keyint | str, optional

The identifier of the part in the assembly. Note that the key is unique only in the context of the current assembly. Nested assemblies may have the same key value for one of their parts. Default is None in which case the key will be an automatically assigned integer value.

**kwargs: dict[str, Any], optional

Additional named parameters collected in a dict.

Returns:
int | str

The identifier of the part in the current assembly graph.