# Collect callouts

**URL:** <https://forum.dynamobim.com/t/collect-callouts/76411>\
**Category:** Uncategorized\
**Created:** [May 11, 2022, 3:24am UTC](https://forum.dynamobim.com/t/collect-callouts/76411 "2022-05-11T03:24:20Z")\
**Posts on this page:** 15\
**Page:** 2

<div class="post-metadata">

**Author:** ![Draxl\_Andreas](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/draxl_andreas/32/145744_2.png) [@Draxl\_Andreas](https://forum.dynamobim.com/u/Draxl_Andreas)\
**Post date:** [May 11, 2022, 10:08am UTC](https://forum.dynamobim.com/t/collect-callouts/76411/23 "2022-05-11T10:08:04Z")

</div>

in my list there are 2 of them @vanman ! i set the second one!  
 ![2022-05-11_12h07_53](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/a/1a9dff2b493ee4a85eea02e99cca3429823afc30.png)

---

<div class="post-metadata">

**Author:** ![vanman](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vanman/32/20881_2.png) [@vanman](https://forum.dynamobim.com/u/vanman)\
**Post date:** [May 11, 2022, 10:11am UTC](https://forum.dynamobim.com/t/collect-callouts/76411/24 "2022-05-11T10:11:34Z")

</div>

both dont work for me unfortunately

---

<div class="post-metadata">

**Author:** ![Draxl\_Andreas](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/draxl_andreas/32/145744_2.png) [@Draxl\_Andreas](https://forum.dynamobim.com/u/Draxl_Andreas)\
**Post date:** [May 11, 2022, 10:13am UTC](https://forum.dynamobim.com/t/collect-callouts/76411/25 "2022-05-11T10:13:37Z")

</div>

did you check regular stuff f.e. @vanman  
1.) are you still in a work mode  
2.) selected something during running  
3.) restart dynamo

…

---

<div class="post-metadata">

**Author:** ![vanman](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vanman/32/20881_2.png) [@vanman](https://forum.dynamobim.com/u/vanman)\
**Post date:** [May 11, 2022, 10:13am UTC](https://forum.dynamobim.com/t/collect-callouts/76411/26 "2022-05-11T10:13:56Z")

</div>

anyone know how to use GeniousLoci method to input a link doc with the get all callouts code?

```auto
#Part of script from Clockwork
inputdoc = UnwrapElement(IN[0])
if inputdoc == None:
	doc = DocumentManager.Instance.CurrentDBDocument
elif isinstance (inputdoc, RevitLinkInstance) :
	doc = inputdoc.GetLinkDocument()
elif isinstance (inputdoc, Document) :
	doc = inputdoc
else: doc = None

```

---

<div class="post-metadata">

**Author:** ![vanman](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vanman/32/20881_2.png) [@vanman](https://forum.dynamobim.com/u/vanman)\
**Post date:** [May 11, 2022, 10:15am UTC](https://forum.dynamobim.com/t/collect-callouts/76411/27 "2022-05-11T10:15:33Z")

</div>

restarted dynamo, had both View Reference nodes going, empty

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/d/ed71ab247c4a5a9a467b4a487f9aa1bc136dc48f.png)

---

<div class="post-metadata">

**Author:** ![vanman](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vanman/32/20881_2.png) [@vanman](https://forum.dynamobim.com/u/vanman)\
**Post date:** [May 11, 2022, 10:23am UTC](https://forum.dynamobim.com/t/collect-callouts/76411/28 "2022-05-11T10:23:11Z")

</div>

holy shit just pasting it in got from links too. Ideally just want to get references from views though…

```auto
#Alban de Chasteigner 2018
#twitter : @geniusloci_bim
#geniusloci.bim@gmail.com

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)

#Part of script from Clockwork
inputdoc = UnwrapElement(IN[0])
if inputdoc == None:
	doc = DocumentManager.Instance.CurrentDBDocument
elif isinstance (inputdoc, RevitLinkInstance) :
	doc = inputdoc.GetLinkDocument()
elif isinstance (inputdoc, Document) :
	doc = inputdoc
else: doc = None

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

def GetAllCallouts(_doc, _OSTviewers):
	CalloutParent = []
	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:
				CalloutParent.append(view)
			
	return CalloutParent
	
OUT = GetAllCallouts(doc,OSTviewers)

```

---

<div class="post-metadata">

**Author:** ![jw.vanasselt](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jw.vanasselt/32/133533_2.png) [@jw.vanasselt](https://forum.dynamobim.com/u/jw.vanasselt)\
**Post date:** [May 11, 2022, 10:28am UTC](https://forum.dynamobim.com/t/collect-callouts/76411/29 "2022-05-11T10:28:58Z")

</div>

> [@vanman](#):
>
> Ideally just want to get references from views though…

How do you want it exactly?

---

<div class="post-metadata">

**Author:** ![vanman](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vanman/32/20881_2.png) [@vanman](https://forum.dynamobim.com/u/vanman)\
**Post date:** [May 11, 2022, 10:34am UTC](https://forum.dynamobim.com/t/collect-callouts/76411/30 "2022-05-11T10:34:45Z")

</div>

A node that would get selected views callout references in the document/links. Fake and real references. Then I’m going to schedule the data from that and put it next to the view on a sheet to show where all references are for that detail

---

<div class="post-metadata">

**Author:** ![jw.vanasselt](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jw.vanasselt/32/133533_2.png) [@jw.vanasselt](https://forum.dynamobim.com/u/jw.vanasselt)\
**Post date:** [May 11, 2022, 11:10am UTC](https://forum.dynamobim.com/t/collect-callouts/76411/31 "2022-05-11T11:10:11Z")

</div>

Like this?

```auto
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)

view = UnwrapElement(IN[0])

CalloutParent = []
for v in view:
	paraIndex = BuiltInParameter.SECTION_PARENT_VIEW_NAME
	parameter = v.get_Parameter(paraIndex)
	if parameter != None:
		element = doc.GetElement(v.get_Parameter(paraIndex).AsElementId())
		if element!= None:
			CalloutParent.append(v)

OUT = CalloutParent

```

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/9/090cd055e8f9e1c2ac729120639668a06f773985.png)

---

<div class="post-metadata">

**Author:** ![vanman](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vanman/32/20881_2.png) [@vanman](https://forum.dynamobim.com/u/vanman)\
**Post date:** [May 11, 2022, 11:29am UTC](https://forum.dynamobim.com/t/collect-callouts/76411/32 "2022-05-11T11:29:24Z")

</div>

seems very promising but there should be 4 callout elements from this view. Sorry if I’m explaining incorrectly

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/8/68a756b818fa66b55eb60c9ab2aa2e637bc32c2b.png)

---

<div class="post-metadata">

**Author:** ![jw.vanasselt](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jw.vanasselt/32/133533_2.png) [@jw.vanasselt](https://forum.dynamobim.com/u/jw.vanasselt)\
**Post date:** [May 11, 2022, 12:33pm UTC](https://forum.dynamobim.com/t/collect-callouts/76411/33 "2022-05-11T12:33:30Z")

</div>

Have no solution yet, what does this node?

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/1/11284137d33e491ee9daa085559788827e0a2ee2.png)

---

<div class="post-metadata">

**Author:** ![vanman](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vanman/32/20881_2.png) [@vanman](https://forum.dynamobim.com/u/vanman)\
**Post date:** [May 11, 2022, 12:35pm UTC](https://forum.dynamobim.com/t/collect-callouts/76411/34 "2022-05-11T12:35:41Z")

</div>

just returns emptys

---

<div class="post-metadata">

**Author:** ![jw.vanasselt](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jw.vanasselt/32/133533_2.png) [@jw.vanasselt](https://forum.dynamobim.com/u/jw.vanasselt)\
**Post date:** [May 11, 2022, 12:48pm UTC](https://forum.dynamobim.com/t/collect-callouts/76411/35 "2022-05-11T12:48:28Z")

</div>

Hmm strange…

@Konrad_K_Sobon any thoughts?

---

<div class="post-metadata">

**Author:** ![c.poupin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/c.poupin/32/89152_2.png) [@c.poupin](https://forum.dynamobim.com/u/c.poupin)\
**Post date:** [May 12, 2022, 1:13pm UTC](https://forum.dynamobim.com/t/collect-callouts/76411/36 "2022-05-12T13:13:09Z")

</div>

Hello  
I don’t know what kind of list structure you want in the end, but here’s an example

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/5/25242c6c6ae2285206128a4f17dc2724c14807bc.png)

```auto
import clr
import System
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 Autodesk.Revit.DB as DB
clr.AddReference("System.Core")
clr.ImportExtensions(System.Linq)

def get_Sheet_Callouts(currDoc, v_callout):
	c_filter = ElementClassFilter(clr.GetClrType(DB.Viewport))
	lst_vpIds = v_callout.GetDependentElements(c_filter)
	for vpid in lst_vpIds:
		viewport = currDoc.GetElement(vpid)
		sheet = currDoc.GetElement(viewport.SheetId)
		if sheet is not None:
			return sheet
	return "'{}' not placed in a Sheet".format(v_callout.Name)

toList = lambda x : x if hasattr(x, ' __iter__') else [x]

out = []
#Preparing input from dynamo to revit
lstviews = toList(UnwrapElement(IN[0]))
for view in lstviews:
	if view is not None and not view.IsTemplate:
		currDoc = view.Document
		filterFunc = System.Func[DB.Element, System.Boolean](lambda x : currDoc.GetElement(x.GetTypeId()).ViewFamily == ViewFamily.Detail)
		enumIter_DetailCallout = FilteredElementCollector(currDoc, view.Id).OfCategory(BuiltInCategory.OST_Viewers).WhereElementIsNotElementType().Where(filterFunc)
		temp = []
		for v_callout in enumIter_DetailCallout:
			sheet = get_Sheet_Callouts(currDoc, v_callout)
			temp.append([v_callout.Name, sheet])
		if len(temp) > 0:
			out.append([view, temp])

OUT = out

```

---

<div class="post-metadata">

**Author:** ![vanman](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/vanman/32/20881_2.png) [@vanman](https://forum.dynamobim.com/u/vanman)\
**Post date:** [May 12, 2022, 9:29pm UTC](https://forum.dynamobim.com/t/collect-callouts/76411/37 "2022-05-12T21:29:05Z")

</div>

You know what sorry guys. I haven’t looked at revit correctly. So I want what sheet each callout is on. Even though the callout is on a different sheet it only reports the one referencing sheet! How do I get the sheet of the element? Maybe get the view of the element then the sheet of the view?

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/0/e04fae7477ee50ba4d2b5e4456916982fda5f941.png)

this should have had the other referencing sheet in it

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/a/9ad39541707c13ab14eda881aefa04398ff801d8.png)

@Nick_Boyts if your interested

I might be out of luck getting the callouts sheets… Should be AA4011 in there too. Or I search every view on a sheet for a callout… Very slow collecting callouts from views on sheets 🫠

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/8/9864142a1226d7c7b1979dd5e2c59dce9058c9d7.png)

[Previous page](https://forum.dynamobim.com/t/collect-callouts/76411.md?page=1)
