Components#
|
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:
tupleComponent object
Object which contain the definition of a component.
- Parameters:
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]