# Paraview Lite change default representation

**URL:** https://discourse.paraview.org/t/paraview-lite-change-default-representation/6354
**Category:** ParaView Support
**Created:** [February 1, 2021, 8:05am UTC](https://discourse.paraview.org/t/paraview-lite-change-default-representation/6354 "2021-02-01T08:05:22Z")
**Posts on this page:** 6
**Page:** 2

<div class="post-metadata">

### Author: ![Francesc\_Costa](https://discourse.paraview.org/user_avatar/discourse.paraview.org/francesc_costa/32/5142_2.png) [@Francesc\_Costa](https://discourse.paraview.org/u/Francesc_Costa)
#### Post date: [February 4, 2021, 6:30pm UTC](https://discourse.paraview.org/t/paraview-lite-change-default-representation/6354/21 "2021-02-04T18:30:24Z")

</div>

I have just tried with Linux with no luck

---

<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: [February 4, 2021, 6:32pm UTC](https://discourse.paraview.org/t/paraview-lite-change-default-representation/6354/22 "2021-02-04T18:32:53Z")

</div>

I think I know why… You’ve loaded a file, not created a source. I did not patch the file loading… Just any proxy creation.

Try to create a “Cone”.

---

<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: [February 4, 2021, 6:34pm UTC](https://discourse.paraview.org/t/paraview-lite-change-default-representation/6354/23 "2021-02-04T18:34:50Z")

</div>

If you want to do it at file loading, that will be the method to override as well [https://github.com/Kitware/ParaView/blob/master/Web/Python/paraview/web/protocols.py#L2808-L2809](https://github.com/Kitware/ParaView/blob/master/Web/Python/paraview/web/protocols.py#L2808-L2809)

---

<div class="post-metadata">

### Author: ![Francesc\_Costa](https://discourse.paraview.org/user_avatar/discourse.paraview.org/francesc_costa/32/5142_2.png) [@Francesc\_Costa](https://discourse.paraview.org/u/Francesc_Costa)
#### Post date: [February 5, 2021, 8:18am UTC](https://discourse.paraview.org/t/paraview-lite-change-default-representation/6354/24 "2021-02-05T08:18:22Z")

</div>

Hi Sebastien,

We are hitting the right key now.

I got a trace in this overloaded pv.proxy.manager.create.reader

however I got an error when trying to call the original code:

@exportRpc(“pv.proxy.manager.create.reader”)

```
def customOpen(self, relativePath):

    """

    Open relative file paths, attempting to use the file extension to select

    from the configured readers.

    """

    print('custom open')

    response = self.pxm.reader(relativePath)
    #response = self.pxm.create.reader(relativePath)

    rep = simple.Show()

    rep.Representation = 'Surface With Edges'

    self.getApplication().InvokeEvent('UpdateEvent')

    return response

```

both attemps fail with:

ParaView Lite: not available  
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36

```auto
{
  "code": -32001,
  "message": "Exception raised",
  "data": {
    "method": "pv.proxy.manager.create.reader",
    "exception": "AttributeError(\"'ParaViewWebProxyManager' object has no attribute 'reader'\")",
    "trace": "Traceback (most recent call last):\n File \"C:\\ParaView-5.8.1-Windows-Python3.7-msvc2015-64bit\\bin\\Lib\\site-packages\\wslink\\websocket.py\", line 370, in onMessage\n results = func(obj, *args, **kwargs)\n File \"C:\\projects_web\\evoker\\client\\server\\lite_protocols.py\", line 69, in customOpen\n response = self.pxm.reader(relativePath)\nAttributeError: 'ParaViewWebProxyManager' object has no attribute 'reader'\n"
  }
}

How do I properly call the original code?

Thanks,

Francesc
```

---

<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: [February 5, 2021, 3:27pm UTC](https://discourse.paraview.org/t/paraview-lite-change-default-representation/6354/25 "2021-02-05T15:27:50Z")

</div>

The method name is `open` so you should use that name.

```auto
response = self.pxm.open(relativePath)

```

It was given to you in my previous [link](https://github.com/Kitware/ParaView/blob/master/Web/Python/paraview/web/protocols.py#L2808-L2809)

---

<div class="post-metadata">

### Author: ![Francesc\_Costa](https://discourse.paraview.org/user_avatar/discourse.paraview.org/francesc_costa/32/5142_2.png) [@Francesc\_Costa](https://discourse.paraview.org/u/Francesc_Costa)
#### Post date: [February 5, 2021, 3:43pm UTC](https://discourse.paraview.org/t/paraview-lite-change-default-representation/6354/26 "2021-02-05T15:43:00Z")

</div>

Works like a charm!!!

Thank you Sebastien!

![image](https://discourse.paraview.org/uploads/default/original/2X/e/e28599c09d29a20ddf882c64387741ecf28e1601.png)

[Previous page](https://discourse.paraview.org/t/paraview-lite-change-default-representation/6354.md?page=1)
