Import Kml To Autocad Civil 3d 2018 [ SAFE - HONEST REVIEW ]

Document doc = Application.DocumentManager.MdiActiveDocument; Database db = doc.Database; Editor ed = doc.Editor; // File selection string filename = SelectKMLFile(); if (string.IsNullOrEmpty(filename)) return;

// Transform & import ImportGeometry(kmlData, targetCsCode, db, tr); import kml to autocad civil 3d 2018

var kmlFile = KmlFile.Load(stream); var root = kmlFile.Root as Kml; if (root?.Feature is Placemark placemark) // Extract coordinates if (placemark.Geometry is Point point) var coord = point.Coordinate; geometries.Add(new KmlGeometry(GeometryType.Point, new[] new Coordinate(coord.Latitude, coord.Longitude, coord.Altitude) )); else if (placemark.Geometry is LineString line) var coords = line.Coordinates.Select(c => new Coordinate(c.Latitude, c.Longitude, c.Altitude)).ToArray(); geometries.Add(new KmlGeometry(GeometryType.Polyline, coords)); else if (placemark.Geometry is Polygon polygon) // Extract outer boundary var coords = polygon.OuterBoundary.LinearRing.Coordinates.Select(c => new Coordinate(c.Latitude, c.Longitude, c.Altitude)).ToArray(); geometries.Add(new KmlGeometry(GeometryType.Polygon, coords)); Document doc = Application

public List<KmlGeometry> ParseKML(string filepath) Document doc = Application.DocumentManager.MdiActiveDocument

public ObjectId Create3DPolyline(Point3dCollection points, Database db, Transaction tr)