Assembly ======== .. py:class:: Assembly(element_id: ansys.api.modelcenter.v0.element_messages_pb2.ElementId, engine: ansys.modelcenter.workflow.grpc_modelcenter.engine.Engine) :canonical: ansys.modelcenter.workflow.grpc_modelcenter.assembly.Assembly Bases: :py:obj:`ansys.modelcenter.workflow.grpc_modelcenter.abstract_control_statement.AbstractControlStatement`, :py:obj:`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. .. !! processed by numpydoc !! Overview -------- .. py:currentmodule:: Assembly .. tab-set:: .. tab-item:: Methods .. list-table:: :header-rows: 0 :widths: auto * - :py:attr:`~add_datapin` - Create a datapin on the assembly. * - :py:attr:`~delete_datapin` - Delete a given datapin. * - :py:attr:`~add_assembly` - Create a subassembly with a specific type and position. .. tab-item:: Properties .. list-table:: :header-rows: 0 :widths: auto * - :py:attr:`~parent_element_id` - Parent element's ID. .. tab-item:: Special methods .. list-table:: :header-rows: 0 :widths: auto * - :py:attr:`~__eq__` - Return self==value. Import detail ------------- .. code-block:: python from ansys.modelcenter.workflow.grpc_modelcenter.assembly import Assembly Property detail --------------- .. py:property:: parent_element_id :canonical: ansys.modelcenter.workflow.grpc_modelcenter.assembly.Assembly.parent_element_id :type: str Parent element's ID. If this is the root element of the workflow, the parent ID is a blank string. .. !! processed by numpydoc !! Method detail ------------- .. py:method:: __eq__(other) Return self==value. .. !! processed by numpydoc !! .. py:method:: add_datapin(name: str, mc_type: ansys.tools.variableinterop.VariableType) -> ansys.modelcenter.workflow.api.IDatapin Create a datapin on the assembly. :Parameters: **name** : :class:`python:str` Name of the datapin. **mc_type: atvi.VariableType** Type for the datapin. :Returns: :obj:`IDatapin` Object representing the created datapin. .. !! processed by numpydoc !! .. py:method:: 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: **name** : :class:`python:str` Name of the datapin. :Returns: :ref:`bool ` ``True`` if the given datapin was located and deleted, ``False`` if it was not and no action was taken. .. !! processed by numpydoc !! .. py:method:: add_assembly(name: str, av_pos: Optional[Tuple[int, int]] = None, assembly_type: Optional[ansys.modelcenter.workflow.api.AssemblyType] = None) -> ansys.modelcenter.workflow.api.IAssembly Create a subassembly with a specific type and position. :Parameters: **name** : :class:`python:str` Name of the subassembly. **av_pos** : :obj:`Tuple`\[int,int], :obj:`optional` Position of the subassembly in the parent assembly's analysis view. The default is ``None``. **assembly_type** : :obj:`AssemblyType`, :obj:`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: :obj:`IAssembly` Created assembly object. .. !! processed by numpydoc !!