Civil 3d Exploding Polyline Object

I’m making a Python script that asks the user to select a line, and explodes it into lines and arcs. I know this can be done with the built in Dynamo functions, but those wouldn’t work with my end goal for this program. In the code below, the “element” is an Autodesk.AutoCAD.DatabaseServices.Polyline object that has no matching method “Explode”. Is there another way to explode an object?

All the methods and code are adapted from the “Select Objects in the Drawing Area” section of the AutoDesk .NET Developers Guide

Can you convert it to a curve?

How so?

I am not 100% sure I have not worked with CAD in Dynamo.

Here is a post taking rebar and turning its line into a Dynamo Curve. I imaging you can do something similar with CAD.

Also, Have you looked at the BIMorph Nodes at all? These nodes were built for Revit but some of them should work for Civil3d.

Got something to work. I guess acDBObjColl acts as a sort of buffer where the exploded linework is stored. Explode() itself returns nothing. Working code is below: