Calculate percent volume/area/length

For users who want to calculate the % or fraction of a part which has variable values within a certain range. This is fairly easy to do manually in EnSight but requires some knowledge and can give false answers if parent parts have mixed dimensions. This routine automates the steps:

  1. create an isovolume
  2. calculate the volume, area, or length of the isovolume and parent part(s)
  3. divide the isovolume by parent to get fraction (x100 for %)

In addition to automating, the script also checks for the existence of mixed element dimensions in the selected parts. If there is more than one dimensionality (1D, 2D, 3D) of elements then the script aborts. If only one type exists then the script chooses the correct calculator function for that dimension and names the constant variables accordingly.

The options are set by 3 variables at the beginning of the script. Just variable, isovolume by high/low/band, and the iso values. Multiple values can be specified to create multiple isos.

This is really just the bare beginnings and there is certainly a lot more that can be done. GUI, error reporting, creating annotations, more options, command language, extension class.

After you have run this script you will have a Vol_percent_1 variable which represents the isovolume fraction % of total.  Now select the isovolume part and double click on the Tools icon at the top, and go into the Analyze folder and run the Part Constant Query tool. Choose the Vol_percent_1 constant variable.  Now you have a nice plot from sweeping the max isovolume from min to max.



Download script: