Getting instances of the view types

hello everyone,

I have bunch of graphs that get instances from each view types (floor plan, section, ceiling … etc).

I also want to get the same for ‘-Disclaimer’ and ‘-Reference’. I had to use a different node for it and I’m having a hard time getting the instances for those two view types

could anyone give me a tip on which node I should use?

Thanks!

I think you’ll have to query all of your views and filter for the ViewFamilyType (or find a custom package that already does it).

Looks like it’ll require Python.


You just have to feed the ViewType and ViewFamilyType as strings.

Python Code
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference('DSCoreNodes')
from DSCore import *
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
from Revit.Elements import *
clr.AddReference('System')
from System.Collections.Generic import *
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

#The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN
views = UnwrapElement(IN[0])
vType = IN[1]
fType = IN[2]
vOut = []
fOut = []

for v in views:
	try:
		if str(v.ViewType) == vType:
			vOut.append(v)
	except:
		pass
	
	try:
		if str(v.LookupParameter("Type").AsValueString()) == fType:
			fOut.append(v)
	except:
		pass
#Assign your output to the OUT variable.
OUT = vType,vOut,fType,fOut

Thank you very much for your help! Quick question.
I’m using Ideate Explorer to check validity between values from Dynamo + Ideate Explorer.

Ideate Explorer has 185 views but either category / element are spitting out something completely different. Am I doing something wrong here? Could you also tell me whats the difference between element views and view cateogires?

Thank you!

Hey, I want to get all view by their type but I cannot find the node “Views.GetByType” and the node “View Type”. Apparantly I don’t have them. I’m using Revit 2022 and its related Dynamo. Would you know if they belong to a specific package or not?

Hello @AmirGabrielli …i like to use archilab and genius loci or crumple for these kind of task…their have a lot of nodes for views…

1 Like