Highlight mesh in Paraview

Is there way to highlight specific geometry (as a whole mesh, particular face, edge) via python API in Paraview? So far I’ve noticed functionality to select cells, points and blocks, but that seems related to data processing. Whereas my need is rather to let user know that some geometry object is selected.

Thanks.

Hi @CapLek ,

SelectCells() should do the trick.

Best,

1 Like

Hi Mathieu,

Thanks for the reply. Are there any other options? What about separate face/surface/edge highlight?

You can SelectCells/Points/Blocks, like in ParaView. There is no concept of face/edges in ParaView, unless your data is already decomposed in these different element as cells.

Thanks for explanation. Another question to ask is how to select cells of the clicked object through the API?

Here’s what I’m doing.

  1. Getting the active view.
  2. Calling SelectSurfaceCells with the coordinates of click to get the clicked proxy.
  3. When I’m calling simple.SelectCells with proxy from step 2 as an argument I`m getting an error

Traceback (most recent call last):
File “”, line 22, in
File “C:\Program Files\ParaView 5.10.0-Windows-Python3.9-msvc2017-AMD64\bin\Lib\site-packages\paraview\simple.py”, line 2347, in SelectCells
return _select(“CELL”, query, proxy)
File “C:\Program Files\ParaView 5.10.0-Windows-Python3.9-msvc2017-AMD64\bin\Lib\site-packages\paraview\simple.py”, line 2339, in _select
proxy.SMProxy.SetSelectionInput(proxy.Port, selSource.SMProxy, 0)
AttributeError: ‘paraview.modules.vtkRemotingServerManager.vtkSMSou’ object has no attribute ‘SMProxy’

It looks like I need to convert obtained proxy object to some other type, but I don`t know which one. Could you please point to the right type or a useful documentation section?

You need to provide a Selection query to select, the doc is here:

https://kitware.github.io/paraview-docs/latest/python/paraview.simple.html?highlight=selectcells#paraview.simple.SelectCells

Example usage here:

But what if I want to select all cells of the source I’ve clicked on (at the same time there can be some number of other sources on the scene)? Why do I need to provide the query if I want all cells to be selected?

The question was how can I find out which source I’ve clicked on?

I’m not sure to follow, can you explain what you are trying to do and the “ideal” steps you want to take ?