How to select the blocks by using python?

HI all,
I am new to ParaView, and I want to konw how to select the concerned blocks by using python.
For example, selecting the blocks with names of 'block_1003' and 'block_1010' as the figure shows:

The file is in ExodusII format.

Thanks in advance.

Hi @Echo

The simplest way to findout how to script GUI action in python is to use the python trace with the Incremental option

  • Tools → Start trace
  • Check “Show Incremental”
  • Perform GUI actions
  • Watch your code write itself :slight_smile:

@mwestphal Thanks a lot for your reply! It is really a great feature!