Excellent! Thanks @norman.yuan
I have pretty much given up on the map forum. I found some shp export stuff in civil 3d as well so decided here was the best place to get the answer. I am using civil 3d 2016.
Here's the important parts.
using acapp = Autodesk.AutoCAD.ApplicationServices;
using acdb = Autodesk.AutoCAD.DatabaseServices;
using acgis = Autodesk.Gis.Map;
acdb.ObjectIdCollection expcoll = new acdb.ObjectIdCollection();
acapp.Document doc = acapp.Application.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
PromptEntityOptions peo = new PromptEntityOptions("\nSelect an export entity: ");
Autodesk.AutoCAD.Internal.Utils.SetFocusToDwgView();
PromptEntityResult per = ed.GetEntity(peo);
if (per.Status == PromptStatus.OK)
expcoll.Add(per.ObjectId);
acgis.MapApplication ma = acgis.HostMapApplicationServices.Application;
acgis.ImportExport.Exporter exp = ma.Exporter;
exp.Init("SHP", @"C:\\myacadfolder\\myshps\newfile.shp");
// exp.ExportAll = false;
exp.SetSelectionSet(expcoll);
acgis.ImportExport.ExpressionTargetCollection dm = null;
dm = exp.GetExportDataMappings();
exp.SetExportDataMappings(dm);
acgis.ImportExport.GeometryType lines = acgis.ImportExport.GeometryType.Line;
exp.SetStorageOptions(acgis.ImportExport.StorageType.FileOneEntityType, lines, string.Empty);
// exp.ClosedPolylinesAsPolygons = true;
acgis.ImportExport.ExportResults results;
try
{
results = exp.Export(true);
}
catch (acgis.MapImportExportException mee)
{
string badexport = "There is a problem with the export\n";
MessageBox.Show(badexport + mee.Message);
}