# How does ParaView get the macros and filters in the source code

**URL:** https://discourse.paraview.org/t/how-does-paraview-get-the-macros-and-filters-in-the-source-code/3425
**Category:** Development
**Created:** [January 28, 2020, 11:15am UTC](https://discourse.paraview.org/t/how-does-paraview-get-the-macros-and-filters-in-the-source-code/3425 "2020-01-28T11:15:27Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![majo\_vlas](https://discourse.paraview.org/user_avatar/discourse.paraview.org/majo_vlas/32/2567_2.png) [@majo\_vlas](https://discourse.paraview.org/u/majo_vlas)
#### Post date: [January 28, 2020, 11:15am UTC](https://discourse.paraview.org/t/how-does-paraview-get-the-macros-and-filters-in-the-source-code/3425/1 "2020-01-28T11:15:27Z")

</div>

I am trying to make a custom application with Qt that is similar to ParaView but removing many things and adding others.  
I’ve been playing with [https://gitlab.kitware.com/paraview/paraview/tree/master/Examples/CustomApplications/Clone1](https://gitlab.kitware.com/paraview/paraview/tree/master/Examples/CustomApplications/Clone1)

And I would like this custom application to come with some macros and a couple of custom filters that I made since installation.

Where does ParaView get the macros and filters and where is it in the code?

Thank you!  
Any help on where is a good place to start is welcome!

---

<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: [January 28, 2020, 12:12pm UTC](https://discourse.paraview.org/t/how-does-paraview-get-the-macros-and-filters-in-the-source-code/3425/2 "2020-01-28T12:12:04Z")

</div>

Macros are added in custom applications the same way as in ParaView, through the Macros menu.  
Filters are added in custom application the same way as they are added ParaView, through Plugins, but you can load them statically, see here : [https://kitware.github.io/paraview-docs/latest/cxx/PluginHowto.html](https://kitware.github.io/paraview-docs/latest/cxx/PluginHowto.html) : Plugins in Static Applications

---

<div class="post-metadata">

### Author: ![majo\_vlas](https://discourse.paraview.org/user_avatar/discourse.paraview.org/majo_vlas/32/2567_2.png) [@majo\_vlas](https://discourse.paraview.org/u/majo_vlas)
#### Post date: [January 28, 2020, 2:08pm UTC](https://discourse.paraview.org/t/how-does-paraview-get-the-macros-and-filters-in-the-source-code/3425/3 "2020-01-28T14:08:36Z")

</div>

Okay, it looks like I can do it with the filters but I also hoped my clients didn’t have to load 10 macros when they installed the program for the first time.

It’s not possible with the macros?

---

<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: [January 28, 2020, 2:47pm UTC](https://discourse.paraview.org/t/how-does-paraview-get-the-macros-and-filters-in-the-source-code/3425/4 "2020-01-28T14:47:31Z")

</div>

You can automatically install the macros in the right directory so they are loaded automatically, but it is already the case with ParaView.

---

<div class="post-metadata">

### Author: ![majo\_vlas](https://discourse.paraview.org/user_avatar/discourse.paraview.org/majo_vlas/32/2567_2.png) [@majo\_vlas](https://discourse.paraview.org/u/majo_vlas)
#### Post date: [January 28, 2020, 5:58pm UTC](https://discourse.paraview.org/t/how-does-paraview-get-the-macros-and-filters-in-the-source-code/3425/5 "2020-01-28T17:58:26Z")

</div>

I’m sorry I don’t understand.

I would to avoid going to the Macros menu \> Add new macro and search the macro for every macro that I have.

Are you saying that there is a directory that I can put my macros and avoid the “Add new macro” part?

Any idea what this directory is or where can I get the information?

Thanks!

---

<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: [January 29, 2020, 3:37am UTC](https://discourse.paraview.org/t/how-does-paraview-get-the-macros-and-filters-in-the-source-code/3425/6 "2020-01-29T03:37:50Z")

</div>

Yes, there is directories :

```auto
%CONFIG%/ParaView/Macros
%PARAVIEW_EXECUTABLE_DIR%/Macros
%PARAVIEW_EXECUTABLE_DIR%/../Macros

```

---

<div class="post-metadata">

### Author: ![majo\_vlas](https://discourse.paraview.org/user_avatar/discourse.paraview.org/majo_vlas/32/2567_2.png) [@majo\_vlas](https://discourse.paraview.org/u/majo_vlas)
#### Post date: [February 6, 2020, 12:57am UTC](https://discourse.paraview.org/t/how-does-paraview-get-the-macros-and-filters-in-the-source-code/3425/7 "2020-02-06T00:57:04Z")

</div>

I have discovered that if I put the macros in `/Users/user/.config/ParaView/Macros` and open the ParaView installation, I see them in the toolbar.

But if I open the build of Clone1, they are not there. Therefore, I suppose the Clone1 build takes macros from another place.

Any idea where?

I also tried to find the other paths

`%PARAVIEW_EXECUTABLE_DIR%/Macros`  
`%PARAVIEW_EXECUTABLE_DIR%/ .. /Macros`

But I did not find them anywhere.

---

<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 6, 2020, 2:07am UTC](https://discourse.paraview.org/t/how-does-paraview-get-the-macros-and-filters-in-the-source-code/3425/8 "2020-02-06T02:07:38Z")

</div>

> [@majo\_vlas](#):
>
> /Users/user/.config/AplicationName/Macros

Remplace ApplicationName by your application name defined in your CMakeLists.txt

---

<div class="post-metadata">

### Author: ![majo\_vlas](https://discourse.paraview.org/user_avatar/discourse.paraview.org/majo_vlas/32/2567_2.png) [@majo\_vlas](https://discourse.paraview.org/u/majo_vlas)
#### Post date: [February 6, 2020, 1:57pm UTC](https://discourse.paraview.org/t/how-does-paraview-get-the-macros-and-filters-in-the-source-code/3425/9 "2020-02-06T13:57:01Z")

</div>

That worked! Thanks!
