CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Paraview & paraFoam (
-   -   Problems with CSV export in python scripting (

AlmostSurelyRob June 18, 2013 06:10

Problems with CSV export in python scripting
Dear All,

I am trying to extract some data file into a csv file by using the following script:

from paraview.simple import *

foamCase = servermanager.sources.OpenFOAMReader(FileName='')

view = servermanager.CreateRenderView();
myPlot=servermanager.filters.PlotOverLine(Source="High Resolution Line Source")
myPlot.Source.Point1 = [0.025, 0, 0]
myPlot.Source.Point2 = [0.025, 0.05, 0]

writer = CreateWriter("./lineData.csv",myPlot)
writer.FieldAssociation = 'Points' 
del writer

Unofurtunately this doesn't work. I end up with the error which looks like this:

ERROR: In /home/robert/download/paraview/src/ParaView-3.98.1-source/ParaViewCore/ServerManager/Core/vtkSMWriterFactory.cxx, line 377
vtkSMWriterFactory (0x1786ca0): No matching writer found for extension: csv

Traceback (most recent call last):
  File "", line 13, in <module>
    writer.FieldAssociation = 'Points' 
AttributeError: 'NoneType' object has no attribute 'FieldAssociation'

I have found a number of post on this but nothing seems conclusive.
This was filed as a bug report in 2012, but it looked to me as if it should be fixed.

Please let me know if you know anything more.

For this minimal example sample utility will do the same job, but I need to make this work for a more complex script in paraView which will have csv as some of its output. Please let me know if this is a bug or if I am missing something.

All times are GMT -4. The time now is 05:40.