Filter view templates by view template type

Hi there,

I was wondering if anyone knew if it was possible to sort/group view templates by their relevant subheading within the view templates dialogue box within Revit as pictured below:
image

Obviously it is an easy exercise simply getting all the view templates but cant seem to find how they are subcategorised beyond that…

Any help is appreciated.

Bumping

You would have to use the Revit API to get the ViewType.

2 Likes

Ahhh of course because view templates are also a view they will still have that property. Didn’t think that. Cheers!

Code below for anyone who might stumble across this.

# Load the Python Standard and DesignScript Libraries
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import*

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

doc = DocumentManager.Instance.CurrentDBDocument

views = FilteredElementCollector(doc).OfClass(View)
appliedtempates = [v.ViewTemplateId for v in views]
templates = [v for v in views if v.IsTemplate == True]
ele_tplates = [t for t in templates if t.ViewType == ViewType.Elevation]

OUT = ele_tplates
1 Like