# Help Creating Python Node that Outputs All Sheet Family in Revit Model

**URL:** <https://forum.dynamobim.com/t/help-creating-python-node-that-outputs-all-sheet-family-in-revit-model/43978>\
**Category:** Developers\
**Tags:** python\
**Created:** [December 3, 2019, 8:02pm UTC](https://forum.dynamobim.com/t/help-creating-python-node-that-outputs-all-sheet-family-in-revit-model/43978 "2019-12-03T20:02:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![PhillipA](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/phillipa/32/47744_2.png) [@PhillipA](https://forum.dynamobim.com/u/PhillipA)\
**Post date:** [December 3, 2019, 8:02pm UTC](https://forum.dynamobim.com/t/help-creating-python-node-that-outputs-all-sheet-family-in-revit-model/43978/1 "2019-12-03T20:02:05Z")

</div>

Hello,

I need help trying to create a Python script that will select all of the titleBlockFamilyTypes in my current Revit model so that the user may select the titleblock to be used in data-shapes drop down menu. The titleblock family type will then replace the “Select TitleBlock for Sheets” node used to create sheets in Revit. Thank you in advance for your help.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/b/6bb5d1fe834c96d4acc24abd86fe83a262d2898c.png)

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/d/bdf565070cee443d276c89146125bc8b2d6ea755.png)

```
import clr

# Import DocumentManager and TransactionManager
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Transactions import TransactionManager
from RevitServices.Persistence import DocumentManager
# Import RevitAPI
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *

doc = DocumentManager.Instance.CurrentDBDocument

# Import ToDSType(bool) extension method
clr.AddReference('RevitNodes')
import Revit
from Revit.Elements import *
clr.ImportExtensions(Revit.Elements)

titleblock_collector = FilteredElementCollector(doc) \
            .OfCategory(BuiltInCategory.OST_TitleBlocks)

titleblock_Families = 

OUT = titleblock_Families
```

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [December 3, 2019, 8:13pm UTC](https://forum.dynamobim.com/t/help-creating-python-node-that-outputs-all-sheet-family-in-revit-model/43978/2 "2019-12-03T20:13:30Z")

</div>

FYI, Clockwork has a node (All Family Types of Category) for this.

Your filter is pretty close. You’ll also want to filter by elements that are types.

---

<div class="post-metadata">

**Author:** ![PhillipA](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/phillipa/32/47744_2.png) [@PhillipA](https://forum.dynamobim.com/u/PhillipA)\
**Post date:** [December 3, 2019, 8:32pm UTC](https://forum.dynamobim.com/t/help-creating-python-node-that-outputs-all-sheet-family-in-revit-model/43978/3 "2019-12-03T20:32:52Z")

</div>

Thank you. The Clockwork node that you mentioned above does exactly what I am looking for.

---

<div class="post-metadata">

**Author:** ![aaronrumple](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/aaronrumple/32/195292_2.png) [@aaronrumple](https://forum.dynamobim.com/u/aaronrumple)\
**Post date:** [December 3, 2019, 10:33pm UTC](https://forum.dynamobim.com/t/help-creating-python-node-that-outputs-all-sheet-family-in-revit-model/43978/5 "2019-12-03T22:33:36Z")

</div>

Here’s code that outputs both family types and element instances…

```
import clr
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Transactions import TransactionManager
from RevitServices.Persistence import DocumentManager
# Import RevitAPI
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *

doc = DocumentManager.Instance.CurrentDBDocument

# Import ToDSType(bool) extension method
clr.AddReference('RevitNodes')
import Revit
from Revit.Elements import *
clr.ImportExtensions(Revit.Elements)

titleblockElements = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_TitleBlocks).WhereElementIsNotElementType().ToElements()
titleblockTypes = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_TitleBlocks).WhereElementIsElementType().ToElements()

OUT = titleblockElements, titleblockTypes
```
