If you use ParaView often you may want to automate some of your workflows. One way to do this is writing a macro using the Python interpreter that ships with ParaView. Here, is an example of extracting all elements from a tetrahedral mesh that have a minimum dihedral angle less that 5 degrees.
from paraview.simple import *
#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()
# get selection
G = GetActiveSource()
# create quality Data
# set min dihedraql angle as criterion
M = MeshQuality(Input=G, TetQualityMeasure="Minimum Dihedral Angle")
# select it
SetActiveSource(M)
# Create selector
S = SelectionQuerySource(QueryString = "Quality <=5")
# Create Extractor
E = ExtractSelection(Input = M,Selection = S)
Show()
Render()
#### uncomment the following to render all views
# RenderAllViews()
# alternatively, if you want to write images, you can use SaveScreenshot(...).
Another advantage of this approach is that you can run it in a headless environment using the
pvpython
interpreter that ships with ParaView.
To add this macro to Paraview, choose Macros > Add new macro...