ansys.mapdl.core.component.Component#

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

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]