Copy New Active Selection using pvpython

Dear Support!
I have a static_FC.vtk file (attached). After loading it in ParaView, I use an ExtractionSelection filter on it to capture user selected cells. This is working fine but in my workflow, the user will be making new selection (using mouse interaction) after clearing the existing selection. Once the user make a new selection using Select Cells On, I wish to trigger the Copy Active Selection button inside the ExtractSelection properties using pvpython. I am basically trying to access the updated list of selected cell-IDs in a python program. I could not find a way to trigger the Copy Active Selection programmatically using pvpython.

Any idea on how I can achieve this? Thanks in advance! :slight_smile:


static_FC.vtk (233.6 KB)

1 Like

@spyridon97 Hi Spiros!!! I am super glad to see you supporting on this. :raised_hands: Thanks a lot!
Unfortunately, the code you shared do not work in my use case.
Here is the deal: In my workflow, users won’t be running a pvpython command to make a selection. Instead, they’ll pick cells on the sphere surface using the Select Cells On button. After they manually select the cells, I need a pvpython command that copies those selected cells into the ExtractSelection - basically mimicking the click on the Copy Active Selection button.

Is that possible?

1 Like

You are great!!! :raised_hands:It worked for me. Thanks a ton!! Spiros!! :slight_smile: