[vtkusers] Time Data in Exodus files
David Thompson
david.thompson at kitware.com
Wed Oct 21 11:58:07 EDT 2015
Hi Andrew,
> ... Here is what I needed to do.
>
> info = reader.GetExecutive().GetOutputInformation().GetInformationObject(0)
> key = vtk.vtkStreamingDemandDrivenPipeline.TIME_STEPS()
>
> # info.Get(key) produces an error, not sure why.
This is because the Python wrappers don't deal well with default parameter values (you need to pass values for all arguments, even if the C++ version provides a default value).
David
> n = info.Length(key)
> times = [0]*n
> for i in range(n):
> times[i] = info.Get(key, i)
> print times
You can use a list comprehension to make it easier:
times = [info.Get(key,i) for i in range(info.Length(key))]
HTH,
David
More information about the vtkusers
mailing list