Hello there,

I'm relatively new to Paraview, and I'd love to have an easy way of reloading the data and updating the display. From the list archives, I understand there is no ready-made solution for this at the moment.

So I got the idea to use the sequence "Reset session" -> "Load State" from the menu, which works like a charm but is a hassle nonetheless.

Next, I tried using this python code as a macro:

  from paraview.simple import *
  from tempfile import *

  t = NamedTemporaryFile(suffix=".pvsm", delete=False)
  f = t.name

  SaveState(f)

  s = GetSources()
  for key,val in s.items():
      Delete(val)

  LoadState(f)

This works, sort of, but deleting the sources isn't quite the same as resetting the session, for which I haven't been able to find a python equivalent. What it does, however, is to create a new layout each time I run the macro, and display a warning "This code may not work in multi-clients mode" as well. It also appears to tie up a lot of memory after a few uses, which isn't really that funny.

I also tried adding equivalent lines to delete the views and the layouts, but behaviour was the same whatever I did.

So, what do I need to do differently? What's the closest I could get in python to the menu item "Reset session"?

Thanks!
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview

Reply via email to