TimestepValues Error : No Attribute

Hey,
I am quite new to paraview.Here I am trying to jump to a specific time step in my data.Here is the pvpython code:

n=3
reader = GetActiveSource()
view = GetActiveView()
times = reader.TimestepValues
view.ViewTime = times[n]
Render()

But I am getting the following error:

 times = reader.TimestepValues()
  File "E:/BlueCFD/blueCFD-Core-2020/AddOns/ParaView/bin\Lib/site-packages\paraview\servermanager.py", line 497, in __getattr__
    return getattr(self.SMProxy, name)
AttributeError: 'vtkPVServerManagerCorePython.vtkSMSourceProxy' object has no attribute 'TimestepValues'

Thanks for your time and support :slight_smile:

did you call UpdatePipelineInformation ?

Thanks for the reply. I am sorry. I have no idea what that is. Should I call that function. Could you tell me what to add in the code

n=3
reader = GetActiveSource()
view = GetActiveView()
reader.UpdatePipelineInformation()
times = reader.TimestepValues
view.ViewTime = times[n]
Render()

Still the same error : (

I have an example in the Sandia ParaView Tutorial, found from ParaView’s Help Menu. The toturial of interest is ParaView and Python, towards the bottom. In that is a section on Time. https://www.paraview.org/Wiki/ParaView_and_Python#Control_time Here is a snippet:

        animationScene1 = GetAnimationScene()
        tk = GetTimeKeeper()
        timesteps = tk.TimestepValues
        animationScene1.AnimationTime = timesteps[9] # index starts with 0

Thanks for the reply. I tried this and there was no error but there is no change in data too. I exported csv with n=0 and n= random numbers and both are identical.

How big is your dataset? Can you post it here?

I can’t show you the data. I will post the entire macro script here. I am importing 3d_mesh then I am slicing to get a 2d plane. On the 2d plane, I am plotting data along a line at different positions of x using while loop. I have to repeat this for all my time steps ( 0 to 48)

macro.txt (2.0 KB)

Guys, I just changed OpenFOAMReader to OpenDataFile and it works :slight_smile: