2

I work on Programmable Filter which should change values of selected cells. How can I get IDs of selected cells to apply filter on them?

from paraview import vtk
pdi = self.GetPolyDataInput()
numCells = pdi.GetNumberOfCells()
for i in range(numCells): # <- ONLY FOR SELECTED CELLS?
    pdi.GetCellData().GetArray('force').SetValue(i, -1)
Andrew
  • 958
  • 13
  • 25

1 Answers1

0

Currently unsuported from a python programmable filter. you could however first use an ExtractSelection filter.

Mathieu Westphal
  • 2,544
  • 1
  • 19
  • 33