0

Good afternoon, I am trying to use the filter "Plot Over Line" of Paraview in a Python script. Basically, I want to:

  • Open the file ".vtu";
  • Use the filter PlotOverLine for the velocity;
  • Save the data in a ".csv" file.

On internet, I found a possible way to do this, but it gives error if ran with pvpython (even if using the word "simple" before the commands):

from paraview import simple
import csv

flow = GetActiveSource()

plotOverLine1 = PlotOverLine(Input=flow, Source='High Resolution Line Source')

passArrays1 = PassArrays(Input=plotOverLine1)
passArrays1.PointDataArrays = ['U']

plotOverLine1.Source.Point1 = [0, 0, 0]
plotOverLine1.Source.Point2 = [0, 0.4, 0]
writer = CreateWriter('data.csv')
writer.UpdatePipeline()
4

1 に答える 1