code: def connectedCells(self, index, returnIds=False):
          
          
          # Find all cells connected to point index
          dpoly = self.polydata()
          cellPointIds = vtk.vtkIdList()
          dpoly.GetPointCells(index, cellPointIds)
      
          ids = vtk.vtkIdTypeArray()
          ids.SetNumberOfComponents(1)
          rids = []
          for k in range(cellPointIds.GetNumberOfIds()):
              cid = cellPointIds.GetId(k)
              ids.InsertNextValue(cid)
              rids.append(int(cid))
          if returnIds:
              return rids
             
          selectionNode = vtk.vtkSelectionNode()
          selectionNode.SetFieldType(vtk.vtkSelectionNode.CELL)
          selectionNode.SetContentType(vtk.vtkSelectionNode.INDICES)
          selectionNode.SetSelectionList(ids)
          selection = vtk.vtkSelection()
          selection.AddNode(selectionNode)
          extractSelection = vtk.vtkExtractSelection()
          extractSelection.SetInputData(0, dpoly)
          extractSelection.SetInputData(1, selection)
          extractSelection.Update()
          gf = vtk.vtkGeometryFilter()
          gf.SetInputData(extractSelection.GetOutput())
          gf.Update()
          return Actor(gf.GetOutput()).lw(1)
docs: Find all cellls connected to an input vertex specified by its index.