View Family Types selection

Is there a way to select all views from a specific View Family Type. (not a view type or view family)
There is a Node to select one View Family Type but it appears that there is nothing I can do with it.
Anybody knows if there is nodes I can use along with this one ?

I would like to simply select all views from a specific View Family Type.
In Revit alone it is called View Type, as opposed to View Family.

image

image

1 Like

Does anybody know the answer to the original question in this thread? I think the answer above is not the answer. How do we get the views that belong to a specific view type (as shown in the original question).

Does this get you what you need?

#Sean Page, 2020
import clr

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

clr.AddReference('System')
from System.Collections.Generic import List

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

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

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

#Use a Collector and class to get the types
ViewFamTypes = FilteredElementCollector(doc).OfClass(ViewFamilyType).WhereElementIsElementType().ToElements()

OUT = ViewFamTypes

Hello, @SeanP , I am very grateful with you for trying to help me. However, I think this does not answer the original question, because the question is how to get the views that have a certain view type, but not a higher level view type such as Floor Plan or Ceiling Plan, but a view type of those main types. Notice on the image of the original question that the user has a type of floor plan that he has created, with the name “A100-FIRE PROTECTION PLAN” which is a custom type of floor plan. Then the user wants to isolate quickly the views that belong to that custom type of floor plan, to do something with those views. In my case I have several of those custom floor plans, and I want to add a different prefix to the view names, as per the name of the custom view type. So, as the OP, I thought the “ViewFamilyTypes” node would isolate those views for me, but that is not the case. The output of the node is just the type, not the views that are assigned to that type.

I believe this will get what you are asking for.

Or here is a consolidated version in Python:

#Sean Page, 2020
import clr

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

clr.AddReference('System')
from System.Collections.Generic import List

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

doc = DocumentManager.Instance.CurrentDBDocument

#Preparing input from dynamo to revit
typeName = IN[0]

views = []

#Get all views and check thier type name against the input
AllViews = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Views).ToElements()

for v in AllViews:
	if not v.IsTemplate:
		if (doc.GetElement(v.GetTypeId())).get_Parameter(BuiltInParameter.ALL_MODEL_TYPE_NAME).AsString() == typeName:
			views.Add(v)

OUT = views

image

1 Like

Thank you very much. I will try your script later.
I just see you message now (end of the day for me), so this morning I ended up using a workaround. I created a project parameter for views, named “#”, then I selected from the project browser groups of sheets from a certain view type, then I entered something in that parameter, such as “01”, then using that value i was able to isolate from the long list only the views that have that value “01” using List.FilterByBoolMask ; then I was able to rename all those views quickly in groups. Then I moved to the next group. After a few repetitions of the same, I was able to rename all the views by their view type. Thanks so much again for your help.

1 Like