Problem on running the same macro again.

When I run the macro added, it works as intended in the first run. For the second time, an error occured (Input port 1 of algorithm vtkPProbeFilter () has zero connections but is not optional.). I do not upload a dataset but can be tried with anyone.
I have to say that this is the simplest form I obtained for this error. I have a much complicated macro but think that the source of error is the same.
It seems that also macro finished, some residuals remain. how can I clear all things relevant to the macro after the macro run.
Thanks.macro.py (910 Bytes)

That is because the second time you run, you have no active source and the first command :
scene=GetActiveSource() returns an empty object.

You may want to addSetActiveSource(scene) at the end of your macro.

Thank you so much.

1 Like