Getting mesh quality with Python Interface

Hi.
I wanted to get the mesh quality of a volume with a Python script. I found the function from the Python interface

float get_quality_value (str mesh_type, int mesh_id, str metric_name)

Specifically I tried with

cubit.get_quality_value(‘tet’,1,‘aspect_ratio’).

However, I am not sure if I have the right keyword for the aspect ratio as I couldn’t find it anywhere. Also this function seems to give me the quality metric of the element with ID 1 and not of a whole volume. Do I have to make a sweep over all entities in the volume now myself and filter for the maximum or is there a better way?
I know the command

cubit.cmd(‘quality vol all aspect ratio top 1’)

but this outputs a whole summary as a string on the standard output and I somehow cannot redirect it as a single floating value to a file, which is what a want.

Thank you,
Patrick

Unfortunately, you can use this function on individual elements and would need to sweep over all entities.

The metric_name values for tets are:

“Aspect Ratio Bet”,
“Aspect Ratio Gam”,
“Element Volume”,
“Condition No.”,
“Jacobian”,
“Scaled Jacobian”,
“Shape”,
“Relative Size”,
“Shape And Size”,
“Distortion”,
“Allmetrics”,
“Algebraic”,
“Traditional”,
“Equivolume Skew”,
“Squish Index”,
“Equiangle Skew”,
“Node Distance”,
“Altitude”