# Automate Array Renamer in python

**URL:** https://discourse.paraview.org/t/automate-array-renamer-in-python/8395
**Category:** ParaView Support
**Tags:** python
**Created:** [November 13, 2021, 3:24pm UTC](https://discourse.paraview.org/t/automate-array-renamer-in-python/8395 "2021-11-13T15:24:47Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![owfischer](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/o/8c91f0/32.png) [@owfischer](https://discourse.paraview.org/u/owfischer)
#### Post date: [November 13, 2021, 3:24pm UTC](https://discourse.paraview.org/t/automate-array-renamer-in-python/8395/1 "2021-11-13T15:24:47Z")

</div>

Hello altogether,

I am trying to automate the ArrayRenamer Filter with python and cannot get it working.

From an FEA calculation with Code\_Aster I have got a result file with multiple arrays each consisting of two or more components representing POINTS data from a user defined failure criterion. The first component represents the failure indices (default name “X1”), the second component represents a failure mode (default name “X2”).

For replacing the ugly default component names by more meaningful ones (e.g.: “X1” ==\> “failure\_index”, “X2” ==\> “failure\_mode”) , the Array Renamer filter does a good job - but only in the GUI. When I try to automate this, based on the recorded python code with the command “arrayRenamer1.ComponentInfo = […]”, the components are not updated.

```auto
# -*- coding: iso-8859-1 -*-

import pvsimple
pvsimple.ShowParaviewView()
# trace generated using paraview version 5.6.0-RC1
from pvsimple import *
pvsimple._DisableFirstRenderCameraReset()

renderView1 = FindViewOrCreate('RenderView1', viewtype='RenderView')
SetActiveView(renderView1)

source = GetActiveSource()
print("Verwende source =",source.FileName)

# create a new 'Array Renamer'
arrayRenamer1 = ArrayRenamer(Input=source)

# show data in view
arrayRenamer1Display = Show(arrayRenamer1, renderView1)

# trace defaults for the display properties.
arrayRenamer1Display.Representation = 'Surface'

# show color bar/color legend
arrayRenamer1Display.SetScalarBarVisibility(renderView1, True)

# update the view to ensure updated data information
renderView1.Update()

# Properties modified on arrayRenamer1
# '0' stands for the first component with the default name X1
# '1' stands for the second component with the default name X2
arrayRenamer1.ComponentInfo = ['FF_L01u_UT01_NOEU', '0', 'failure_index', \
                               'FF_L01u_UT01_NOEU', '1', 'failure_mode', \
                              ...]
renderView1.Update()

```

I have tried run this code as Macro and from the ParaVis MenuBar / Tools / Python Shell / Run Script command. Neither works as hoped. I suspect that it might have to do with clicking the Apply button in the GUI. Maybe some …Update() function is missing in my code?

Does anybody know what I’m missing or doing wrong? Is this a bug fixed in a later version?

Thank you very much for any help,  
owfischer

I am working with ParaVis 5.6.0 in Salome-Meca 9.3.0 for Windows.

---

<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: [November 15, 2021, 8:37am UTC](https://discourse.paraview.org/t/automate-array-renamer-in-python/8395/2 "2021-11-15T08:37:55Z")

</div>

ArrayRenammer is a ParaVis filter I believe, it is not present in ParaView, so hard to say what is going on.

---

<div class="post-metadata">

### Author: ![owfischer](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/o/8c91f0/32.png) [@owfischer](https://discourse.paraview.org/u/owfischer)
#### Post date: [November 15, 2021, 9:47am UTC](https://discourse.paraview.org/t/automate-array-renamer-in-python/8395/3 "2021-11-15T09:47:39Z")

</div>

Ah, interesting to know, thank you for answering. I do not know what the exact differences between ParaView and ParaVis are. I assumed the developers are the same - I just understood that ParaVis is the implementation of ParaView in Salome-Meca, enhanced with an integrated MED-file reader to import the result files created by Code\_Aster.

So I am asking my question in the wrong forum? Do you know which forum would be the right one?

---

<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: [November 15, 2021, 9:49am UTC](https://discourse.paraview.org/t/automate-array-renamer-in-python/8395/4 "2021-11-15T09:49:42Z")

</div>

The MEDReader and many other Salome specific filter are being developped by the ParaVis team.

Maybe ask here: [Code\_Aster forums](https://www.code-aster.org/forum2/) or [Forum — SALOME Platform](https://www.salome-platform.org/forum) ?
