MCADAssembly#
- class ansys.aedt.core.modeler.advanced_cad.mcad_assembly.MCADAssembly(*, coordinate_system: dict[str, ~ansys.aedt.core.modeler.advanced_cad.mcad_assembly.CoordinateSystem]=<factory>, ecad_component_models: dict[str, str]=<factory>, mcad_component_models: dict[str, str]=<factory>, model_libraries: list[str] = <factory>, 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>)#
Represent the full MCAD assembly configuration consumed by the backend.
This model holds the complete configuration for an MCAD assembly including coordinate systems, component models, and the hierarchy of MCAD/ECAD components. It serves as the configuration object passed to the
run()function to orchestrate the assembly process in HFSS.Examples
Create a basic assembly with registered models:
>>> from pathlib import Path >>> from ansys.aedt.core.modeler.advanced_cad.mcad_assembly import MCADAssembly >>> assembly = MCADAssembly() >>> assembly.add_mcad_component_model( ... name="connector", path="path/to/connector.a3dcomp" ... ) >>> assembly.add_ecad_component_model( ... name="pcb", path="path/to/board.aedb" ... ) >>> pcb = assembly.add_sub_ecad_component(name="pcb_1", model="pcb")
Methods
Create and register a new coordinate system.
MCADAssembly.add_ecad_component_model(name, path)Register an ECAD component model.
MCADAssembly.add_mcad_component_model(name, path)Register an MCAD component model.
MCADAssembly.add_model_library(library_path)Register a model library for component resolution.
MCADAssembly.add_sub_ecad_component(name, model)Add a top-level ECAD (layout) subcomponent to the assembly.
MCADAssembly.add_sub_mcad_component(name, model)Add a top-level MCAD (3D) subcomponent to the assembly.
MCADAssembly.construct([_fields_set])MCADAssembly.copy(*[, include, exclude, ...])Returns a copy of the model.
MCADAssembly.dict(*[, include, exclude, ...])MCADAssembly.json(*[, include, exclude, ...])MCADAssembly.model_construct([_fields_set])Creates a new instance of the Model class with validated data.
MCADAssembly.model_copy(*[, update, deep])!!! abstract "Usage Documentation"
MCADAssembly.model_dump(*[, mode, include, ...])!!! abstract "Usage Documentation"
MCADAssembly.model_dump_json(*[, indent, ...])!!! abstract "Usage Documentation"
MCADAssembly.model_json_schema(by_alias, ...)Generates a JSON schema for a model class.
Compute the class name for parametrizations of generic classes.
MCADAssembly.model_post_init(context, /)Override this method to perform additional initialization after __init__ and model_construct.
MCADAssembly.model_rebuild(*[, force, ...])Try to rebuild the pydantic-core schema for the model.
MCADAssembly.model_validate(obj, *[, ...])Validate a pydantic model instance.
MCADAssembly.model_validate_json(json_data, *)!!! abstract "Usage Documentation"
Validate the given object with string data against the Pydantic model.
MCADAssembly.parse_file(path, *[, ...])MCADAssembly.parse_raw(b, *[, content_type, ...])MCADAssembly.preprocess(data)Normalize and validate component configuration formats.
MCADAssembly.schema([by_alias, ref_template])MCADAssembly.schema_json(*[, by_alias, ...])MCADAssembly.update_forward_refs(**localns)MCADAssembly.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 top-level subcomponents.