# Set DBPoint Elevation to Nearest Text

**URL:** <https://forum.dynamobim.com/t/set-dbpoint-elevation-to-nearest-text/73016>\
**Category:** Civil 3D\
**Created:** [February 5, 2022, 7:56am UTC](https://forum.dynamobim.com/t/set-dbpoint-elevation-to-nearest-text/73016 "2022-02-05T07:56:30Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pointdump](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/pointdump/32/128621_2.png) [@Pointdump](https://forum.dynamobim.com/u/Pointdump)\
**Post date:** [February 5, 2022, 7:56am UTC](https://forum.dynamobim.com/t/set-dbpoint-elevation-to-nearest-text/73016/1 "2022-02-05T07:56:30Z")

</div>

I’d like to be able to set each AutoCAD Point’s elevation to the nearest text. This is as far as I’ve gotten. I found a DBPoint.Geometry Node, but I can’t find a Text.Geometry Node. And I can’t find a “Nearest” Node that will connect the DBPoint with nearest text.  
Happy to post my drawing and Dynamo files if possible.  
Dave

 ![ACADPoint-TextElev_1](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/5/55c44959cd61038080fe7a4941fb3a64452052e3.png)  
 ![ACADPoint-TextElev_2](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/7/0/70786f28f4dfeef957fbbec691f10b84f24844ac.jpeg)

---

<div class="post-metadata">

**Author:** ![hosneyalaa](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/hosneyalaa/32/100865_2.png) [@hosneyalaa](https://forum.dynamobim.com/u/hosneyalaa)\
**Post date:** [February 5, 2022, 8:33am UTC](https://forum.dynamobim.com/t/set-dbpoint-elevation-to-nearest-text/73016/2 "2022-02-05T08:33:36Z")

</div>

hi  
try this for text

> [@Text content from Lower to Upper](https://forum.dynamobim.com/t/text-content-from-lower-to-upper/51375/13):
>
> Good Job +1@mzjensen You can also collect all text notes in one python snippet: import sys import clr # Add Assemblies for AutoCAD and Civil3D clr.AddReference('AcMgd') clr.AddReference('AcCoreMgd') clr.AddReference('AcDbMgd') clr.AddReference('AecBaseMgd') clr.AddReference('AecPropDataMgd') clr.AddReference('AeccDbMgd') # Import references from AutoCAD from Autodesk.AutoCAD.Runtime import \* from Autodesk.AutoCAD.ApplicationServices import \* from Autodesk.AutoCAD.EditorInput im…

---

<div class="post-metadata">

**Author:** ![Pointdump](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/pointdump/32/128621_2.png) [@Pointdump](https://forum.dynamobim.com/u/Pointdump)\
**Post date:** [February 5, 2022, 12:37pm UTC](https://forum.dynamobim.com/t/set-dbpoint-elevation-to-nearest-text/73016/3 "2022-02-05T12:37:59Z")

</div>

Hi @hosneyalaa,  
Thanks, but I have absolutely no idea what to do with a “python snippet”.  
Dave

---

<div class="post-metadata">

**Author:** ![hosneyalaa](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/hosneyalaa/32/100865_2.png) [@hosneyalaa](https://forum.dynamobim.com/u/hosneyalaa)\
**Post date:** [February 5, 2022, 12:51pm UTC](https://forum.dynamobim.com/t/set-dbpoint-elevation-to-nearest-text/73016/4 "2022-02-05T12:51:06Z")

</div>

![Capture](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/a/9/a9d9e135f43d953a4d76a0440013c26d1f713bdb.jpeg)

---

<div class="post-metadata">

**Author:** ![Pointdump](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/pointdump/32/128621_2.png) [@Pointdump](https://forum.dynamobim.com/u/Pointdump)\
**Post date:** [February 5, 2022, 1:30pm UTC](https://forum.dynamobim.com/t/set-dbpoint-elevation-to-nearest-text/73016/5 "2022-02-05T13:30:50Z")

</div>

@hosneyalaa,  
Thank you. I appreciate your effort to help me, really I do, but I’m struggling to put together my first Dynamo program. Python programming is waaaaaaay over my head.  
Dave

---

<div class="post-metadata">

**Author:** ![hosneyalaa](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/hosneyalaa/32/100865_2.png) [@hosneyalaa](https://forum.dynamobim.com/u/hosneyalaa)\
**Post date:** [February 5, 2022, 2:12pm UTC](https://forum.dynamobim.com/t/set-dbpoint-elevation-to-nearest-text/73016/6 "2022-02-05T14:12:12Z")

</div>

My language is not good anyway  
Calculate a distance between each point With all texts from Melal Naqou the closest entry is required And so on Determines the order of each text through a list of text points

I don’t know if you understand me  
can you look at this

> [@Point from (X & Y FROM a circle & Mtext content)](https://forum.dynamobim.com/t/point-from-x-y-from-a-circle-mtext-content/66916/7):
>
> The solution is from this link With a little modification [closest-point-from-long-list-to-a-point-in-a-shorter-list](https://forum.dynamobim.com/t/closest-point-from-long-list-to-a-point-in-a-shorter-list/58099/2) # Load the Python Standard and DesignScript Libraries import sys import clr clr.AddReference('ProtoGeometry') from Autodesk.DesignScript.Geometry import \* # Inputs short\_list = IN[0] long\_list = IN[1] # Output list result = [] # Loop check for each point in the short list for s in short\_list: # List for distances dist = [] for l in long\_list: # Distance to point…

---

<div class="post-metadata">

**Author:** ![marshmallow](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/marshmallow/32/124690_2.png) [@marshmallow](https://forum.dynamobim.com/u/marshmallow)\
**Post date:** [February 5, 2022, 10:18pm UTC](https://forum.dynamobim.com/t/set-dbpoint-elevation-to-nearest-text/73016/7 "2022-02-05T22:18:42Z")

</div>

Hi @Pointdump  
Currently there is no way of updating AutoCAD Point properties without Python. but the graph attached does the following:

- Imports Text objects in Dynamo
- Gets all the parameters of the text object (just to get the internal property “name” for position and text component - can skip this if already knew the property named to read)
- Draws points at Text insertion point
- Imports the AutoCAD Points
- Patch a circular surfaces around each point at zero elevation - the circle is the buffer to find the corresponding text inside the closed area! (be sure to **change the circle radius** input based on how far the text is from the point approximately)
- Intersect the geometries and reorder list of “elevation” strings based on results
- Draw new AutoCAD Points on same layers
- Delete original points that we started with

I tried to annotate as much as possible so that you can follow the logic, graph created from Civil 3D 2022!  
Hope it helps,

[TextToAcadPoint.dyn](https://forum.dynamobim.com/uploads/short-url/f0EIiFiHLAzBWrNLsX5HdQ6KGXK.dyn) (98.0 KB)

 ![TextToAcadPoint_2022-02-05_05-19-49](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/e/9e1714ad357fc75685e0e9561790d1027bbff07f.png)

---

<div class="post-metadata">

**Author:** ![Pointdump](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/pointdump/32/128621_2.png) [@Pointdump](https://forum.dynamobim.com/u/Pointdump)\
**Post date:** [February 6, 2022, 8:45am UTC](https://forum.dynamobim.com/t/set-dbpoint-elevation-to-nearest-text/73016/8 "2022-02-06T08:45:27Z")

</div>

Hi Samir,  
Thank you. Nicely layed out and noted. I’ll study it and see if I can understand what you did.  
Dave

---

<div class="post-metadata">

**Author:** ![Pointdump](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/pointdump/32/128621_2.png) [@Pointdump](https://forum.dynamobim.com/u/Pointdump)\
**Post date:** [February 6, 2022, 5:47pm UTC](https://forum.dynamobim.com/t/set-dbpoint-elevation-to-nearest-text/73016/9 "2022-02-06T17:47:24Z")

</div>

@hosneyalaa,  
Thank you for the links. I looked at both of them.  
Nothing wrong with your language, and I understand you perfectly. Please understand that I have only the barest beginnings of understanding Dynamo. I know absolutely nothing about Python.  
Dave

---

<div class="post-metadata">

**Author:** ![domenicovenuti](https://avatars.discourse-cdn.com/v4/letter/d/b5ac83/32.png) [@domenicovenuti](https://forum.dynamobim.com/u/domenicovenuti)\
**Post date:** [May 2, 2024, 7:44am UTC](https://forum.dynamobim.com/t/set-dbpoint-elevation-to-nearest-text/73016/10 "2024-05-02T07:44:11Z")

</div>

Hi there I worked on a script that may help. It takes the block and text witin a specified radius and creates a civil 3d point, groups them and then creates a surface. I would load the file, but new users are not allowed to… who knows why??
