[Paraview] Help with Python scripting for Calculator function.

Eric Meloche emeloche1 at gmail.com
Mon Dec 21 10:37:05 EST 2009


I'm trying to use python scripting to use the calculator.   I can't get the
function and the results to display in the GUI.

I first used the trace capabilities to generate a function and was able to
successfully generate my results on the GUI but when i shut down and
restarted and run the scripts just generated from the trace it doesn't
display the function in the
Object inspector.


Here's a sample python script that i'm using.

Calculator1 = Calculator()
Calculator1.AttributeMode = 'point_data'

# i'd like to display this function in the GUI
Calculator1.Function = 'Hdemag_Z*2'


Calculator1.ScalarVariable = ['Hdemag_X', 'Hdemag', '0', 'Hdemag_Y',
'Hdemag', '1', 'Hdemag_Z', 'Hdemag', '2', 'M_X', 'M', '0', 'M_Y', 'M', '1',
'M_Z', 'M', '2']
Calculator1.CoordinateScalarVariable = ['coordsX', '0', 'coordsY', '1',
'coordsZ', '2']
Calculator1.CoordinateVectorVariable = ['coords', '0', '1', '2']
Calculator1.VectorVariable = ['Hdemag', 'Hdemag', '0', '1', '2', 'M', 'M',
'0', '1', '2']
Calculator1.ResultArrayName = 'Heffective'
DataRepresentation5 = Show()
DataRepresentation4.Visibility = 1


Any help would be greatly appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20091221/833bdc2f/attachment.htm>


More information about the ParaView mailing list