Alan,
I am not sure I follow, but attached is a script that fetches "global
arrays" to the client side so you can do whatever you want with it. Is
that what you're looking for?
Utkarsh
On Wed, May 18, 2016 at 9:52 PM, Scott, W Alan <[email protected]> wrote:
>
>
> If I want to get the numeric value of an "Annotate Global Variable" variable
> so that I can use it later in a python script, how do I do that? E.g. take
> the global variable, make it into a string, and display it as text
>
>
>
> Thanks,
>
>
>
> Alan
>
>
> _______________________________________________
> 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
>
> Search the list archives at: http://markmail.org/search/?q=ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview
>
from paraview.simple import *
from paraview import vtk
import vtk.numpy_interface.dataset_adapter as dsa
def fetchGlobalData(source):
programmableFilter1 = ProgrammableFilter(Input=source,
OutputDataSetType='vtkTable',
Script="""
if inputs[0].IsA("vtkCompositeDataSet"):
for b in inputs[0]:
a = b.GetFieldData()
break
else:
a = inputs[0].GetFieldData()
if a:
output.GetRowData().PassData(a)""")
programmableFilter1.UpdatePipeline()
a = servermanager.Fetch(programmableFilter1, arg1=0)
Delete(programmableFilter1)
if a:
return dsa.WrapDataObject(a)
else:
return None
reader = OpenDataFile('/home/utkarsh/Kitware/ParaView3/ParaViewData/Data/disk_out_ref.ex2')
data = fetchGlobalData(reader)
for aname in data.RowData.keys():
print aname, data.RowData[aname]
_______________________________________________
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
Search the list archives at: http://markmail.org/search/?q=ParaView
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview