get_array

Mapdl.get_array(entity='', entnum='', item1='', it1num='', item2='', it2num='', kloop='', **kwargs)

Uses the VGET command to Return an array from ANSYS as a Python array.

See *VGET <https://www.mm.bme.hu/~gyebro/files/ans_help_v182/ans_cmd/Hlp_C_VGET_st.html> for more details.

Parameters
  • entity – Entity keyword. Valid keywords are NODE, ELEM, KP, LINE, AREA, VOLU, etc

  • entnum – The number of the entity.

  • item1 – The name of a particular item for the given entity. Valid items are as shown in the Item1 columns of the tables below.

  • it1num – The number (or label) for the specified Item1 (if any). Valid IT1NUM values are as shown in the IT1NUM columns of the tables below. Some Item1 labels do not require an IT1NUM value.

  • item2 – A second set of item labels and numbers to further qualify the item for which data is to be retrieved. Most items do not require this level of information.

  • it2num – A second set of item labels and numbers to further qualify the item for which data is to be retrieved. Most items do not require this level of information.

  • kloop

    Field to be looped on:

    • 0 or 2 : Loop on the ENTNUM field (default).

    • 3 : Loop on the Item1 field.

    • 4 : Loop on the IT1NUM field. Successive items are as shown with IT1NUM.

    • 5 : Loop on the Item2 field.

    • 6 : Loop on the IT2NUM field. Successive items are as shown with IT2NUM.

Examples

List the current selected node numbers

>>> mapdl.get_array('NODE', item1='NLIST')
array([  1.,   2.,   3.,   4.,   5.,   6.,   7.,   8.,
      ...
      314., 315., 316., 317., 318., 319., 320., 321.])

List the displacement in the X direction for the first result

>>> mapdl.post1()
>>> mapdl.set(1, 1)
>>> disp_x = mapdl.get_array('NODE', item1='U', it1num='X')
array([ 0.01605306, -0.01605306,  0.00178402, -0.01605306,
       ...
       -0.00178402, -0.01234851,  0.01234851, -0.01234851])

Notes

Please reference your ANSYS help manual *VGET command tables for all the available *VGET values