# Select annotations by associated revit id of modelled element

**URL:** <https://forum.dynamobim.com/t/select-annotations-by-associated-revit-id-of-modelled-element/13440>\
**Category:** Uncategorized\
**Created:** [July 25, 2017, 3:27pm UTC](https://forum.dynamobim.com/t/select-annotations-by-associated-revit-id-of-modelled-element/13440 "2017-07-25T15:27:04Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Mostafa\_El\_Ayoubi](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mostafa_el_ayoubi/32/7815_2.png) [@Mostafa\_El\_Ayoubi](https://forum.dynamobim.com/u/Mostafa_El_Ayoubi)\
**Post date:** [July 26, 2017, 8:34am UTC](https://forum.dynamobim.com/t/select-annotations-by-associated-revit-id-of-modelled-element/13440/3 "2017-07-26T08:34:52Z")

</div>

Hi @jup ,  
for tags there’s a node in the archi-lab package :

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

for dimensions, I don’t know of any existing node that retrieves the reference elementd. So here’s some code :

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

```
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import*
clr.AddReference('RevitServices')
from RevitServices.Persistence import DocumentManager
import sys
pyt_path = r'C:\\Program Files (x86)\\IronPython 2.7\\Lib'
sys.path.append(pyt_path)

doc = DocumentManager.Instance.CurrentDBDocument
def ProcessList(_func, _list):
    return map( lambda x:
    process_list(_func, x) if type(x)==list else _func(x), _list )

def GetDimensionHostElement(dimension):

	hostElemRefs = UnwrapElement(dimension).References
	hostElems = [doc.GetElement(he.ElementId) for he in hostElemRefs]
	return hostElems

try:
	errorReport = None
	output = ProcessList(GetDimensionHostElement, IN[0])
except:
	# if error accurs anywhere in the process catch it
	import traceback
	output = traceback.format_exc()

OUT = output
```

---

_[View the full topic](https://forum.dynamobim.com/t/select-annotations-by-associated-revit-id-of-modelled-element/13440)._
