volume_select#

Geometry.volume_select(items, sel_type='S', return_selected=False)#

Select volumes using a sequence of items.

Parameters:
itemssequence, str, or None

List, range, or sequence of integers of the volumes you want to select. If None or 'NONE', no volumes will be selected. If ‘ALL’, selects all volumes.

sel_typestr, optional

Selection type. May be one of the following:

  • 'S': Select a new set (default)

  • 'R': Reselect a set from the current set.

  • 'A': Additionally select a set and extend the current set.

  • 'U': Unselect a set from the current set.

return_selectedbool, optional

Return the volume numbers selected. Optional, and can be disabled for performance. Default False.

Returns:
np.array

Numpy array of keypoint numbers if return_selected=True.

Return type:

Optional[int]

Examples

Create a new selection of volumes [1, 5, 10]

>>> mapdl.geometry.volume_select([1, 5, 10])

Create a new selection of volumes from 1 through 20

>>> mapdl.geometry.volume_select(range(1, 21))

Unselect volumes 1 through 20

>>> mapdl.geometry.volume_select(range(1, 21), sel_type='U')

Append to an existing selection of volumes

>>> mapdl.geometry.volume_select([1, 2, 3], sel_type='A')

Reselect from the existing selection of volumes

>>> mapdl.geometry.volume_select([3, 4, 5], sel_type='R')

Select no volumes

>>> mapdl.geometry.volume_select(None)

Select all volumes

>>> mapdl.geometry.volume_select('ALL')