How to add filename as text in the renderview?

Hi, I have a bunch of vtk files named by simulation time: U_0.05.vtk, U_0.10.vtk, U_0.15.vtk, …

Now I want to extract the time in filename, i.e, 0.05, 0.10, 0.15, …, and source → text to renderview, like time=0.05, time=0.10, time=0.15, … Is there anyway in paraview to identify the filename in text panel? Thanks!

Afaik ParaView does not read the time value from the filename. You will need to use a .series file.

I have the same question. How to get the file path and file name of the file that has been read in, and whether there are relevant function interfaces that can be used?

Filename property will give you this information.

Thank you a thousand time

Hi Mathieu, thanks for your information! Now I have another logic to solve this problem. Now I obtain “time” as a dictionary, which looks like:

{0: '1250.0', 1: '1250.5', 2: '1251.0', 3: '1251.5', 4: '1252.0', 5: '1252.5', 6: '1253.0', 7: '1253.5', 8: '1254.0', 9: '1254.5'}

And as this post suggested, I use Python Annotation filter to add a timestep-varying text in render_view:

pythonAnnotation1 = PythonAnnotation(Input=velocity)
pythonAnnotation1.Expression = time[t_index]
pythonAnnotation1Display = Show(pythonAnnotation1, renderView1)

But I received the error “name ‘t_index’ is not defined”. It seems that I need to get the current time step used in active view. Do you know how to do that in paraview?

t_index works great here with my data.