[Paraview] Export spreadsheet values through python scripting
Utkarsh Ayachit
utkarsh.ayachit at kitware.com
Mon Mar 18 22:31:52 EDT 2013
Spreadsheet View is not available in python scripts. However, you can
save the csv dataset as follows:
> from paraview.simple import *
> writer = CreateWriter("/tmp/foo.csv", threshold) # 'threshold' is optional, if not specified
# active source is use
> writer.FieldAssociation = "Points" # or "Cells"
> writer.UpdatePipeline()
Utkarsh
On Mon, Mar 18, 2013 at 7:08 PM, Masquelet, Matthieu (GE Global
Research) <masquelet at ge.com> wrote:
> Dear all,
>
>
>
> Here is a rough outline of my python script:
>
> - Load data
>
> - Cut a slice
>
> - Compute new variable on the slice
>
> - Threshold the slice using new variable
>
> - Perform integration of other variables on the thresholded slice
>
> - Export results of the integration from the spreadsheet to a text
> file
>
>
>
> Up to the last step, all is swell. I originally recorded a trace and built a
> more general script out of it. However, no python was generated for the last
> step. Actually the spreadsheet view does not even show up when I run the
> python script. Is there a way for me to script this part? Manually what I do
> is I select the spreadsheet panel and go to File>Save Data… and specify
> format and filename.
>
> I have many integrations to do over many parts of the slice so it will be a
> problem if I cannot automate this last part.
>
>
>
> Thanks in advance for your help.
>
>
>
> I’m running 3.98.1 64-bit on RHEL 5, the data is unstructured following
> Tecplot format.
>
>
>
> Matthieu Masquelet, PhD
>
> Mechanical Engineer
>
> Computational Combustion Laboratory
>
> Combustion Systems Organization
>
> Aerothermal and Mechanical Systems
>
> GE Global Research
> One Research Circle, K1-2C36
> Niskayuna, NY 12309 United States
>
> GE imagination at work
>
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>
More information about the ParaView
mailing list