# How to set the default value for representation?

**URL:** https://discourse.paraview.org/t/how-to-set-the-default-value-for-representation/1834
**Category:** Development
**Created:** [May 12, 2019, 2:43am UTC](https://discourse.paraview.org/t/how-to-set-the-default-value-for-representation/1834 "2019-05-12T02:43:51Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![caobaolu](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/e274bd/32.png) [@caobaolu](https://discourse.paraview.org/u/caobaolu)
#### Post date: [May 12, 2019, 2:43am UTC](https://discourse.paraview.org/t/how-to-set-the-default-value-for-representation/1834/1 "2019-05-12T02:43:51Z")

</div>

Dear all,  
I am trying to change the default value of the representation through adding a plugin.  
for example, i want to change the default line width from 1 to 4, how can i acheive this?  
I tried to change the xml settings below, but paraview crashed when I was loading the data.

```
<DoubleVectorProperty name="LineWidth"
                            command="SetLineWidth"
                            default_values="4"
                            number_of_elements="1">
<DoubleRangeDomain min="1"
                           name="range" />
</DoubleVectorProperty>

```

Any help would be appreciated~

---

<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, 2019, 1:22pm UTC](https://discourse.paraview.org/t/how-to-set-the-default-value-for-representation/1834/2 "2019-05-13T13:22:09Z")

</div>

This is not really supported, as the Representation xml system is quite complex.

You should be able to create your own complete representation xml and add it to ParaView as a plugin.

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [May 13, 2019, 1:44pm UTC](https://discourse.paraview.org/t/how-to-set-the-default-value-for-representation/1834/3 "2019-05-13T13:44:27Z")

</div>

There is another mechanism to change defaults in a custom application. Take a look at how TomViz changes some RenderView defaults here: [https://github.com/OpenChemistry/tomviz/blob/60b1e8bccfcb926b6f86388754f6396ebe8ff2f7/tomviz/Behaviors.cxx](https://github.com/OpenChemistry/tomviz/blob/60b1e8bccfcb926b6f86388754f6396ebe8ff2f7/tomviz/Behaviors.cxx)

To see what JSON you should have in your settings string, you can create a test geometry in ParaView, change the line width in the representation to 4, click the little floppy disk icon to the right of the **Display (GeometryRepresentation)**, and take a look at `~/.config/ParaView/ParaView-UserSettings.json`. This is what is should look like:

```json
{
        "representations" : 
        {
                "GeometryRepresentation" : 
                {
                        "LineWidth" : 4.0,
                }
        }
}

```

---

<div class="post-metadata">

### Author: ![caobaolu](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/e274bd/32.png) [@caobaolu](https://discourse.paraview.org/u/caobaolu)
#### Post date: [May 18, 2019, 3:16am UTC](https://discourse.paraview.org/t/how-to-set-the-default-value-for-representation/1834/4 "2019-05-18T03:16:22Z")

</div>

Hi,  
Thanks for your reply~ I create my own representation as a plugin, and the line width appears to be my setting value, howevery the value displayed on the pannel is still “1” instead of my setting value which is correctly shown on the viewer.  
Any idea why this is happening? Thank you~
