[Paraview] Save Data for all branches

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Wed Mar 2 09:33:47 EST 2011


Here's a simple script that saves all "sinks".


from paraview.simple import *

counter = 0
sources = GetSources()
for source in sources.values():
  has_consumer = False
  for i in range(0, source.GetNumberOfConsumers()):
    consumer = source.GetConsumerProxy(i)
    if consumer in sources.values():
      has_consumer = True
      print has_consumer
      break
  if not has_consumer:
    writer = CreateWriter("/tmp/foo%d.vtk" % counter, source)
    counter = counter + 1
    writer.UpdatePipeline()
    del writer


On Wed, Mar 2, 2011 at 8:08 AM,  <owen.arnold at stfc.ac.uk> wrote:
> Hi,
>
>
>
> Is it there any way to save data from all pipeline branches without
> selecting them individually? Is this something that could be scripted?
>
>
>
> Thanks in advance,
>
>
>
> Owen.
>
> --
> Scanned by iCritical.
>
> _______________________________________________
> 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
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>
>


More information about the ParaView mailing list