Show Text Annotation depending on Timestep

Hello,

i’m trying to visualize my finite-elements-analysis in paraview.
I have an .pvd-File like this:

<?xml version="1.0"?>
<VTKFile type="Collection" version="1.0" byte_order="LittleEndian" header_type="UInt64">
  <Collection>
    <DataSet timestep="0.0" part="0" file="myvtmFile_Step1_Frame0.vtm"/>
    <DataSet timestep="0.05" part="0" file="myvtmFile_Step1_Frame1.vtm"/>
    <DataSet timestep="0.1" part="0" file="myvtmFile_Step1_Frame2.vtm"/>
    <DataSet timestep="0.15" part="0" file="myvtmFile_Step1_Frame3.vtm"/>
    <DataSet timestep="0.2" part="0" file="myvtmFile_Step1_Frame4.vtm"/>
    <DataSet timestep="0.25" part="0" file="myvtmFile_Step1_Frame5.vtm"/>
    <DataSet timestep="0.325" part="0" file="myvtmFile_Step1_Frame6.vtm"/>
    <DataSet timestep="0.425" part="0" file="myvtmFile_Step1_Frame7.vtm"/>
    <DataSet timestep="0.525" part="0" file="myvtmFile_Step1_Frame8.vtm"/>
    <DataSet timestep="0.625" part="0" file="myvtmFile_Step1_Frame9.vtm"/>
    <DataSet timestep="0.725" part="0" file="myvtmFile_Step1_Frame10.vtm"/>
    <DataSet timestep="0.825" part="0" file="myvtmFile_Step1_Frame11.vtm"/>
    <DataSet timestep="0.925" part="0" file="myvtmFile_Step1_Frame12.vtm"/>
    <DataSet timestep="1.0" part="0" file="myvtmFile_Frame13.vtm"/>
    <DataSet timestep="1.000001" part="0" file="myvtmFile_Step2_Frame0.vtm"/>
    <DataSet timestep="1.25" part="0" file="myvtmFile_Step2_Frame1.vtm"/>
    <DataSet timestep="1.5" part="0" file="myvtmFile_Step2_Frame2.vtm"/>
    <DataSet timestep="1.75" part="0" file="myvtmFile_Step2_Frame3.vtm"/>
    <DataSet timestep="2.0" part="0" file="myvtmFile_Step2_Frame4.vtm"/>
  </Collection>
</VTKFile>

is it possible to annotate a text in paraview depending on the timestep? for example i would like to show a text annotation which checks the current displayed timestep in paraview and then decides which text is shown.

Desired Output:

If current timestep shown in paraview is between 0.0 and 1.0 ==> show a text annotation “Step-1”

If current timestep shown in paraview is greater than 1.0 ==> show a text annotation “Step-2”

thanks in advance

i found a solution in the meantime:

Create an “Programmable Annotation” with somehting like this:

import paraview.simple

myView = paraview.simple.GetActiveView()
current_displayed_time = myView.ViewTime

# Create a List with the Timestep Boundaries
myList = [1.0, 2.0]

for i in myList: 
    if current_displayed_time <= i and current_displayed_time >= i-1: 
        myString = ('Step-' + str(int(i)))

to = self.GetTableOutput()
arr = vtk.vtkStringArray()
arr.SetName("Text")
arr.SetNumberOfComponents(1)
arr.InsertNextValue(myString)
to.AddColumn(arr)

or work with a Dictionary:

import paraview.simple

myView = paraview.simple.GetActiveView()
current_displayed_time = myView.ViewTime


Dict = {'Step-1': 1.0, 'Step-2': 2.0}
myList = list(Dict.values())

for i in myList: 
    if current_displayed_time <= i: 
        myString = list(Dict.keys())[list(Dict.values()).index(i)]
        break

to = self.GetTableOutput()
arr = vtk.vtkStringArray()
arr.SetName("Text")
arr.SetNumberOfComponents(1)
arr.InsertNextValue(myString)
to.AddColumn(arr)