# Scripting: Can I get a list of selected Named Views?

**URL:** <https://discourse.mcneel.com/t/scripting-can-i-get-a-list-of-selected-named-views/208561>\
**Category:** Rhino Developer\
**Tags:** windows, rhinocommon\
**Created:** [August 16, 2025, 10:13am UTC](https://discourse.mcneel.com/t/scripting-can-i-get-a-list-of-selected-named-views/208561 "2025-08-16T10:13:25Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Holo](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/holo/32/496872_2.png) [@Holo](https://discourse.mcneel.com/u/Holo)\
**Post date:** [August 16, 2025, 10:13am UTC](https://discourse.mcneel.com/t/scripting-can-i-get-a-list-of-selected-named-views/208561/1 "2025-08-16T10:13:25Z")

</div>

Hi, is there a way in Rhino 8 where I can figure out what named views are selected in the Named Views panel?

I am working on a small render script and this would be a cool way to choose frames from.

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/4/b/5/4b5617b498d012a5cb3561f89628bb921c11d99c.png)

I found this thread from 2019 that says it isn’t possible, but has anything changed in UI accessibility since then @dale ?

> [@Get selected named views](https://discourse.mcneel.com/t/get-selected-named-views/81669/2):
>
> Hi @maito78, There isn’t any way of accessing the panel’s selected named view - sorry. – Dale

---

<div class="post-metadata">

**Author:** ![clement](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/clement/32/772979_2.png) [@clement](https://discourse.mcneel.com/u/clement)\
**Post date:** [August 17, 2025, 8:31pm UTC](https://discourse.mcneel.com/t/scripting-can-i-get-a-list-of-selected-named-views/208561/2 "2025-08-17T20:31:10Z")

</div>

Hi @Holo, since Rhino 8.5 you can do this:

```python
#! python 2
import scriptcontext

def DoSomething():
    
    view_names = scriptcontext.doc.NamedViews.Selection
    if not view_names: return
    
    for view_name in view_names:
        view_index = scriptcontext.doc.NamedViews.FindByName(view_name)
        view_info = scriptcontext.doc.NamedViews.Item[view_index]
        
        print "ViewName: {} >>> view_info: {}".format(view_name, view_info)
    
DoSomething()

```

From `view_info` you can get all kinds of things eg. `view_info.Viewport`

\_

c

---

<div class="post-metadata">

**Author:** ![Holo](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/holo/32/496872_2.png) [@Holo](https://discourse.mcneel.com/u/Holo)\
**Post date:** [August 18, 2025, 9:37am UTC](https://discourse.mcneel.com/t/scripting-can-i-get-a-list-of-selected-named-views/208561/3 "2025-08-18T09:37:09Z")

</div>

Thanks, this is really helpful, but do you know why this works in Rhino Python Editor but not in Script Editor? I need it to work with Python 3 to be able to manipulate the bitmaps properly.

@eirannejad maybe this is a question for you?

 ![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/8/6/3/8635424bc41afea16006c39f78051b471ff1f724.png)

---

<div class="post-metadata">

**Author:** ![clement](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/clement/32/772979_2.png) [@clement](https://discourse.mcneel.com/u/clement)\
**Post date:** [August 18, 2025, 6:20pm UTC](https://discourse.mcneel.com/t/scripting-can-i-get-a-list-of-selected-named-views/208561/4 "2025-08-18T18:20:02Z")

</div>

Hi @Holo , below seems to work with Python 3 in the new script editor:

```auto
#! python 3
import scriptcontext

def DoSomething():
    
    view_names = scriptcontext.doc.NamedViews.Selection
    if not view_names: return
    
    for view_name in view_names:
        view_index = scriptcontext.doc.NamedViews.FindByName(view_name)
        view_info = scriptcontext.doc.NamedViews[view_index]
        
        print("ViewName: {} >>> view_info: {}".format(view_name, view_info))
    
DoSomething()

```

I have no idea why `NamedViews.Item` does not exits for the new editor.

\_

c.

---

<div class="post-metadata">

**Author:** ![Holo](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/holo/32/496872_2.png) [@Holo](https://discourse.mcneel.com/u/Holo)\
**Post date:** [August 18, 2025, 7:48pm UTC](https://discourse.mcneel.com/t/scripting-can-i-get-a-list-of-selected-named-views/208561/5 "2025-08-18T19:48:09Z")

</div>

Amazing, how did you figure that out? Trail and error? Thank you though!

And I find it strange that it works in one editor and not the other, since both import the same scriptcontext library, don’t they?

---

<div class="post-metadata">

**Author:** ![clement](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/clement/32/772979_2.png) [@clement](https://discourse.mcneel.com/u/clement)\
**Post date:** [August 18, 2025, 8:04pm UTC](https://discourse.mcneel.com/t/scripting-can-i-get-a-list-of-selected-named-views/208561/6 "2025-08-18T20:04:49Z")

</div>

> [@Holo](#):
>
> Amazing, how did you figure that out?

Hi @Holo, i just thought that if the `NamedViews.Item` cannot be accessed then it might work as expected using the default indexer. Fun part is that the second code example also works in the old editor. I hope @eirannejad can explain to us the difference.

\_

c.

---

<div class="post-metadata">

**Author:** ![martinsiegrist](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/martinsiegrist/32/772775_2.png) [@martinsiegrist](https://discourse.mcneel.com/u/martinsiegrist)\
**Post date:** [August 18, 2025, 8:16pm UTC](https://discourse.mcneel.com/t/scripting-can-i-get-a-list-of-selected-named-views/208561/7 "2025-08-18T20:16:35Z")

</div>

![image](https://global.discourse-cdn.com/mcneel/uploads/default/original/4X/9/a/1/9a1705ff078003f1f1f8ca48519615fbeb9601b8.png)

---

<div class="post-metadata">

**Author:** ![Holo](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/holo/32/496872_2.png) [@Holo](https://discourse.mcneel.com/u/Holo)\
**Post date:** [August 18, 2025, 8:23pm UTC](https://discourse.mcneel.com/t/scripting-can-i-get-a-list-of-selected-named-views/208561/8 "2025-08-18T20:23:17Z")

</div>

Hi Martin, I don’t understand what you try to show here, can you please explain?

---

<div class="post-metadata">

**Author:** ![martinsiegrist](https://sea3.discourse-cdn.com/mcneel/user_avatar/discourse.mcneel.com/martinsiegrist/32/772775_2.png) [@martinsiegrist](https://discourse.mcneel.com/u/martinsiegrist)\
**Post date:** [August 18, 2025, 8:28pm UTC](https://discourse.mcneel.com/t/scripting-can-i-get-a-list-of-selected-named-views/208561/9 "2025-08-18T20:28:04Z")

</div>

Nothing special. Cool that it also works in Grasshopper.
