# ParaviewWeb selection error

**URL:** https://discourse.paraview.org/t/paraviewweb-selection-error/6733
**Category:** ParaView Support
**Created:** [March 18, 2021, 9:06am UTC](https://discourse.paraview.org/t/paraviewweb-selection-error/6733 "2021-03-18T09:06:27Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![jone](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jone/32/9307_2.png) [@jone](https://discourse.paraview.org/u/jone)
#### Post date: [March 18, 2021, 9:06am UTC](https://discourse.paraview.org/t/paraviewweb-selection-error/6733/1 "2021-03-18T09:06:27Z")

</div>

I want to pick a cell on the client side.First, I get the position of the mouse click on the canvas, using the following methods:

> var rect = canvas.getBoundingClientRect();  
> var x= event.clientX - rect.left \* (canvas.width / rect.width);  
> var y= event.clientY - rect.top \* (canvas.height / rect.height);

Then call the server-side protocol:

> ```
> @exportRPC("pvwsdprotocol.pick.point")
> def pickCone(self, positionx, positiony):
> selection.SelectSurfaceCells(Rectangle=[positionx,positiony,positionx,positiony])
> self.getApplication().InvokeEvent('UpdateEvent')
> 
> ```

But the results are not precise. Does the canvas position contradict the SelectSurfaceCells parameter requirement? Thank you for you help in advance!

---

<div class="post-metadata">

### Author: ![jourdain](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jourdain/32/11_2.png) [@jourdain](https://discourse.paraview.org/u/jourdain)
#### Post date: [March 18, 2021, 5:26pm UTC](https://discourse.paraview.org/t/paraviewweb-selection-error/6733/2 "2021-03-18T17:26:55Z")

</div>

I think your issue is related to the fact that Y needs to be swap. (y=0 =\> bottom)

---

<div class="post-metadata">

### Author: ![jone](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jone/32/9307_2.png) [@jone](https://discourse.paraview.org/u/jone)
#### Post date: [March 19, 2021, 1:21am UTC](https://discourse.paraview.org/t/paraviewweb-selection-error/6733/3 "2021-03-19T01:21:40Z")

</div>

After the modification, it really works!  
I want to ask, is there a way to select the whole object?Just like the PropPicker in VTK. Thanks again for your guidance!

---

<div class="post-metadata">

### Author: ![jourdain](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jourdain/32/11_2.png) [@jourdain](https://discourse.paraview.org/u/jourdain)
#### Post date: [March 22, 2021, 9:13pm UTC](https://discourse.paraview.org/t/paraviewweb-selection-error/6733/4 "2021-03-22T21:13:03Z")

</div>

I would think so, just need to pick the right selection object.

---

<div class="post-metadata">

### Author: ![jone](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jone/32/9307_2.png) [@jone](https://discourse.paraview.org/u/jone)
#### Post date: [March 23, 2021, 12:29am UTC](https://discourse.paraview.org/t/paraviewweb-selection-error/6733/5 "2021-03-23T00:29:29Z")

</div>

But I’ve only found a way to select point and cell, and maybe map from there to the whole object, right?

---

<div class="post-metadata">

### Author: ![jourdain](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jourdain/32/11_2.png) [@jourdain](https://discourse.paraview.org/u/jourdain)
#### Post date: [March 23, 2021, 3:16pm UTC](https://discourse.paraview.org/t/paraviewweb-selection-error/6733/6 "2021-03-23T15:16:31Z")

</div>

You should ask on the main ParaView topic “How to perform actor/block selection from Python?”.  
I know that is possible but I will have to dig into the code to see how to do it as I don’t know it on top of my head.
