# Object.Geometry return's null for 3D polyline

**URL:** <https://forum.dynamobim.com/t/object-geometry-returns-null-for-3d-polyline/57935>\
**Category:** Civil 3D\
**Created:** [December 3, 2020, 5:54am UTC](https://forum.dynamobim.com/t/object-geometry-returns-null-for-3d-polyline/57935 "2020-12-03T05:54:01Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![shahid.shaikh\_C3D](https://avatars.discourse-cdn.com/v4/letter/s/77aa72/32.png) [@shahid.shaikh\_C3D](https://forum.dynamobim.com/u/shahid.shaikh_C3D)\
**Post date:** [December 3, 2020, 5:54am UTC](https://forum.dynamobim.com/t/object-geometry-returns-null-for-3d-polyline/57935/1 "2020-12-03T05:54:01Z")

</div>

Hi,

I am not able to figureout why Object.geometry returns null for a perticular 3D polyline and works fine for other.

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

Is there another way to get polycurve of 3D polyline ?  
[3Dpolyline\_Test.dwg](https://forum.dynamobim.com/uploads/short-url/uwMLP1X1q6Fla22XjGPhEbhS1IZ.dwg) (887.8 KB)

---

<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:** [December 3, 2020, 6:25am UTC](https://forum.dynamobim.com/t/object-geometry-returns-null-for-3d-polyline/57935/2 "2020-12-03T06:25:22Z")

</div>

I’ve seen this happen when there are coincident points in the 3D polyline. For some reasons that I don’t understand, it is possible in AutoCAD to have two polyline vertices that are identical, and it is really hard to tell!

In this case, the upper line in your example (i.e. the one with the curve at the end) has duplicate vertices at vertex numbers 193 and 194, which you can confirm using “Current vertex” in the Properties window. If you remove either one of those vertices, then Dynamo creates the geometry representation properly.

---

<div class="post-metadata">

**Author:** ![Paolo\_Emilio\_Serra1](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/paolo_emilio_serra1/32/12902_2.png) [@Paolo\_Emilio\_Serra1](https://forum.dynamobim.com/u/Paolo_Emilio_Serra1)\
**Post date:** [December 3, 2020, 7:18am UTC](https://forum.dynamobim.com/t/object-geometry-returns-null-for-3d-polyline/57935/3 "2020-12-03T07:18:50Z")

</div>

Civil 3D Toolkit

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/d/1d98e454d783355ee8126635f3821b9a583954b8.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:** [December 3, 2020, 7:24am UTC](https://forum.dynamobim.com/t/object-geometry-returns-null-for-3d-polyline/57935/4 "2020-12-03T07:24:32Z")

</div>

@Paolo_Emilio_Serra1 does the node check for and/or ignore coincident points?

---

<div class="post-metadata">

**Author:** ![Paolo\_Emilio\_Serra1](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/paolo_emilio_serra1/32/12902_2.png) [@Paolo\_Emilio\_Serra1](https://forum.dynamobim.com/u/Paolo_Emilio_Serra1)\
**Post date:** [December 3, 2020, 7:27am UTC](https://forum.dynamobim.com/t/object-geometry-returns-null-for-3d-polyline/57935/5 "2020-12-03T07:27:03Z")

</div>

Correct, that is what I designed it for, just recently though I’ve found an issue on some datasets so I’ve used the Prune Duplicates functionality in Dynamo rather than my dictionary approach comparing point coordinates.  
These operations are captured in the log file, here is a preview of what you will see in the new log file ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/b/0ba4c55fefa9d17b9bd4604d064bcbb501d33da1.png)

The second polyline has two overlapping vertices and one of them gets removed

---

<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:** [December 3, 2020, 7:28am UTC](https://forum.dynamobim.com/t/object-geometry-returns-null-for-3d-polyline/57935/6 "2020-12-03T07:28:48Z")

</div>

Very nice! 👍

---

<div class="post-metadata">

**Author:** ![shahid.shaikh\_C3D](https://avatars.discourse-cdn.com/v4/letter/s/77aa72/32.png) [@shahid.shaikh\_C3D](https://forum.dynamobim.com/u/shahid.shaikh_C3D)\
**Post date:** [December 3, 2020, 8:13am UTC](https://forum.dynamobim.com/t/object-geometry-returns-null-for-3d-polyline/57935/7 "2020-12-03T08:13:57Z")

</div>

@Paolo_Emilio_Serra1

i have tried that thing also before reaching the forum. i didn’t had any luck with that too.

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

I am using toolkit 1.1.12. Will update the toolkit and try again.

Thanks alot

---

<div class="post-metadata">

**Author:** ![Paolo\_Emilio\_Serra1](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/paolo_emilio_serra1/32/12902_2.png) [@Paolo\_Emilio\_Serra1](https://forum.dynamobim.com/u/Paolo_Emilio_Serra1)\
**Post date:** [December 3, 2020, 8:16am UTC](https://forum.dynamobim.com/t/object-geometry-returns-null-for-3d-polyline/57935/8 "2020-12-03T08:16:48Z")

</div>

that is referring to my comment with regards to the changes I made recently, chances are you will still be seeing this behavior in 1.1.14 but it is worth a try

---

<div class="post-metadata">

**Author:** ![shahid.shaikh\_C3D](https://avatars.discourse-cdn.com/v4/letter/s/77aa72/32.png) [@shahid.shaikh\_C3D](https://forum.dynamobim.com/u/shahid.shaikh_C3D)\
**Post date:** [December 3, 2020, 8:17am UTC](https://forum.dynamobim.com/t/object-geometry-returns-null-for-3d-polyline/57935/9 "2020-12-03T08:17:40Z")

</div>

Got it, i have to wait for 1.1.15 then…thanks alot for all the help.

---

<div class="post-metadata">

**Author:** ![shahid.shaikh\_C3D](https://avatars.discourse-cdn.com/v4/letter/s/77aa72/32.png) [@shahid.shaikh\_C3D](https://forum.dynamobim.com/u/shahid.shaikh_C3D)\
**Post date:** [December 3, 2020, 8:22am UTC](https://forum.dynamobim.com/t/object-geometry-returns-null-for-3d-polyline/57935/10 "2020-12-03T08:22:16Z")

</div>

@zachri.jensen Thanks alot for reply. yes this 3D polylines are generated from corridor featurelines and sometimes you wll see redundant vertices in featurelines with same elevations. This might be the reason for coincidental points in 3D polyline too.

---

<div class="post-metadata">

**Author:** ![Daan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/daan/32/82246_2.png) [@Daan](https://forum.dynamobim.com/u/Daan)\
**Post date:** [December 3, 2020, 5:14pm UTC](https://forum.dynamobim.com/t/object-geometry-returns-null-for-3d-polyline/57935/11 "2020-12-03T17:14:28Z")

</div>

Wow very nice!! I also have this problem in one of my scripts maybe this is the solution!!

---

<div class="post-metadata">

**Author:** ![abbailey](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/abbailey/32/113943_2.png) [@abbailey](https://forum.dynamobim.com/u/abbailey)\
**Post date:** [June 29, 2022, 10:44pm UTC](https://forum.dynamobim.com/t/object-geometry-returns-null-for-3d-polyline/57935/12 "2022-06-29T22:44:45Z")

</div>

I’m working with linework coming in from a .kml, and using 1.1.30. The polyline extension node is not able to get any geometry for me.

Within CAD I can’t remove the duplicate until i stretch the polyline, then the extra point is removeable if that is of any use.

---

<div class="post-metadata">

**Author:** ![WrightEngineering](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/wrightengineering/32/115676_2.png) [@WrightEngineering](https://forum.dynamobim.com/u/WrightEngineering)\
**Post date:** [June 29, 2022, 11:28pm UTC](https://forum.dynamobim.com/t/object-geometry-returns-null-for-3d-polyline/57935/13 "2022-06-29T23:28:51Z")

</div>

Andrew, is this the same file you posted previously? I am having the same issue with the geometry. I can only seem to get the geometry if I explode it out into individual lines. 3300 lines actually. I tried using the “group\_curves” node developed by Konrad to recombine the geometry that can be recombined but it just crashed my civil 3d at this scale. hmmm… Overkill also didn’t work for me in autocad.

 ![kmztopolylinegeometry](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/0/5/05ab9090196976ebf2e76b41bdb39db98a7e6424.png)

---

<div class="post-metadata">

**Author:** ![abbailey](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/abbailey/32/113943_2.png) [@abbailey](https://forum.dynamobim.com/u/abbailey)\
**Post date:** [June 30, 2022, 1:48pm UTC](https://forum.dynamobim.com/t/object-geometry-returns-null-for-3d-polyline/57935/14 "2022-06-30T13:48:35Z")

</div>

Yes, same file. I’m testing this morning if there is anything I can do in Google Earth to prep the data differently.

---

<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:** [July 1, 2022, 6:42pm UTC](https://forum.dynamobim.com/t/object-geometry-returns-null-for-3d-polyline/57935/15 "2022-07-01T18:42:15Z")

</div>

@abbailey  
I added some nodes to help with this in Camber v4.0.0. The new _Polyline.PruneDuplicateVertices_ node should help a lot for your task. I tested in with your file from [here](https://forum.dynamobim.com/t/producing-only-a-single-object-data-output-for-multiple-objects/78171/3) and it worked great. I had to adjust the tolerance just slightly from the default of 0.001, but after that then the _Object.Geometry_ node was able to import all of the Polylines successfully.

 ![polylines](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/1/2/12e9334db0b8047e14bfda452745c5df2ee109e0.png)

---

<div class="post-metadata">

**Author:** ![WrightEngineering](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/wrightengineering/32/115676_2.png) [@WrightEngineering](https://forum.dynamobim.com/u/WrightEngineering)\
**Post date:** [July 1, 2022, 8:10pm UTC](https://forum.dynamobim.com/t/object-geometry-returns-null-for-3d-polyline/57935/16 "2022-07-01T20:10:17Z")

</div>

This is awesome!! Sounds like it’s basically a better version of the overkill command! This will be a huge help for people dealing with difficult geometry imports.

---

<div class="post-metadata">

**Author:** ![dgregory](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/dgregory/32/142067_2.png) [@dgregory](https://forum.dynamobim.com/u/dgregory)\
**Post date:** [July 1, 2022, 8:12pm UTC](https://forum.dynamobim.com/t/object-geometry-returns-null-for-3d-polyline/57935/17 "2022-07-01T20:12:05Z")

</div>

While you all were working on the Node update I found an OOTB solution. The command “MAPCLEAN” worked great where Overkill and Flatten failed. Now there are two solutions to the duplicate vertices/zero-length segment issue. Good work @zachri.jensen!

---

<div class="post-metadata">

**Author:** ![WrightEngineering](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/wrightengineering/32/115676_2.png) [@WrightEngineering](https://forum.dynamobim.com/u/WrightEngineering)\
**Post date:** [July 1, 2022, 8:13pm UTC](https://forum.dynamobim.com/t/object-geometry-returns-null-for-3d-polyline/57935/18 "2022-07-01T20:13:26Z")

</div>

Oh yes, I forgot about mapclean!
