Components#

component.ComponentManager(mapdl)

Collection of MAPDL components.

The Component class represents a single named component and subclasses the built-in tuple type to store the selected entity IDs. Because it inherits directly from tuple, it also exposes the standard tuple API (such as count() and index()), which is documented in the Python standard library and isn’t duplicated here. The type and items properties are specific to this class and are documented on this page instead of being generated as separate pages.

class ansys.mapdl.core.component.Component(*args, **kwargs)#

Bases: tuple

Component object

Object which contain the definition of a component.

Parameters:
type_str

The entity type. For instance “NODES”, “KP”, “VOLU”, etc

items_None, str, int, Component, List[int], Tuple[int, …], np.ndarray

Item ids contained in the component.

Examples

To create a component object

>>> mycomp = Component("NODES", [1, 2, 3])
>>>  mycomp
Component(type='NODES', items=(1, 2, 3))

To index the content of the component object:

>>> mycomp[0]
1
>>> mycomp[1]
2

To access the type of the entities:

>>> mycomp.type
"NODES"

Convert to list:

>>> list(mycomp)
[1, 2, 3]
property items: Tuple[int]#

Return the ids of the entities in the component.

property type: Literal['NODE', 'NODES', 'ELEM', 'ELEMS', 'ELEMENTS', 'VOLU', 'AREA', 'LINE', 'KP']#

Return the type of the component. For instance “NODES”, “KP”, etc.