# Dynamo Python Script - GetElement(Reference) of Text note

**URL:** <https://forum.dynamobim.com/t/dynamo-python-script-getelement-reference-of-text-note/26533>\
**Category:** Revit\
**Tags:** python\
**Created:** [September 27, 2018, 3:43pm UTC](https://forum.dynamobim.com/t/dynamo-python-script-getelement-reference-of-text-note/26533 "2018-09-27T15:43:08Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![kadera](https://avatars.discourse-cdn.com/v4/letter/k/eada6e/32.png) [@kadera](https://forum.dynamobim.com/u/kadera)\
**Post date:** [September 27, 2018, 3:43pm UTC](https://forum.dynamobim.com/t/dynamo-python-script-getelement-reference-of-text-note/26533/1 "2018-09-27T15:43:08Z")

</div>

Hi everyone,  
I am new in Dynamo and Python Script, so sorry for my mistakes.

I am trying to make a Python script in Dynamo, which is based on picking points on elements and showing the coordinates of the points and also the host element.  
Everything works fine until I place a pickpoint on Text note, then I simply get “Operation failed”.  
Simply when “doc.GetElement()” is assigned to text note, the script is not working.  
Any sugestions?

 ![python](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/6/a6a6a51948f73b024fcc40fe923db0ea720a7a6b.jpeg)

---

<div class="post-metadata">

**Author:** ![Mark.Ackerley](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mark.ackerley/32/79310_2.png) [@Mark.Ackerley](https://forum.dynamobim.com/u/Mark.Ackerley)\
**Post date:** [September 27, 2018, 4:06pm UTC](https://forum.dynamobim.com/t/dynamo-python-script-getelement-reference-of-text-note/26533/2 "2018-09-27T16:06:43Z")

</div>

Hi,

I don’t think a text note is an ‘Element’…

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

Unlike a wall for example…

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

It does have a position property though…

[http://www.revitapidocs.com/2018/36740103-d9cb-6451-c9ff-34e6880c9eeb.htm](http://www.revitapidocs.com/2018/36740103-d9cb-6451-c9ff-34e6880c9eeb.htm)

Hope that helps,

Mark

---

<div class="post-metadata">

**Author:** ![kadera](https://avatars.discourse-cdn.com/v4/letter/k/eada6e/32.png) [@kadera](https://forum.dynamobim.com/u/kadera)\
**Post date:** [September 27, 2018, 5:12pm UTC](https://forum.dynamobim.com/t/dynamo-python-script-getelement-reference-of-text-note/26533/3 "2018-09-27T17:12:37Z")

</div>

Thanks for your reply.  
Maybe I explained it wrong - I meant a “text note”, not “text node”. I am speaking about classic text in Revit - it has it´s ID, so I assume it is an element.  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/4/345a3d16521ddba0d109af9c3d3f81da05fc2e98.png)

---

<div class="post-metadata">

**Author:** ![Mark.Ackerley](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mark.ackerley/32/79310_2.png) [@Mark.Ackerley](https://forum.dynamobim.com/u/Mark.Ackerley)\
**Post date:** [September 28, 2018, 9:17am UTC](https://forum.dynamobim.com/t/dynamo-python-script-getelement-reference-of-text-note/26533/4 "2018-09-28T09:17:38Z")

</div>

Hey,

Apologies for that mistake…

I ran your code and it worked for me?

My only change was to remove line 32 and change ‘Vyber body’ to ‘Select Points’

Hope that helps,

Mark

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

EDIT: If I have a text note in a sheet I get an empty list…

---

<div class="post-metadata">

**Author:** ![kadera](https://avatars.discourse-cdn.com/v4/letter/k/eada6e/32.png) [@kadera](https://forum.dynamobim.com/u/kadera)\
**Post date:** [September 28, 2018, 10:28am UTC](https://forum.dynamobim.com/t/dynamo-python-script-getelement-reference-of-text-note/26533/5 "2018-09-28T10:28:30Z")

</div>

Thank you for your help.  
Unfortunately the code is still not working for me, maybe it is caused by the version of Revit or Dynamo ( I am using Revit 2018.2 and Dynamo Core 1.3.2.2480  
May I ask which version of Revit and Dynamo did you use for testing?  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/4/c47f2cceb659d0fbc33ab3e6f43c5df60432ddd6.png)

---

<div class="post-metadata">

**Author:** ![Mark.Ackerley](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mark.ackerley/32/79310_2.png) [@Mark.Ackerley](https://forum.dynamobim.com/u/Mark.Ackerley)\
**Post date:** [September 28, 2018, 10:32am UTC](https://forum.dynamobim.com/t/dynamo-python-script-getelement-reference-of-text-note/26533/6 "2018-09-28T10:32:10Z")

</div>

Hey,

Sure, I’m on 2018.3 and 1.3.2.2480.

Here’s my version of your code…

Perhaps there is a language issue?

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

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import Point as dsPoint

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
uidoc = DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument
UIunit = Document.GetUnits(doc).GetFormatOptions(UnitType.UT_Length).DisplayUnits

#The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN

#points selection
selpoints = uidoc.Selection.PickObjects(Selection.ObjectType.PointOnElement, 'Select Points')

#host elements and point coordinates
prvky = []
points = []

for A in selpoints:
	prvky.append(doc.GetElement(A))
	pt = A.GlobalPoint
	points.append(dsPoint.ByCoordinates(UnitUtils.ConvertFromInternalUnits(pt.X,UIunit),UnitUtils.ConvertFromInternalUnits(pt.Y,UIunit),UnitUtils.ConvertFromInternalUnits(pt.Z,UIunit)))
#Assign your output to the OUT variable.
OUT = [prvky, points]
```

---

<div class="post-metadata">

**Author:** ![kadera](https://avatars.discourse-cdn.com/v4/letter/k/eada6e/32.png) [@kadera](https://forum.dynamobim.com/u/kadera)\
**Post date:** [September 30, 2018, 9:27am UTC](https://forum.dynamobim.com/t/dynamo-python-script-getelement-reference-of-text-note/26533/7 "2018-09-30T09:27:50Z")

</div>

Thank you for your help, it is really caused by the Revit language. If I run Revit in english, the code works fine. If i run Revit in czech (/language CSY) the code show “Operation failed”.

Is there any way how to find the reason for this, or is there any idea how to solve it?

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [October 1, 2018, 4:02pm UTC](https://forum.dynamobim.com/t/dynamo-python-script-getelement-reference-of-text-note/26533/8 "2018-10-01T16:02:33Z")

</div>

Hi,

Text note doesn’t work with other language version than English Revit in Dynamo 1.3.  
This is a known bug with Dynamo 1.3. This has been corrected in Dynamo 2.0.

TextNote in French in 1.3 :  
 ![TextNote](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/2/f2f90bc9c1f3bfe930e454358638d4209c66e520.png)

---

<div class="post-metadata">

**Author:** ![kadera](https://avatars.discourse-cdn.com/v4/letter/k/eada6e/32.png) [@kadera](https://forum.dynamobim.com/u/kadera)\
**Post date:** [October 3, 2018, 5:12pm UTC](https://forum.dynamobim.com/t/dynamo-python-script-getelement-reference-of-text-note/26533/9 "2018-10-03T17:12:13Z")

</div>

I tried to install Dynamo 2.0.1 and it looks like the bug was not fixed yet.  
Or did I miss something?

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/0/f011670fcbca157e7f792c9cf1bfcf16ce853d07.png)  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/8/68589c03cf85e0a7a8637d30a47f24c454e41987.png)

---

<div class="post-metadata">

**Author:** ![Alban\_de\_Chasteigner](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/alban_de_chasteigner/32/39650_2.png) [@Alban\_de\_Chasteigner](https://forum.dynamobim.com/u/Alban_de_Chasteigner)\
**Post date:** [October 3, 2018, 8:01pm UTC](https://forum.dynamobim.com/t/dynamo-python-script-getelement-reference-of-text-note/26533/10 "2018-10-03T20:01:50Z")

</div>

It is working in Dynamo 2.1

 ![TextNote](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/4/240bdb583565e8704fd3a353d443cd3b823e7a35.jpeg)

---

<div class="post-metadata">

**Author:** ![Mark.Ackerley](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/mark.ackerley/32/79310_2.png) [@Mark.Ackerley](https://forum.dynamobim.com/u/Mark.Ackerley)\
**Post date:** [October 4, 2018, 8:58am UTC](https://forum.dynamobim.com/t/dynamo-python-script-getelement-reference-of-text-note/26533/11 "2018-10-04T08:58:08Z")

</div>

Hey,

Just in case you didn’t know, you can download the Development Builds of Dynamo here… [http://dynamobuilds.com/](http://dynamobuilds.com/)

This allows you to use 2.1, though obviously it might have some bugs…

Hope that helps,

Mark

---

<div class="post-metadata">

**Author:** ![kadera](https://avatars.discourse-cdn.com/v4/letter/k/eada6e/32.png) [@kadera](https://forum.dynamobim.com/u/kadera)\
**Post date:** [October 8, 2018, 1:28pm UTC](https://forum.dynamobim.com/t/dynamo-python-script-getelement-reference-of-text-note/26533/12 "2018-10-08T13:28:01Z")

</div>

Thanks a lot, Dynamo 2.1 solved the problem.
