# Copy filter setup to new case

**URL:** https://discourse.paraview.org/t/copy-filter-setup-to-new-case/1275
**Category:** ParaView Support
**Created:** [February 12, 2019, 7:45am UTC](https://discourse.paraview.org/t/copy-filter-setup-to-new-case/1275 "2019-02-12T07:45:42Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![MarkB](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/a8b319/32.png) [@MarkB](https://discourse.paraview.org/u/MarkB)
#### Post date: [February 12, 2019, 7:45am UTC](https://discourse.paraview.org/t/copy-filter-setup-to-new-case/1275/1 "2019-02-12T07:45:42Z")

</div>

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

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [February 12, 2019, 8:47am UTC](https://discourse.paraview.org/t/copy-filter-setup-to-new-case/1275/2 "2019-02-12T08:47:15Z")

</div>

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

---

<div class="post-metadata">

### Author: ![jvoor](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/71c47a/32.png) [@jvoor](https://discourse.paraview.org/u/jvoor)
#### Post date: [February 12, 2019, 11:26am UTC](https://discourse.paraview.org/t/copy-filter-setup-to-new-case/1275/3 "2019-02-12T11:26:18Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [February 12, 2019, 12:51pm UTC](https://discourse.paraview.org/t/copy-filter-setup-to-new-case/1275/4 "2019-02-12T12:51:19Z")

</div>

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

In the meantime, the macro should work for you.

---

<div class="post-metadata">

### Author: ![Andy\_Bauer](https://discourse.paraview.org/user_avatar/discourse.paraview.org/andy_bauer/32/5442_2.png) [@Andy\_Bauer](https://discourse.paraview.org/u/Andy_Bauer)
#### Post date: [February 12, 2019, 1:08pm UTC](https://discourse.paraview.org/t/copy-filter-setup-to-new-case/1275/5 "2019-02-12T13:08:43Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![wascott](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/w/8e8cbc/32.png) [@wascott](https://discourse.paraview.org/u/wascott)
#### Post date: [February 12, 2019, 6:31pm UTC](https://discourse.paraview.org/t/copy-filter-setup-to-new-case/1275/6 "2019-02-12T18:31:04Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![MarkB](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/a8b319/32.png) [@MarkB](https://discourse.paraview.org/u/MarkB)
#### Post date: [February 13, 2019, 7:01am UTC](https://discourse.paraview.org/t/copy-filter-setup-to-new-case/1275/7 "2019-02-13T07:01:06Z")

</div>

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

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [February 13, 2019, 9:10am UTC](https://discourse.paraview.org/t/copy-filter-setup-to-new-case/1275/8 "2019-02-13T09:10:17Z")

</div>

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

---

<div class="post-metadata">

### Author: ![jvoor](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/71c47a/32.png) [@jvoor](https://discourse.paraview.org/u/jvoor)
#### Post date: [February 13, 2019, 10:52am UTC](https://discourse.paraview.org/t/copy-filter-setup-to-new-case/1275/9 "2019-02-13T10:52:50Z")

</div>

@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](https://gitlab.kitware.com/paraview/paraview/issues/18771)

---

<div class="post-metadata">

### Author: ![RyanLin](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/r/ecc23a/32.png) [@RyanLin](https://discourse.paraview.org/u/RyanLin)
#### Post date: [January 9, 2023, 3:20pm UTC](https://discourse.paraview.org/t/copy-filter-setup-to-new-case/1275/10 "2023-01-09T15:20:24Z")

</div>

@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,

```auto
# 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?

---

<div class="post-metadata">

### Author: ![RyanLin](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/r/ecc23a/32.png) [@RyanLin](https://discourse.paraview.org/u/RyanLin)
#### Post date: [January 9, 2023, 3:25pm UTC](https://discourse.paraview.org/t/copy-filter-setup-to-new-case/1275/11 "2023-01-09T15:25:21Z")

</div>

It seems this is the function:  
`GetActiveSource()`
