# Multiple Source Selection

**URL:** https://discourse.paraview.org/t/multiple-source-selection/5509
**Category:** ParaView Support
**Created:** [October 6, 2020, 7:00pm UTC](https://discourse.paraview.org/t/multiple-source-selection/5509 "2020-10-06T19:00:04Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![theodorebaltis](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/t/e480ec/32.png) [@theodorebaltis](https://discourse.paraview.org/u/theodorebaltis)
#### Post date: [October 6, 2020, 7:00pm UTC](https://discourse.paraview.org/t/multiple-source-selection/5509/1 "2020-10-06T19:00:04Z")

</div>

Is there a way to retrieve multiple pipeline selections through the `paraview.simple` module?

I’ve seen documentation online that says this is not possible, but it must be at least somewhat supported under the hood for use with filters like `Append Attributes` right?

I ask because I would like to build a macro that uses multiple selections from the user. And, ideally, be able to tell the order of selection.

---

<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: [October 7, 2020, 8:30am UTC](https://discourse.paraview.org/t/multiple-source-selection/5509/2 "2020-10-07T08:30:25Z")

</div>

What do you mean by multiple pipeline selections ?

---

<div class="post-metadata">

### Author: ![lhofmann](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/l/9e8a1a/32.png) [@lhofmann](https://discourse.paraview.org/u/lhofmann)
#### Post date: [October 7, 2020, 11:01am UTC](https://discourse.paraview.org/t/multiple-source-selection/5509/3 "2020-10-07T11:01:00Z")

</div>

I have been using the following code to get a list of all selected sources (not sure if that’s the right way to do it):

```python
model = servermanager.ProxyManager(None).GetSelectionModel("ActiveSources")
proxies = [model.GetSelectedProxy(i) for i in range(model.GetNumberOfSelectedProxies())]
sources = [
  servermanager._getPyProxy(p) 
  if p.IsA("vtkSMSourceProxy") else
  servermanager.OutputPort(servermanager._getPyProxy(p.GetSourceProxy()), p.GetPortIndex())
  for p in proxies
]

```

---

<div class="post-metadata">

### Author: ![theodorebaltis](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/t/e480ec/32.png) [@theodorebaltis](https://discourse.paraview.org/u/theodorebaltis)
#### Post date: [October 7, 2020, 4:34pm UTC](https://discourse.paraview.org/t/multiple-source-selection/5509/4 "2020-10-07T16:34:02Z")

</div>

@mwestphal I mean when a user performs a typical multi-selection using CTRL or SHIFT modifiers in the Pipeline Browser.

But the code from @lhofmann gets me what I need. Thank you!  
The ProxySelectionModel is exactly what I needed. `GetSelectionModel` is one of those attributes/methods that doesn’t popup when autocompleting or using `dir()`
