CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ParaView (https://www.cfd-online.com/Forums/paraview/)
-   -   [General] get Bounds from different Mesh Regions (https://www.cfd-online.com/Forums/paraview/185823-get-bounds-different-mesh-regions.html)

JonathanGeyer April 3, 2017 12:47

get Bounds from different Mesh Regions
 
Dear all,

I would like to write a script in python. Therefore I need some Bounds of different Meshregions. I'm able to get the bounds from the internal mesh, but not from other mesh regions. I think the problem is, that I have to change the active Soure. But how is this possible? The code I tried is here:

Code:

#### import the simple module from the paraview
from paraview.simple import *
#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()

# get active source.
resultsfoam = GetActiveSource()

resultsfoam.MeshRegions = []

# Properties modified on resultsfoam
resultsfoam.MeshRegions = ['BLADES']

(x1min,x1max,y1min,y1max,z1min,z1max) = GetActiveSource().GetDataInformation().GetBounds()
print (z1max)

resultsfoam = GetActiveSource()
# Properties modified on resultsfoam
resultsfoam.MeshRegions = []

# Properties modified on resultsfoam
resultsfoam.MeshRegions = ['INFLOW']
resultsfoam = GetActiveSource()

(xmin,xmax,ymin,ymax,zmin,zmax) = GetActiveSource().GetDataInformation().GetBounds()
print (zmax)

Thank you for your help,
Jonathan


All times are GMT -4. The time now is 20:51.