esel

Query.esel(e)

Returns selection status of an element.

Returns a SelectionStatus object with values:

1 - SELECTED 0 - UNDEFINED -1 - UNSELECTED

Parameters

e (int) – Element number

Return type

SelectionStatus

Returns

mapdl.ansys.core.inline_functions.SelectionStatus – Status of element

Examples

Here we create a single element and interrogate its selection status.

>>> from ansys.mapdl.core import launch_mapdl
>>> from ansys.mapdl.core.inline_functions import Query
>>> mapdl = launch_mapdl()
>>> mapdl.prep7()
>>> mapdl.et(1, 'SHELL181')
>>> n1 = mapdl.n(1, 0, 0, 0)
>>> n2 = mapdl.n(2, 1, 0, 0)
>>> n3 = mapdl.n(3, 1, 1, 1)
>>> e1 = mapdl.e(n1, n2, n3)
>>> e1
1

We can use Query.esel to interrogate the selection status of the element. The response is an enum.IntEnum object. If you query an element that does not exist, it will return a status SelectionStatus.UNDEFINED.

>>> q = Query(mapdl)
>>> q.esel(e1)
<SelectionStatus.SELECTED: 1>
>>> mapdl.esel('NONE')
>>> q.esel(e1)
<SelectionStatus.UNSELECTED: -1>
>>> q.esel(0)
<SelectionStatus.UNDEFINED: 0>