Assembly#

class Assembly(element_id: ansys.api.modelcenter.v0.element_messages_pb2.ElementId, engine: ansys.modelcenter.workflow.grpc_modelcenter.engine.Engine)#

Bases: ansys.modelcenter.workflow.grpc_modelcenter.abstract_control_statement.AbstractControlStatement, ansys.modelcenter.workflow.api.IAssembly

Represents an assembly in ModelCenter.

Note

This class should not be directly instantiated by clients. Get a Workflow object from an instantiated Engine instance and use it to get a valid instance of this object.

Overview#

add_datapin

Create a datapin on the assembly.

delete_datapin

Delete a given datapin.

add_assembly

Create a subassembly with a specific type and position.

parent_element_id

Parent element’s ID.

__eq__

Return self==value.

Import detail#

from ansys.modelcenter.workflow.grpc_modelcenter.assembly import Assembly

Property detail#

property Assembly.parent_element_id: str#

Parent element’s ID.

If this is the root element of the workflow, the parent ID is a blank string.

Method detail#

Assembly.__eq__(other)#

Return self==value.

Assembly.add_datapin(name: str, mc_type: ansys.tools.variableinterop.VariableType) ansys.modelcenter.workflow.api.IDatapin#

Create a datapin on the assembly.

Parameters:
namestr

Name of the datapin.

mc_type: atvi.VariableType

Type for the datapin.

Returns:
IDatapin

Object representing the created datapin.

Assembly.delete_datapin(name: str) bool#

Delete a given datapin.

Variable objects that represent the given datapin become invalid. If there is no datapin with the given name, no error is raised.

Parameters:
namestr

Name of the datapin.

Returns:
bool

True if the given datapin was located and deleted, False if it was not and no action was taken.

Assembly.add_assembly(name: str, av_pos: Tuple[int, int] | None = None, assembly_type: ansys.modelcenter.workflow.api.AssemblyType | None = None) ansys.modelcenter.workflow.api.IAssembly#

Create a subassembly with a specific type and position.

Parameters:
namestr

Name of the subassembly.

av_posTuple[int,int], optional

Position of the subassembly in the parent assembly’s analysis view. The default is None.

assembly_typeAssemblyType, optional

Type of assembly to create. The default is None, in which case a regular data-dependency assembly is created. (This is the same as passing AssemblyType.ASSEMBLY.)

Returns:
IAssembly

Created assembly object.