Object.Geometry return's null for 3D polyline


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

Is there another way to get polycurve of 3D polyline ?
3Dpolyline_Test.dwg (887.8 KB)

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.

Civil 3D Toolkit


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

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

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


Very nice! :+1:


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

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

Thanks alot

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

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

@mzjensen 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.

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

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.

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.

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

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 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.


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.

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 @mzjensen!


Oh yes, I forgot about mapclean!