Select all callouts in a revit file

Hey,

Is there a way to select all the callouts in a revit file? I have checked the parameters but there is no specific thing that could help. Also reference callouts do not share the parameters with views so I can’t even add something specific like a yes/no parameter.

Hi @daninet

You could filter the views by orientation. Where 2 is “By Callout” .

image

Hi @Kulkul

Do you have any idea about reference callouts? Those are my main headache, they don’t share parameters with views.

Capture

Could drop here your rvt dummy file with just one or 2 callouts.

Here you go :slight_smile:

Project1.rvt (340 KB)

@daninet are you looking for Reference View Name?

No. I want to select all callouts in the project including the reference callouts. But reference callouts does not have any parameter to select them.
Selecting normal callouts can be done in multiple way, one is as you have showed it.

You can use this method to get all the reference views in a specific view.
http://www.revitapidocs.com/2018/00cf51d8-dfcd-3bb3-91e8-91b49d0c4f0d.htm

Hi daninet,
Here is solution?

Hi, would you mind posting the code?

tried to type it out but I get an error with the (BuiltInCategory.OST_Viewers)

import clr
# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument
# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

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

collectorViewer = FilteredElementCollector(doc)
OSTviewers = collectorViewer.OfCategory
(BuiltInCategory.OST_Viewers).ToElements()

def GetAllCallouts(_doc, _OSTviewers):
	CalloutParaent = []
	for view in _OSTviewers:
		paraIndex = BuiltInParameter.SECTION_PARENT_VIEW_NAME
		parameter = view.get_Parameter(paraIndex)
		if parameter != None:
			element = _doc.GetElement(view.get_Parameter
			(paraIndex).AsElementId())
			if element!= None:
				CalloutParaent.append(view)
			
	return CalloutParent
OUT = GetAllCallouts(doc,OSTviewers)