[Paraview] Trouble with servermanager.filters.Calculator() method

Johannes Will johannes.will at tu-harburg.de
Thu Apr 16 12:03:41 EDT 2009


Hallo everybody,

I try to write a python script, that will read some data, process this  
in a filter pipeline and write a new file with the results. I am fine  
so far, but I need to use the calculator filter for something like that:

'coordZ - offset'

Can somebody point out how to use it? That is what I tried so far:

new_r = r
new_r = servermanager.filters.MergeBlocks(Input=new_r)
new_r = servermanager.filters.CleanUnstructuredGrid(Input=new_r)
new_r = servermanager.filters.CellDataToPointData(Input=new_r, PassCellData=0)
new_r = servermanager.filters.Contour(Input=new_r,ContourValues=[0.5],  
SelectInputScalars="AirVolumeFraction")
new_r = servermanager.filters.Calculator(Input=new_r,  
ResultArrayName="SurfaceElevation" )

---- up to here anything is fine

new_r.AddCoordinateVectorVariable

---- the error is:
    Syntax error: expecting a variable name; see position 0

    I need to assign something, but what/how?

---- The rest is then
new_r.Function = 'coordsZ - 0.5'
new_r.UpdatePipeline()

I am gratefull for any help.

Cheers Johannes


-- 
Johannes Will

Pulverhofsweg 5
22159 Hamburg
Germany

Tel.: #49-40-644 199 29
Cell: #49-176-23 600 633

Mail: johannes.will at tuhh.de




More information about the ParaView mailing list