Hey Kyoshimi, thank you for the help - I managed to get it working, although it isn’t perfect. I have to use a scalar clip to generate a contour after using the programmable filter. The below did it, if I first ctrl selected the data set and then the stl:
mesh = self.GetInputDataObject(0, 0)
import paraview.vtk as vtk
pdd = vtk.vtkImplicitPolyDataDistance()
pdd.SetInput(mesh)
dataset = self.GetInputDataObject(0, 1)
output.CopyAttributes(dataset)
numPts = dataset.GetNumberOfPoints()
distArray = vtk.vtkDoubleArray()
distArray.SetName(“Distance”)
distArray.SetNumberOfComponents(1)
distArray.SetNumberOfTuples(numPts)
for i in range(numPts):
pt = dataset.GetPoint(i)
print(pt)
distArray.SetValue(i, pdd.EvaluateFunction(pt))
output.GetPointData().AddArray(distArray)