Point3dCollection col_point = new Point3dCollection();
Line ent_line = item as Line;
Point3d startPoint = ent_line.StartPoint;
Point3d endPoint = ent_line.EndPoint;
col_point.Add(startPoint);
col_point.Add(endPoint);
Polyline poly = new Polyline();
poly.Color = reg.Color;
poly.Closed = true;
poly.LineWeight = reg.LineWeight;
poly.LinetypeId = reg.LinetypeId;
PolylineTools.CreatePolyline(poly, col_point);
btr.AppendEntity(poly);
trans.AddNewlyCreatedDBObject(poly, true);
CAD .net二次开发直线转化多段线(Polyline)
本文转载:CSDN博客