# How can I Get All Available Viewport Types?

**URL:** <https://forum.dynamobim.com/t/how-can-i-get-all-available-viewport-types/84917>\
**Category:** Revit\
**Created:** [January 12, 2023, 6:30pm UTC](https://forum.dynamobim.com/t/how-can-i-get-all-available-viewport-types/84917 "2023-01-12T18:30:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![a.corriveau](https://avatars.discourse-cdn.com/v4/letter/a/f4b2a3/32.png) [@a.corriveau](https://forum.dynamobim.com/u/a.corriveau)\
**Post date:** [January 12, 2023, 6:30pm UTC](https://forum.dynamobim.com/t/how-can-i-get-all-available-viewport-types/84917/1 "2023-01-12T18:30:28Z")

</div>

I am trying to change a viewport to a type that exists in the model but there is not a viewport with the desired type placed.

How can I get a list of the available/loaded viewport types?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![Mark.Ackerley](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mark.ackerley/32/79310_2.png) [@Mark.Ackerley](https://forum.dynamobim.com/u/Mark.Ackerley)\
**Post date:** [January 12, 2023, 8:26pm UTC](https://forum.dynamobim.com/t/how-can-i-get-all-available-viewport-types/84917/2 "2023-01-12T20:26:47Z")

</div>

Hey,

Filtered Element Collectors are my goto for unplaced things, not the most elegant, but something like this…

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/a/2a9a0851d169065811118f5454d11d2067d166f3.png)

```auto
import clr

#Import the Revit API
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *

#Import DocumentManager and TransactionManager
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

#Reference the active Document and application
doc = DocumentManager.Instance.CurrentDBDocument

fec = FilteredElementCollector(doc).OfClass(ElementType).ToElements()

output = []
for vFT in fec:
    if vFT.FamilyName == "Viewport":
        output.append(vFT)
        
OUT = output

```

Thanks to @SeanP

Hope that helps,

Mark

---

<div class="post-metadata">

**Author:** ![a.corriveau](https://avatars.discourse-cdn.com/v4/letter/a/f4b2a3/32.png) [@a.corriveau](https://forum.dynamobim.com/u/a.corriveau)\
**Post date:** [January 19, 2023, 3:21am UTC](https://forum.dynamobim.com/t/how-can-i-get-all-available-viewport-types/84917/3 "2023-01-19T03:21:36Z")

</div>

Thanks,  
I’m not really familiar with Python yet, I’m just starting to take a class.  
I will inspect and try this coding.

Thank you again for your help!

---

<div class="post-metadata">

**Author:** ![sovitek](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/sovitek/32/116237_2.png) [@sovitek](https://forum.dynamobim.com/u/sovitek)\
**Post date:** [January 19, 2023, 6:53am UTC](https://forum.dynamobim.com/t/how-can-i-get-all-available-viewport-types/84917/4 "2023-01-19T06:53:25Z")

</div>

Hello @a.corriveau …archilab have a node as well…

 ![Capture](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/5/155a76b8439ce74c987c7c65dc3831e3236b912d.png)

---

<div class="post-metadata">

**Author:** ![Alien](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alien/32/40701_2.png) [@Alien](https://forum.dynamobim.com/u/Alien)\
**Post date:** [April 4, 2024, 3:10pm UTC](https://forum.dynamobim.com/t/how-can-i-get-all-available-viewport-types/84917/5 "2024-04-04T15:10:10Z")

</div>

Beautiful… I’ve just spent the last half hour wondering why mine wasn’t working… I’d tried this:

collector = FilteredElementCollector(doc).OfClass(Viewport).WhereElementIsElementType()

And it wasn’t giving me any errors (just a blank list)… Now I can see why 😃
