# Opening multiple Views

**URL:** <https://forum.dynamobim.com/t/opening-multiple-views/57018>\
**Category:** Share\
**Tags:** revit, python\
**Created:** [November 8, 2020, 12:34pm UTC](https://forum.dynamobim.com/t/opening-multiple-views/57018 "2020-11-08T12:34:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![c.poupin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/c.poupin/32/89152_2.png) [@c.poupin](https://forum.dynamobim.com/u/c.poupin)\
**Post date:** [November 8, 2020, 12:34pm UTC](https://forum.dynamobim.com/t/opening-multiple-views/57018/1 "2020-11-08T12:34:12Z")

</div>

Hello,  
I’m sharing a workaround for opening several Views with Revit API and Winform.  
The Python script (IronPython) must be placed at the end of the chain and accepts a list of views as input.

an example with a duplication of views

[![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/6/360f28f31bfe8b79d026e83feaa669c2d742efa3.jpeg "Open Multiple Views with Dynamo") ](https://www.youtube.com/watch?v=e2L7FRo5Sgg)

more explanations [here](https://voltadynabim.blogspot.com/2020/11/dynamo-python-ouvrir-plusieurs-vues.html)

```
#written by Cyril P
import clr
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
import Autodesk.Revit.DB as DB

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
uidoc = uiapp.ActiveUIDocument

clr.AddReference('System.Drawing')
clr.AddReference('System.Windows.Forms')
import System.Drawing
import System.Windows.Forms

from System.Drawing import *
from System.Windows.Forms import *

class MainForm(Form):
	def __init__ (self, listView, uidoc):
		self._dictView = {x.Name : x for x in listView}
		self._uidoc = uidoc
		self.InitializeComponent()
		self.CheckPreselect()
	
	def InitializeComponent(self):
		self._checkedListBox1 = System.Windows.Forms.CheckedListBox()
		self._buttonOpen = System.Windows.Forms.Button()
		self.SuspendLayout()
		# 
		# checkedListBox1
		self._checkedListBox1.FormattingEnabled = True
		self._checkedListBox1.Items.AddRange(System.Array[System.Object](self._dictView.keys()))
		self._checkedListBox1.Location = System.Drawing.Point(24, 27)
		self._checkedListBox1.Name = "checkedListBox1"
		self._checkedListBox1.Size = System.Drawing.Size(340, 440)
		self._checkedListBox1.TabIndex = 0
		# 
		# buttonOpen
		self._buttonOpen.Location = System.Drawing.Point(24, 480)
		self._buttonOpen.Name = "buttonOpen"
		self._buttonOpen.Size = System.Drawing.Size(234, 53)
		self._buttonOpen.TabIndex = 1
		self._buttonOpen.Text = "Opens Select Views"
		self._buttonOpen.UseVisualStyleBackColor = True
		self._buttonOpen.Click += self.ButtonOpenClick
		# 
		# MainForm
		self.ClientSize = System.Drawing.Size(400, 550)
		self.Controls.Add(self._buttonOpen)
		self.Controls.Add(self._checkedListBox1)
		self.Name = "MainForm"
		self.Text = "UI_OpenMulti"
		self.ResumeLayout(False)

	def CheckPreselect(self):
		for i in range(self._checkedListBox1.Items.Count):
			self._checkedListBox1.SetItemChecked(i, True)
	
	def ButtonOpenClick(self, sender, e):
		for viewName in self._checkedListBox1.CheckedItems :
			view = self._dictView.get(viewName)
			self._uidoc.ActiveView = view
		self.Close()		
	
lstView = UnwrapElement(IN[0])	
objForm = MainForm(lstView, uidoc)
objForm.Show()

OUT = 0

```

---

<div class="post-metadata">

**Author:** ![paris](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/paris/32/144289_2.png) [@paris](https://forum.dynamobim.com/u/paris)\
**Post date:** [November 8, 2020, 6:18pm UTC](https://forum.dynamobim.com/t/opening-multiple-views/57018/2 "2020-11-08T18:18:11Z")

</div>

Hello @c.poupin  
thank you very much, amazing python node and great work !  
Cheers

---

<div class="post-metadata">

**Author:** ![StephenDini](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/stephendini/32/127724_2.png) [@StephenDini](https://forum.dynamobim.com/u/StephenDini)\
**Post date:** [February 10, 2022, 11:23pm UTC](https://forum.dynamobim.com/t/opening-multiple-views/57018/3 "2022-02-10T23:23:44Z")

</div>

This python node works very well with any list of views it seems.The only issue I found was that it was displaying an unorganized list to select from. In the use case above this would not mater as much since these are duplicates. In my situation I needed them organized so I can track my place better.

If you would like to have the list organized by dictionary key add this after the comment on line 41.

```python
self.dictkeys = []
for i in sorted (self._dictView.keys()) :
		self.dictkeys.append(i)

```

---

<div class="post-metadata">

**Author:** ![m.shaheenF8NKN](https://avatars.discourse-cdn.com/v4/letter/m/3e96dc/32.png) [@m.shaheenF8NKN](https://forum.dynamobim.com/u/m.shaheenF8NKN)\
**Post date:** [June 13, 2025, 11:24am UTC](https://forum.dynamobim.com/t/opening-multiple-views/57018/4 "2025-06-13T11:24:36Z")

</div>

> [@c.poupin](#):
>
> ```auto
> erence('RevitNodes')
> import Rev
> 
> ```

Thank you so much for the script and working perfectly
