Another recommendation is to try something like the “save_hex_volumes” python script:
open up a file. YOU SHOULD SET THE PATH so you know where the file is going.
fp = open("/<path_to_file>/hex_volume.txt", “w”)
create a group with all of the hexes and get the group id
cubit.cmd(“group ‘all_hexes’ add hex all”)
group_id = cubit.get_id_from_name(“all_hexes”)
get a list of all hexes in the group
hex_list = cubit.get_group_hexes(group_id)
loop through all the hexes, find the volume and print it out
for hex_id in hex_list:
tmp_list = [hex_id] # the get_mesh_volume_or_area function is looking for a list as input
volume = cubit.get_meshed_volume_or_area(“hex”, tmp_list);
# build an output string by concatenating a list of strings and write it out
output_string = "Hex: " + str(hex_id) +" volume = " + str(volume) + "\n"
close the file