daninet
September 28, 2017, 6:27am
1
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.
Kulkul
September 28, 2017, 6:44am
2
Hi @daninet
You could filter the views by orientation. Where 2 is “By Callout” .
daninet
September 28, 2017, 6:57am
3
Hi @Kulkul
Do you have any idea about reference callouts? Those are my main headache, they don’t share parameters with views.
Kulkul
September 28, 2017, 7:03am
4
Could drop here your rvt dummy file with just one or 2 callouts.
Kulkul
September 28, 2017, 7:22am
6
@daninet are you looking for Reference View Name?
daninet
September 28, 2017, 7:34am
7
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?
vanman
May 11, 2022, 3:44am
10
Hi, would you mind posting the code?
vanman
May 11, 2022, 9:49am
11
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)