# mark custom filter as auto\_load from python macro

**URL:** https://discourse.paraview.org/t/mark-custom-filter-as-auto-load-from-python-macro/7834
**Category:** ParaView Support
**Tags:** python
**Created:** [August 18, 2021, 1:26pm UTC](https://discourse.paraview.org/t/mark-custom-filter-as-auto-load-from-python-macro/7834 "2021-08-18T13:26:25Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![skaal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/skaal/32/16671_2.png) [@skaal](https://discourse.paraview.org/u/skaal)
#### Post date: [August 18, 2021, 1:26pm UTC](https://discourse.paraview.org/t/mark-custom-filter-as-auto-load-from-python-macro/7834/1 "2021-08-18T13:26:25Z")

</div>

I have a macro to group a multiblock dataset into several nodes for simplified access. This macro relies on a set of python plugins loaded at the begin of the macro using `LoadPlugin` and works fine.

However, I cannot load state files recreating visualizations that used this macro because the python plugins are not loaded automatically. Activating the auto\_load settings in the plugin manager solves this issue but I have to do this manually for each plugin. And all others with whom I share these macros and plugins have to do so, too.

Is there a way to set the auto\_load flag automatically, e.g. from the macro when it is first executed and loads the plugins?  
Or do I _have to_ go via the `PV_PLUGIN_PATH` approach as described in the [PluginHowto](https://kitware.github.io/paraview-docs/latest/cxx/PluginHowto.html)?

---

<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: [August 18, 2021, 1:47pm UTC](https://discourse.paraview.org/t/mark-custom-filter-as-auto-load-from-python-macro/7834/2 "2021-08-18T13:47:36Z")

</div>

Autoload is a Qt GUI specific settings, so not afaik.

---

<div class="post-metadata">

### Author: ![ymjia](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/y/ccd318/32.png) [@ymjia](https://discourse.paraview.org/u/ymjia)
#### Post date: [August 19, 2021, 3:41pm UTC](https://discourse.paraview.org/t/mark-custom-filter-as-auto-load-from-python-macro/7834/3 "2021-08-19T15:41:46Z")

</div>

I have similar request, maybe a Macro to load all plugins may help, this is my code:  
(you may change the path based on your paraview dir structure)

```auto
# -*- coding: utf-8 -*-
## @file load_programmables.py
import os
import shutil
from paraview.simple import *

plm = servermanager.vtkSMProxyManager.GetProxyManager().GetPluginManager()    
info = plm.GetLocalInformation()

dir_cwd = os.getcwd()
dir_root = dir_cwd
if not os.path.exists(os.path.join(dir_cwd, "paraview.exe")):
    print("invalid directory")

#load programmables
dir_prg = os.path.join(dir_root, "paraview-5.7", "plugins", "programmables")

prg_list = []
if os.path.exists(dir_prg):
    for f in os.listdir(dir_prg):
        if os.path.splitext(f)[1] == ".py":
            prg_list.append(f)

for f in prg_list:
    LoadPlugin(os.path.join(dir_prg, f), remote=False, ns=globals())

prg_name_list = [os.path.splitext(f)[0] for f in prg_list]
for cc in range(0, info.GetNumberOfPlugins()):
    p_name = info.GetPluginName(cc)
    if p_name in prg_name_list:
        info.SetAutoLoad(cc, True)
        print("Auto load plugin: {}".format(p_name))

```
