I want to extract the max values of a field output of a cut section of my model for every section using a python script. The issue is that the max values shown on Contour Plot Options displays the max values for the whole 3d model and not the cut section (2d on z axis) on the viewport. This can be confirmed by the legend shown on the viewport for that cut section.
I require the max value that is shown in legend for that specific cut section for all the increments. If it possible to extract of 1 frame using python script, I can loop it for all the increments.
Thank you!
You can make use of getPrimVarMinMaxLoc()
method available for viewport
object.
This method returns a dictionary containing the minimum, maximum and their location for the current primary variable. A contour plot should be displayed in the current viewport or else the method will return None.
session.viewports['Viewport: 1'].getPrimVarMinMaxLoc()
# {'maxPartInstanceName': 'COLUMN-1', 'maxPosition': 'Node: 37093', 'maxElementLabel': 31753,
# 'maxValue': 251.432723999023, 'minValue': 1.9861044883728,
# 'minPartInstanceName': 'COLUMN-1', 'minElementLabel': 28782,
# 'minPosition': 'Node: 35672'}