MCADComponent#
- class ansys.aedt.core.modeler.advanced_cad.mcad_assembly.MCADComponent(*, component_type: Literal['ecad', 'mcad'] | None='mcad', name: str = '', model: str, use_pin_mapping: bool = False, placement_pin_mapping: PlacementPinMapping | None = <factory>, target_coordinate_system: str = 'Global', arranges: list[Arrange] = <factory>, password: str | None = None, mcad_sub_components: dict[str, ~ansys.aedt.core.modeler.advanced_cad.mcad_assembly.MCADComponent]=<factory>, ecad_sub_components: dict[str, ~ansys.aedt.core.modeler.advanced_cad.mcad_assembly.ECADComponent]=<factory>, geometry_parameters: dict[str, str | float | int] | None=None, reference_coordinate_system: str = 'Global')#
Describe a single MCAD or ECAD component instance in an assembly.
This model represents a single component instance with its configuration, transformations, and nested subcomponents organized by type (MCAD or ECAD). Components can be placed in the assembly using coordinate systems and transformations, and can have child components to form hierarchies.
Examples
Create an MCAD component and configure placement:
>>> comp = MCADComponent(name="connector", model="USB_Type_A") >>> comp.target_coordinate_system = "CS_1" >>> comp.add_arrange_rotate(axis="Z", angle="90deg")
Methods
MCADComponent.add_arrange_move([vector])Add a translation transformation to the component.
MCADComponent.add_arrange_rotate([axis, angle])Add a rotation transformation to the component.
MCADComponent.add_sub_ecad_component(name, model)Add a child ECAD (layout) subcomponent.
MCADComponent.add_sub_mcad_component(name, model)Add a child MCAD (3D) subcomponent.
MCADComponent.construct([_fields_set])MCADComponent.copy(*[, include, exclude, ...])Returns a copy of the model.
MCADComponent.dict(*[, include, exclude, ...])MCADComponent.json(*[, include, exclude, ...])MCADComponent.model_construct([_fields_set])Creates a new instance of the Model class with validated data.
MCADComponent.model_copy(*[, update, deep])!!! abstract "Usage Documentation"
MCADComponent.model_dump(*[, mode, include, ...])!!! abstract "Usage Documentation"
MCADComponent.model_dump_json(*[, indent, ...])!!! abstract "Usage Documentation"
MCADComponent.model_json_schema(by_alias, ...)Generates a JSON schema for a model class.
Compute the class name for parametrizations of generic classes.
MCADComponent.model_post_init(context, /)This function is meant to behave like a BaseModel method to initialize private attributes.
MCADComponent.model_rebuild(*[, force, ...])Try to rebuild the pydantic-core schema for the model.
MCADComponent.model_validate(obj, *[, ...])Validate a pydantic model instance.
MCADComponent.model_validate_json(json_data, *)!!! abstract "Usage Documentation"
Validate the given object with string data against the Pydantic model.
MCADComponent.parse_file(path, *[, ...])MCADComponent.parse_raw(b, *[, ...])MCADComponent.preprocess(data)Normalize and validate component configuration formats.
MCADComponent.schema([by_alias, ref_template])MCADComponent.schema_json(*[, by_alias, ...])MCADComponent.update_forward_refs(**localns)MCADComponent.validate(value)Attributes
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Get extra fields set during validation.
Returns the set of fields that have been explicitly set on this model instance.
Return a combined dictionary of all child subcomponents.