vsel#

Query.vsel(v)[source]#

Returns selection status of a volume.

Returns a SelectionStatus with values: :rtype: SelectionStatus

  • 1 - SELECTED

  • 0 - UNDEFINED

  • -1 - UNSELECTED

Parameters:
vint

Volume number

Returns:
mapdl.ansys.core.inline_functions.SelectionStatus

Status of element

Examples

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

>>> from ansys.mapdl.core import launch_mapdl
>>> mapdl = launch_mapdl()
>>> mapdl.prep7()
>>> mapdl.et(1, 'SHELL181')
>>> k1 = mapdl.k(1, 0, 0, 0)
>>> k2 = mapdl.k(2, 1, 0, 0)
>>> k3 = mapdl.k(3, 0, 1, 0)
>>> k4 = mapdl.k(4, 0, 0, 1)
>>> v1 = mapdl.v(k1, k2, k3, k4)
>>> v1
1

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

>>> q = mapdl.queries
>>> q.vsel(v1)
<SelectionStatus.SELECTED: 1>
>>> mapdl.vsel('NONE')
>>> q.vsel(v1)
<SelectionStatus.UNSELECTED: -1>
>>> q.vsel(0)
<SelectionStatus.UNDEFINED: 0>