# Highlight mesh in Paraview

**URL:** https://discourse.paraview.org/t/highlight-mesh-in-paraview/9616
**Category:** Web Support
**Created:** [May 12, 2022, 11:17am UTC](https://discourse.paraview.org/t/highlight-mesh-in-paraview/9616 "2022-05-12T11:17:50Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![CapLek](https://discourse.paraview.org/user_avatar/discourse.paraview.org/caplek/32/3430_2.png) [@CapLek](https://discourse.paraview.org/u/CapLek)
#### Post date: [May 12, 2022, 11:17am UTC](https://discourse.paraview.org/t/highlight-mesh-in-paraview/9616/1 "2022-05-12T11:17:50Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 12, 2022, 11:53am UTC](https://discourse.paraview.org/t/highlight-mesh-in-paraview/9616/2 "2022-05-12T11:53:01Z")

</div>

Hi @CapLek ,

SelectCells() should do the trick.

Best,

---

<div class="post-metadata">

### Author: ![CapLek](https://discourse.paraview.org/user_avatar/discourse.paraview.org/caplek/32/3430_2.png) [@CapLek](https://discourse.paraview.org/u/CapLek)
#### Post date: [May 13, 2022, 2:31pm UTC](https://discourse.paraview.org/t/highlight-mesh-in-paraview/9616/3 "2022-05-13T14:31:32Z")

</div>

Hi Mathieu,

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

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 13, 2022, 5:00pm UTC](https://discourse.paraview.org/t/highlight-mesh-in-paraview/9616/4 "2022-05-13T17:00:54Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![CapLek](https://discourse.paraview.org/user_avatar/discourse.paraview.org/caplek/32/3430_2.png) [@CapLek](https://discourse.paraview.org/u/CapLek)
#### Post date: [May 16, 2022, 9:27am UTC](https://discourse.paraview.org/t/highlight-mesh-in-paraview/9616/5 "2022-05-16T09:27:34Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 16, 2022, 9:44am UTC](https://discourse.paraview.org/t/highlight-mesh-in-paraview/9616/6 "2022-05-16T09:44:08Z")

</div>

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](https://kitware.github.io/paraview-docs/latest/python/paraview.simple.html?highlight=selectcells#paraview.simple.SelectCells)

Example usage here:

> [@paraview.simple.SelectCells sellect multiple cell](https://discourse.paraview.org/t/paraview-simple-selectcells-sellect-multiple-cell/4153/2):
>
> The following should work: # create a query selection paraview.simple.QuerySelect(QueryString='((id == 1) | (id == 2) | (id == 3))', FieldType='CELL') The easiest way to figure this out is to use the Python tracing capabilities: Tools \> Start Trace, check Show Incremental Trace in the Trace Options dialog, and then use the Find Data dialog to do the query.

---

<div class="post-metadata">

### Author: ![CapLek](https://discourse.paraview.org/user_avatar/discourse.paraview.org/caplek/32/3430_2.png) [@CapLek](https://discourse.paraview.org/u/CapLek)
#### Post date: [May 16, 2022, 10:13am UTC](https://discourse.paraview.org/t/highlight-mesh-in-paraview/9616/7 "2022-05-16T10:13:55Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 16, 2022, 11:03am UTC](https://discourse.paraview.org/t/highlight-mesh-in-paraview/9616/8 "2022-05-16T11:03:26Z")

</div>

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

---

<div class="post-metadata">

### Author: ![CapLek](https://discourse.paraview.org/user_avatar/discourse.paraview.org/caplek/32/3430_2.png) [@CapLek](https://discourse.paraview.org/u/CapLek)
#### Post date: [May 16, 2022, 11:32am UTC](https://discourse.paraview.org/t/highlight-mesh-in-paraview/9616/9 "2022-05-16T11:32:17Z")

</div>

I want to highlight geometry which I’ve just clicked on using paraviewweb in server-side rendering mode to let user know that this geometry has been selected.

My current approach was to get the proxy object which was clicked by calling  
**activeView.SelectSurfaceCells([x,y,x,y], representations, sources, 0)** as it’s done internally in view.Pick() method.  
Then I’d like to use target proxy to select all its cells by using  
**simple.SelectCells(proxy=sources.GetItemAsObject(0))**

Is there any other way to highlight clicked geometry?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 16, 2022, 11:38am UTC](https://discourse.paraview.org/t/highlight-mesh-in-paraview/9616/10 "2022-05-16T11:38:28Z")

</div>

Sounds like a web question then.
