Use dynamo to find all "Referring Views" - trying to reference all annotation symbols that generates a particular view

I couldn’t find anything on this and I was curious enough to try it in Python… seems it might be useful enough for me at some point, too :slight_smile: I’m using archi-lab and Rhythm to collect the views that are on sheets given that the reference detail / sheet aspect of your inquiry pertains to those views


image

Python script:

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

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

doc = DocumentManager.Instance.CurrentDBDocument

views = UnwrapElement(IN[0])
name = IN[1]

def getRefs(sheetviews, vName):
	refViews = []
	for view in sheetviews:
		viewColl = FilteredElementCollector(doc, view.Id).OfCategory(BuiltInCategory.OST_Viewers).ToElements()
		for viewer in viewColl:
			if viewer.Name == vName:
				refViews.append(view)
	return refViews
	
OUT = getRefs(views, name)

Looks to be working :slight_smile: hope this helps

10 Likes