# vtk event for about to load state ?

**URL:** https://discourse.paraview.org/t/vtk-event-for-about-to-load-state/200
**Category:** Development
**Created:** [June 18, 2018, 1:06pm UTC](https://discourse.paraview.org/t/vtk-event-for-about-to-load-state/200 "2018-06-18T13:06:44Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![michal.wozniak](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/848f3c/32.png) [@michal.wozniak](https://discourse.paraview.org/u/michal.wozniak)
#### Post date: [June 18, 2018, 1:06pm UTC](https://discourse.paraview.org/t/vtk-event-for-about-to-load-state/200/1 "2018-06-18T13:06:44Z")

</div>

Hi,

I’m creating a plugin that is doing some actions when a state file is being loaded. When i’m using the GUI, i can connect to pqApplicationCore::onStateAboutToLoad event.

This event doesn’t exist when I’m using pvbatch since pqApplication is only created for QApplication client. I tried to find a similar event in VTK. The closest I found is vtkCommand::LoadStateEvent but it’s only triggered after the state file is completely loaded.

Is there a way to connect to the onStateAboutToLoad signal when using pvbatch, or will a need to create a custom vtkCommand ?

thank

---

<div class="post-metadata">

### Author: ![utkarsh.ayachit](https://discourse.paraview.org/user_avatar/discourse.paraview.org/utkarsh.ayachit/32/39_2.png) [@utkarsh.ayachit](https://discourse.paraview.org/u/utkarsh.ayachit)
#### Post date: [June 18, 2018, 2:07pm UTC](https://discourse.paraview.org/t/vtk-event-for-about-to-load-state/200/2 "2018-06-18T14:07:18Z")

</div>

Alas, currently there’s no event fired before loading state in `vtkSMSessionProxyManager::LoadXMLState`, as a result there’s no notification available in pvbatch for before loading state.

---

<div class="post-metadata">

### Author: ![michal.wozniak](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/848f3c/32.png) [@michal.wozniak](https://discourse.paraview.org/u/michal.wozniak)
#### Post date: [June 18, 2018, 2:40pm UTC](https://discourse.paraview.org/t/vtk-event-for-about-to-load-state/200/3 "2018-06-18T14:40:08Z")

</div>

Ok, then I will create one.

thanks !
