COGO Point:
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)); import kml to autocad civil 3d 2018
var pl = new Polyline3d(Poly3dType.SimplePoly, points, false); var bt = tr.GetObject(db.CurrentSpaceId, OpenMode.ForWrite) as BlockTableRecord; var plId = bt.AppendEntity(pl); tr.AddNewlyCreatedDBObject(pl, true); return plId; COGO Point: var kmlFile = KmlFile
using (Transaction tr = db.TransactionManager.StartTransaction()) COGO Point: var kmlFile = KmlFile.Load(stream)
public ObjectId CreateCogoPoint(double northing, double easting, double elevation, Database db, Transaction tr)