[Paraview] Plot over line CSV export python script not working

Luca Giannelli bilogo at gmail.com
Thu Sep 29 05:57:51 EDT 2011


Hello everybody,

I've been using Paraview for quite a long time but I didn't need the python
scripting up to now.
I want to execute a series of plot over line in numerous points and
different time steps so it is nothing
I can afford to do manually.
Looking on the net I was able to find out how to record a macro and how to
create a writer so I
ended up with this script:

--------------------------------------------------------------------
try: paraview.simple
except: from paraview.simple import *
paraview.simple._DisableFirstRenderCameraReset()

fotobioreattore_foam = GetActiveSource()
PlotOverLine2 = PlotOverLine( Source="High Resolution Line Source" )

PlotOverLine2.Source.Point1 = [-0.035100001841783524, -0.03509980067610741,
0.0]
PlotOverLine2.Source.Point2 = [0.035100001841783524, 0.035100001841783524,
0.4300000071525574]

DataRepresentation7 = Show()

PlotOverLine2.Source.Point1 = [-0.0, 0.0, 0.0]
PlotOverLine2.Source.Point2 = [0.0, 0.0, 0.4300000071525574]

XYChartView4 = GetRenderView()
DataRepresentation7.XArrayName = 'arc_length'
DataRepresentation7.SeriesVisibility = ['U (0)', '0', 'U (1)', '0', 'U (2)',
'0', 'vtkValidPointMask', '0', 'arc_length', '0', 'Points (0)', '0', 'Points
(1)', '0', 'Points (2)', '0', 'Points (Magnitude)', '0']
DataRepresentation7.UseIndexForXAxis = 0

Render()

#= create writer
source = PlotOverLine2 #PlotOverLine2.Source
writer = CreateWriter("/home/piota/csv.csv", source)
#writer = CreateWriter("/home/piota/csv.csv")
writer.FieldAssociation = "Points" # or "Cells"
writer.UpdatePipeline()
del writer
--------------------------------------------------------------------------

If I'm not mistaken, this should write a csv.csv file in my home folder but
it doesn't write anything. No error is reported when I run the script but
still I get no output.
I'm still a bit confused on which source I should specify, so I'm pretty
sure that the writer part is incorrect.

Can somebody help me filling it out properly?

Thx in advance.

Luca
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20110929/d7be331e/attachment.htm>


More information about the ParaView mailing list