Python script trace can't repeat the GUI operation to draw time curve

When I was drawing the time curve of Point Gaussian, the traced Python script was executed with error.
So the selection items in GUI can’t be traced in a Python script? What should I do to get the right points? Thanks for any help!


1.py (13.9 KB)
data.zip (4.8 KB)

Unable to reproduce your issue with ParaView 5.8.0 here.

I’m sorry for not uploading the data file before. Now I re-edit the post. I modified the data path in “1.py” and attached “data.zip” file. Please uncompress the zip file to root D disk on Windows OS with path “D:\data\stress00**.vtk”. I think the macro 1.py can reproduce this issue.
Thank you very much!

Here is what I’m doint that do not reproduce your issue :

  • run ParaView
  • Wavelet, Apply
  • PointGaussian
  • Tools -> StartTrace, OK
  • Select Points Trough
  • Trace open with a selection line in it

So do you mean ParaView can record the selection operation with step 6 or some other meaning?
I find that in “1.py” the python script have corresponding codes of selection operation. But when I run it again there is error as the video shows.

So that is the replaying of the trace that is not working ?
It seems to work here as well :

  • run ParaView
  • Wavelet, Apply
  • PointGaussian
  • Tools -> StartTrace, OK
  • Select Points Trough
  • Stop trace
  • Trace open with a selection line in it
  • Save trace as python file
  • delete selection
  • Add macro -> the python file
  • Click on the macro
  • Selection is correct

Yes, I reproduce your operation and it’s correct. But my main purpose is selecting some points and draw the curve. So I have tried your suggestion and the error still occur as the video shows bellow. The error message is still the same: Name Error: name ‘plotSelectionOverTime1’ is not defined.
So can you find out why when I want to draw some curve with data things go wrong?
Thank you again!

Could you provide steps to reproduce your issue using the same format as mine (with your data is ok)? I’m still unclear about what is actually the problem here.

Ok, the reproduce procedure of this situation is like this:

  1. run ParaView
  2. turn on “Apply changes to parameters automatically”
  3. Tools -> StartTrace, OK
    (1). Open D:\data\stress.vtk (group file)
    (2). PointGuassian
    (3). Properties -> Radius -> 20, Reset
    (4). Select Points Trough (choose any points)
    (5). Plot Selection Over Time
  4. Stop trace
  5. Save As Macro -> 1.py to default path
  6. Reset Session (Now we try to run the script to reproduce this operation.)
  7. click 1.py on toolbar
  8. Output Message shows “NameError: name ‘plotSelectionOverTime1’ is not defined”

I attach the data file again for convenience.
data.zip (4.8 KB)

Wow, that’s indeed a bug ! I don’t have a way to work around it for now using trace, but you can simply fix your script after it has been generated by adding this line just before the first usage of plotSelectionOverTime1.

plotSelectionOverTime1 = PlotSelectionOverTime(Input=stress00)

The issue has been logged here :
https://gitlab.kitware.com/paraview/paraview/-/issues/19956

Thank you for replying. I have tested your suggestion by adding a command to the original script 1.py.

plotSelectionOverTime1 = PlotSelectionOverTime(Input=stress00)

There is indeed no error message already. But as you promoted in GitLab issue channel this script still can’t reproduce the curve as GUI create.
So right now I can follow up this issue on GitLab if it is fixed in further ParaView released version?
Thank you!

Indeed, generating the script using the trace will not create a valid trace.

You can indeed follow it on gitlab, however, it may not be fixed in priority as there is a workaround.

If you are looking to fund this issue to fix it in priority, please contact us here : http://kitware.eu/contact/

Ok, the workaround selection method you mean is GUI operation right now? or can I select points by number or coordinates in a script? Although I haven’t achieved and maybe try it later.
But thank you all the same!

What I mean is that you can just edit your python script after the trace to fix it.

Oh, but as you mentioned the fixed script still can’t replot the curve. Right? It just creates an empty plotting area. So…

Looks like we misunderstood each other, the fixed script should work.

Em…I think so. When you fixed the script can you plot the time curve? I post the modified script file 2.py.
When I run it there is still an empty plot.


2.py (14.0 KB)

I found the solution! You have to use the query tool

Hi Noctua,
I am having the same issue as the main post. It would be great if you could elaborate more about the query tool to solve the issue. Thanks!

Hi Mathieu,

Sorry to dig this post years ago. I just met the similar issue as the main post and I am using Paraview 5.10 and the issue seems remain.
I uploaded the traced python script from the very beginning to load VTK files. I intended to select one point and plotsectionovertime. The the code started to give error from Line 105 “plotSelectionOverTime1Display = Show(plotSelectionOverTime1, quartileChartView1, ‘QuartileChartRepresentation’)” with the error message “NameError: name ‘plotSelectionOverTime1’ is not defined”.
I wonder to fix this issue, which command(s) I should add to the traced script?
Thank you very much!!!
salishsea_sal2_test.py (20.9 KB)