[Paraview] small ParaView Script not working
Marco Kokic
kokicm at student.ethz.ch
Thu Nov 26 14:51:42 EST 2015
Dear ParaViewers,
I have written and tested the following script, which I hope is
self-explanatory. It doesn't work though (print cells_ gives "None") and
I can't see what I missed. I'm thankful for any suggestions.
#!/usr/bin/pvpython
#setup paraview connection
from paraview.simple import *
def my_range(start, end, step):
while start <= end:
yield start
start += step
def LoadMultipleFiles(FilePrefix, Low, High):
for i in my_range(Low,High+1,100):
reader = XMLMultiBlockDataReader(FileName='/path-to-files/' +
FilePrefix + str(i) + '.vtm')
cells_ = LoadMultipleFiles('Cells_', 0, 1000)
print cells_
# create a new 'Integrate Variables'
#integrateVariables1 = IntegrateVariables(Input=cells_)
# create a new 'Plot Selection Over Time'
#plotSelectionOverTime1 =
PlotSelectionOverTime(Input=integrateVariables1,Selection=None)
# save data
#SaveData('/path-to-files/output10_areaovertime.csv',
proxy=plotSelectionOverTime1,
Precision=5,UseScientificNotation=0,WriteAllTimeSteps=0)
More information about the ParaView
mailing list