Copy filter setup to new case

Hi,

I have a number of OpenFoam calculations where I would like to apply the same filters and filter settings.
Is it possible to set this up for one case and reuse it for the other cases?

Thanks,

Mark

One way to do that and to hide the complexity of the filters is to use Custom Filters :

  • Select the filters that you want to pack in a single custom filter
  • Tools -> Create Custom Filters
  • Follow the wizard
  • A new filter is available in the Filters menu.

Another way to do that without hiding the complexity is with a python macro :

  • Tools -> Start Trace
  • Create the filters that you will be repeating in the future
  • Tools -> Stop Trace
  • Save as macro
  • Just click on the macro toolbar when you need to repeat the filters

Being able to copy and paste filters would be really helpful in my daily usage. I have tried the custom filters option but I find that it is quite cumbersome to use as I need to predict ahead of time which parameters I may want to change so I can expose them. Either that or I continually have to create new custom filters which leads to a temp1, temp2 ect. Being able to copy and paste filters to other datasets would be very helpful in my opinion.

Indeed, but not implemented sadly. Feel free to open a feature request here : https://gitlab.kitware.com/paraview/paraview/issues

In the meantime, the macro should work for you.

Maybe something else that may work for you is that you can change the input to a filter by right-clicking on a filter and choose Change Filter.... That with maybe a state file or some of the tips that Mathieu mentioned may save you some time.

I believe there is a 3/4 solution. Here is what I just did:

  • Linux, 5.6.0, builtin
  • Open Examples/ can.ex2. Apply
  • Clip. Turn off Invert. Turn on Crinkle Clip. Apply.
  • Open Exampes/ disk_out_ref.exo. Apply.
  • Clip. Apply.
  • Now, right click on the first clip, Clip1. Copy
  • Now, right click on the second clip, Clip 2. Paste.

Another way to somewhat do the same thing is in the Properties tab. Notice you can copy and paste properties between filters. For instance, the Properties or Display section. You do this with the little icons to the right of the Properties, Display and View sub labels.

Thanks for the replies.
the custom filters work fine for me

@wascott : I think the copy/paste behavior in the pipeline behavior is unintuitive and should be improved.

1 Like

@wascott
This is helpful, thanks. Not as good as being able to cntrl+C and cntrl+V a filter onto another dataset/filter but it will definately help.
@mwestphal I have submitted copy / pasting as a feature request -> https://gitlab.kitware.com/paraview/paraview/issues/18771

@mwestphal I tried the macro idea. It worked but I would like to have it more automated. In the script I see the input is recorded too, for example,

# find source
inputVtk = FindSource('test.vtk')

When I apply this macro to some other files I have to change the file name each time. How do I avoid this? What function do I need to use so it recognizes the current selection I have?

It seems this is the function:
GetActiveSource()