# \[Help\] How to Get Elevation Values

**URL:** <https://forum.dynamobim.com/t/help-how-to-get-elevation-values/65220>\
**Category:** Civil 3D\
**Created:** [June 16, 2021, 11:39pm UTC](https://forum.dynamobim.com/t/help-how-to-get-elevation-values/65220 "2021-06-16T23:39:20Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Seanc9XFAH](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@Seanc9XFAH](https://forum.dynamobim.com/u/Seanc9XFAH)\
**Post date:** [June 16, 2021, 11:39pm UTC](https://forum.dynamobim.com/t/help-how-to-get-elevation-values/65220/1 "2021-06-16T23:39:20Z")

</div>

Hi there,

I want to get the elevation value as the attached picture shown.

I’ve got the parameter of the objects, I can see the coordinates from the “Position” in the list.

I need to extract the elevation values out of this list. Please help. Appreciate.

 ![Get Z value](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/2/f2fc118e63abcc6ecbde425782cd12c00d741801.png)

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [June 17, 2021, 12:28am UTC](https://forum.dynamobim.com/t/help-how-to-get-elevation-values/65220/2 "2021-06-17T00:28:22Z")

</div>

String.Split to break the values at the commas.

List.LastItem to get just last item in the new sublists (your Z values).

String.Replace to remove the last floating bracket.

---

<div class="post-metadata">

**Author:** ![Seanc9XFAH](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@Seanc9XFAH](https://forum.dynamobim.com/u/Seanc9XFAH)\
**Post date:** [June 17, 2021, 1:22am UTC](https://forum.dynamobim.com/t/help-how-to-get-elevation-values/65220/3 "2021-06-17T01:22:16Z")

</div>

Hi Jacob,

Thanks for trying to help.

Not sure what I have done is right base on your instruction. However, there is an error occur, shown on screen capture.

 ![response z value](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/1/816ab9d381014c964e9a9245d58a81c904a3e4f5.png)

---

<div class="post-metadata">

**Author:** ![\_Vijay](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/_vijay/32/91307_2.png) [@\_Vijay](https://forum.dynamobim.com/u/_Vijay)\
**Post date:** [June 17, 2021, 3:51am UTC](https://forum.dynamobim.com/t/help-how-to-get-elevation-values/65220/4 "2021-06-17T03:51:39Z")

</div>

@Seanc9XFAH if that point you better use `Point.Z` node

or else use like below,

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

---

<div class="post-metadata">

**Author:** ![chuongmep](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/chuongmep/32/197537_2.png) [@chuongmep](https://forum.dynamobim.com/u/chuongmep)\
**Post date:** [June 17, 2021, 4:37am UTC](https://forum.dynamobim.com/t/help-how-to-get-elevation-values/65220/5 "2021-06-17T04:37:46Z")

</div>

Try use stringfromobject before string.split

---

<div class="post-metadata">

**Author:** ![mzjensen](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@mzjensen](https://forum.dynamobim.com/u/mzjensen)\
**Post date:** [June 17, 2021, 4:58am UTC](https://forum.dynamobim.com/t/help-how-to-get-elevation-values/65220/6 "2021-06-17T04:58:48Z")

</div>

Hi @Seanc9XFAH,

The values you see are a tuple of coordinates from an AutoCAD Point3d object. You can get the Z values directly with a couple lines of Python.

 ![Tuples](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/6/b68f1b283d33eb52f2747b4ba01654322ce363b0.png)

```auto
import clr

clr.AddReference('AcMgd')
clr.AddReference('AcDbMgd')

from Autodesk.AutoCAD.Geometry import *

tuples = IN[0]
output = []

if not isinstance(tuples, list):
	tuples = [tuples] 
for i in range(0, len(tuples)):
	output.append(tuples[i].Z)

OUT = output

```

---

<div class="post-metadata">

**Author:** ![Seanc9XFAH](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@Seanc9XFAH](https://forum.dynamobim.com/u/Seanc9XFAH)\
**Post date:** [June 17, 2021, 5:09am UTC](https://forum.dynamobim.com/t/help-how-to-get-elevation-values/65220/7 "2021-06-17T05:09:25Z")

</div>

Thanks for you help. However, I have copied your scripts in Python Script, but it seens that got error on it.

Could you share your dyn flie to me?

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

---

<div class="post-metadata">

**Author:** ![mzjensen](https://avatars.discourse-cdn.com/v4/letter/m/b77776/32.png) [@mzjensen](https://forum.dynamobim.com/u/mzjensen)\
**Post date:** [June 17, 2021, 5:11am UTC](https://forum.dynamobim.com/t/help-how-to-get-elevation-values/65220/8 "2021-06-17T05:11:16Z")

</div>

It’s probably the structure of your input list. The code I shared would work with a single value or a one-dimensional list. If you need it to work with multiple list levels, it would need to be modified. The simple fix would be to flatten the input list of coordinates first before feeding it into the Python script.

---

<div class="post-metadata">

**Author:** ![\_Vijay](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/_vijay/32/91307_2.png) [@\_Vijay](https://forum.dynamobim.com/u/_Vijay)\
**Post date:** [June 17, 2021, 5:37am UTC](https://forum.dynamobim.com/t/help-how-to-get-elevation-values/65220/9 "2021-06-17T05:37:32Z")

</div>

> [@\_Vijay](#):
>
> or else use like below,
> 
> ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/e/2/e25b9f08a316d05b70ced9140d77c4755f46fd14.png)

Did you tried like this?

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [June 17, 2021, 5:51am UTC](https://forum.dynamobim.com/t/help-how-to-get-elevation-values/65220/10 "2021-06-17T05:51:14Z")

</div>

It’s not actually a string element so you can’t work with the data as a string.

Sadly I don’t have C3D experience to recreate the data set (as simple as it may be) so I can’t really help out here… Wonder if you could just type `a.Z;` in a code block and be done with it though.

---

<div class="post-metadata">

**Author:** ![Assem.Daaboul](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/assem.daaboul/32/116900_2.png) [@Assem.Daaboul](https://forum.dynamobim.com/u/Assem.Daaboul)\
**Post date:** [June 17, 2021, 6:43am UTC](https://forum.dynamobim.com/t/help-how-to-get-elevation-values/65220/11 "2021-06-17T06:43:07Z")

</div>

Hi @Seanc9XFAH ,

As previously mentioned above by @jacob.small and @chuongmep, just convert objects to string. Below is a sample.

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

Hope this helps,  
Assem

---

<div class="post-metadata">

**Author:** ![Seanc9XFAH](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@Seanc9XFAH](https://forum.dynamobim.com/u/Seanc9XFAH)\
**Post date:** [June 17, 2021, 9:10pm UTC](https://forum.dynamobim.com/t/help-how-to-get-elevation-values/65220/12 "2021-06-17T21:10:25Z")

</div>

Appreciate so much. It is works well now
