# After Paraview imports the pvsm file, the model order changes.

**URL:** https://discourse.paraview.org/t/after-paraview-imports-the-pvsm-file-the-model-order-changes/2052
**Category:** ParaView Support
**Created:** [June 15, 2019, 7:31am UTC](https://discourse.paraview.org/t/after-paraview-imports-the-pvsm-file-the-model-order-changes/2052 "2019-06-15T07:31:17Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![RisingYoung](https://discourse.paraview.org/user_avatar/discourse.paraview.org/risingyoung/32/1612_2.png) [@RisingYoung](https://discourse.paraview.org/u/RisingYoung)
#### Post date: [June 15, 2019, 7:31am UTC](https://discourse.paraview.org/t/after-paraview-imports-the-pvsm-file-the-model-order-changes/2052/1 "2019-06-15T07:31:17Z")

</div>

Hi all,  
**Steps:**  
Open multiple models in ParaView, the order of models as below:  
 ![Snipaste_2019-06-15_14-58-21_bf](https://discourse.paraview.org/uploads/default/original/2X/1/1592e8638a2a6ec74cc757f275681748254dcef3.png)

Click Save state in file menu, we got a pvsm file.

Startup another Paraview, and loading the pvsm file created in previous step.  
It is obviously that the order of models is different, as below:  
 ![Snipaste_2019-06-15_14-57-55_af](https://discourse.paraview.org/uploads/default/original/2X/9/907cc2352fdff9ad2c7ab358a764f9d86b14f758.png)

**problem:**  
How to keep the order of models in pipeline browser after load the pvsm file?

**My environment is as follows:**  
ParaView version: 5.5.2(64 bit)  
Qt version: 5.9.6  
CMake version: 3.13.0  
Compiler: VS2015

---

<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: [June 17, 2019, 9:22am UTC](https://discourse.paraview.org/t/after-paraview-imports-the-pvsm-file-the-model-order-changes/2052/2 "2019-06-17T09:22:40Z")

</div>

Not possible currently, can you explain why do you need to keep this ordered ?

---

<div class="post-metadata">

### Author: ![RisingYoung](https://discourse.paraview.org/user_avatar/discourse.paraview.org/risingyoung/32/1612_2.png) [@RisingYoung](https://discourse.paraview.org/u/RisingYoung)
#### Post date: [June 20, 2019, 6:23am UTC](https://discourse.paraview.org/t/after-paraview-imports-the-pvsm-file-the-model-order-changes/2052/3 "2019-06-20T06:23:13Z")

</div>

The usage scenario is as follows:  
there is a main model (such as Sphere1), other models (such as Sphere2) will be attached to Sphere1, and attributes such as radius and color will be associated with Sphere1, so when creating, you need to ensure that Sphere1 already exists.  
However, since the pvsm order is random, there is a problem.

---

<div class="post-metadata">

### Author: ![Kenneth\_Moreland](https://discourse.paraview.org/user_avatar/discourse.paraview.org/kenneth_moreland/32/15033_2.png) [@Kenneth\_Moreland](https://discourse.paraview.org/u/Kenneth_Moreland)
#### Post date: [June 20, 2019, 9:03am UTC](https://discourse.paraview.org/t/after-paraview-imports-the-pvsm-file-the-model-order-changes/2052/4 "2019-06-20T09:03:02Z")

</div>

One thing you can try is saving your state file as a python script instead of a pvsm file. This can be done by selecting to write out a py file instead of a pvsm file in the `Save State` feature. Because this will generate a script that executes commands to get back to your state, you have control in the order that things happen by modifying the script if necessary.

---

<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: [June 20, 2019, 9:10am UTC](https://discourse.paraview.org/t/after-paraview-imports-the-pvsm-file-the-model-order-changes/2052/5 "2019-06-20T09:10:34Z")

</div>

> [@RisingYoung](#):
>
> attributes such as radius and color will be associated with Sphere1

What do you mean by that ? PropertyLink ?

---

<div class="post-metadata">

### Author: ![RisingYoung](https://discourse.paraview.org/user_avatar/discourse.paraview.org/risingyoung/32/1612_2.png) [@RisingYoung](https://discourse.paraview.org/u/RisingYoung)
#### Post date: [June 20, 2019, 11:50am UTC](https://discourse.paraview.org/t/after-paraview-imports-the-pvsm-file-the-model-order-changes/2052/6 "2019-06-20T11:50:35Z")

</div>

For example, when creating Sphere2, the radius of Sphere2 must be 10% of the main model Sphere1, but if Sphere1 does not exist, the radius of Sphere2 cannot be calculated, resulting in an exception.

---

<div class="post-metadata">

### Author: ![RisingYoung](https://discourse.paraview.org/user_avatar/discourse.paraview.org/risingyoung/32/1612_2.png) [@RisingYoung](https://discourse.paraview.org/u/RisingYoung)
#### Post date: [June 20, 2019, 11:53am UTC](https://discourse.paraview.org/t/after-paraview-imports-the-pvsm-file-the-model-order-changes/2052/7 "2019-06-20T11:53:56Z")

</div>

I will verify this method, thank you very much!

---

<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: [June 20, 2019, 1:58pm UTC](https://discourse.paraview.org/t/after-paraview-imports-the-pvsm-file-the-model-order-changes/2052/8 "2019-06-20T13:58:40Z")

</div>

> [@RisingYoung](#):
>
> For example, when creating Sphere2, the radius of Sphere2 must be 10% of the main model Sphere1, but if Sphere1 does not exist, the radius of Sphere2 cannot be calculated, resulting in an exception.

How do you define the radius of Sphere2 as a percentage of Sphere1 currently? The only way I can think of is through Python scripting, as @Kenneth_Moreland mentioned. There is no mechanism to set one property as a function of another that I know of in the ParaView UI.
